]> code.delx.au - gnu-emacs-elpa/blobdiff - admin/org-synch.sh
Adapt Org fetcher to archive-contents.el.
[gnu-emacs-elpa] / admin / org-synch.sh
index 86d57a4d845b4f962407b3a7f35497e4243cb1d1..6a13e8f1f9846a60b4f721803a4518c7863b4949 100755 (executable)
@@ -1,11 +1,15 @@
 #!/bin/sh
 
-pkgname=`/usr/bin/curl -s http://orgmode.org/pkg/daily/|/usr/bin/perl -ne 'push @f, $1 if m/(org-\d{8}\.tar)/; END { @f = sort @f; print "$f[-1]\n"}'`
-
-cd /home/elpa/
-/usr/bin/wget -q http://orgmode.org/pkg/daily/$pkgname
-if [ -f $pkgname ]; then
-    /bin/rm -f packages/org*.tar && \
-    /bin/mv $pkgname packages-new && \
-    /usr/bin/emacs -batch -l /home/elpa/bin/org-synch.el -f org-synch &> /home/elpa/update-log
+# this script expects $1 to be the download directory and $2 to have org-synch.el
+
+PATH="/bin:/usr/bin:/usr/local/bin:${PATH}"
+
+pkgname=`curl -s http://orgmode.org/pkg/daily/|perl -ne 'push @f, $1 if m/(org-\d{8}\.tar)/; END { @f = sort @f; print "$f[-1]\n"}'`
+
+cd $1
+wget -q http://orgmode.org/pkg/daily/${pkgname} -O ${pkgname}-tmp
+if [ -f ${pkgname}-tmp ]; then
+    rm -f org*.tar
+    mv ${pkgname}-tmp ${pkgname} && \
+    emacs -batch -l $2/org-synch.el --eval "(org-synch \"${pkgname}\")"
 fi