]> code.delx.au - gnu-emacs-elpa/commitdiff
* admin/package-update.sh: Disable org-mode fetch by default. Add
authorTed Zlatanov <tzz@lifelogs.com>
Thu, 25 Nov 2010 09:27:59 +0000 (03:27 -0600)
committerTed Zlatanov <tzz@lifelogs.com>
Thu, 25 Nov 2010 09:27:59 +0000 (03:27 -0600)
option ($2 set to anything) to run fetchers anyway.  Use PATH
instead of explicit executables.  Create tarballs from the
unpackages packages in $PACKAGE_TARBALLS.

* admin/org-synch.sh: Use PATH instead of explicit executables.
Qualify $pkgname consistently.  Run org-synch.el with --eval to
pass $pkgname directly.

* admin/org-synch.el (org-synch): Take a package filename
parameter instead of guessing the package name.  Extract the date
as a fixed substring and do sanity checking on it.

ChangeLog
admin/org-synch.el
admin/org-synch.sh
admin/package-update.sh

index ac586c11a82b63333845fd41f1cef7bf780fcae2..fa0f3278b669ecd462265838fd52a020389a33fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-11-25  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * admin/org-synch.el (org-synch): Take a package filename
+       parameter instead of guessing the package name.  Extract the date
+       as a fixed substring and do sanity checking on it.
+
+       * admin/org-synch.sh: Use PATH instead of explicit executables.
+       Qualify $pkgname consistently.  Run org-synch.el with --eval to
+       pass $pkgname directly.
+
+       * admin/package-update.sh: Disable org-mode fetch by default.  Add
+       option ($2 set to anything) to run fetchers anyway.  Use PATH
+       instead of explicit executables.  Create tarballs from the
+       unpackages packages in $PACKAGE_TARBALLS.
+
 2010-11-20  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * html/index.html, html/layout.css : Initial import.
index b3fb70a20248b7ca93607d0e0adf694d1bc0525b..2d9782a0c8bab4483dadcf7936e5f7868ce5e89b 100644 (file)
@@ -1,10 +1,13 @@
-(defun org-synch ()
-  (let* ((date (shell-command-to-string "/bin/date '+%Y%m%d'")) ; TODO: should use the Emacs built-ins
-        (archive-file "archive-contents")
+(defun org-synch (package-file)
+  (let* ((archive-file "archive-contents")
         (package-name 'org)
-        package-file contents entry)
-    (setq date (substring date 0 (- (length date) 1))
-         package-file (concat (symbol-name package-name) "-" date ".tar"))
+         (date (substring package-file 4 12))
+         (date-int (string-to-number date))
+        contents entry)
+    (unless (and (integerp date-int)
+                 (> date-int 20100000)
+                 (< date-int 21000000))
+      (error "Package date is bad"))
     (unless (file-exists-p package-file)
       (error "No package file found"))
     (unless (file-exists-p archive-file)
index 45000b8f50b7044c59e492d198b23d7a6d49f057..79c551b66c1b5176fe867ba8a788c7e854ebdfb7 100755 (executable)
@@ -2,12 +2,14 @@
 
 # this script expects $1 to be the download directory and $2 to have org-synch.el
 
-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"}'`
+PATH=/bin:/usr/bin:/usr/local/bin
+
+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
-/usr/bin/wget -q http://orgmode.org/pkg/daily/$pkgname -O ${pkgname}-tmp
+wget -q http://orgmode.org/pkg/daily/${pkgname} -O ${pkgname}-tmp
 if [ -f ${pkgname}-tmp ]; then
-    /bin/rm -f org*.tar
-    /bin/mv ${pkgname}-tmp $pkgname && \
-    /usr/bin/emacs -batch -l $2/org-synch.el -f org-synch
+    rm -f org*.tar
+    mv ${pkgname}-tmp ${pkgname} && \
+    emacs -batch -l $2/org-synch.el --eval "(org-synch \"${pkgname}\")"
 fi
index db99b27942689cc8f630288076d2aa64bc067267..38708b7024d1ddae278fabc1b63ebeabbcfbdc4e 100755 (executable)
@@ -1,6 +1,9 @@
 #/bin/sh
 
+PATH=/bin:/usr/bin:/usr/local/bin
 ROOT=$1
+FETCHEXTRAS=$2
+
 LOG=$ROOT/update-log
 PKGROOT=$ROOT/packages
 ADMINROOT=$ROOT/admin
@@ -12,8 +15,10 @@ REPO=bzr://bzr.savannah.gnu.org/emacs/elpa
 REPO_PACKAGES=$REPO/packages
 REPO_ADMIN=$REPO/admin
 
+PACKAGE_TARBALLS="auctex-11.86 company-0.5 muse-3.20"
+
 if [ -z $ROOT ]; then
-    echo "Syntax: $0 HOMEDIR"
+    echo "Syntax: $0 HOMEDIR [fetch-extras-boolean]"
     exit 1
 elif [ -d $ROOT ]; then
     echo "Installing into '$ROOT', log is '$LOG'"
@@ -28,24 +33,39 @@ fi
 echo "[$TMPROOT -> $PKGROOT] Creating the world-facing package repository copy in $PKGROOT" >> $LOG
 TMPROOT=$PKGROOT-new
 rm -rf $TMPROOT
-/usr/bin/bzr export $TMPROOT $REPO_PACKAGES
+bzr export $TMPROOT $REPO_PACKAGES
 
 echo "[$TMPROOT -> $PKGROOT] Running the post-export fetchers in $ADMINROOT against $TMPROOT" >> $LOG
 rm -rf $ADMINROOT
 bzr export $ADMINROOT $REPO_ADMIN
 
-# Copy the org daily package from orgmode.org
-echo "[$TMPROOT -> $PKGROOT] Running the post-export org-mode fetcher as '$ADMINROOT/org-synch.sh $TMPROOT $ADMINROOT'" >> $LOG
-$ADMINROOT/org-synch.sh $TMPROOT $ADMINROOT >> $LOG 2>&1
+if [ -z $FETCHEXTRAS ]; then
+    echo "Skipping the post-export fetchers" >> $LOG
+    echo "(pass 1 as the second parameter to get them with $0 or just run them manually)" >> $LOG
+else
+    # Copy the org daily package from orgmode.org
+    echo "[$TMPROOT -> $PKGROOT] Running the post-export org-mode fetcher as '$ADMINROOT/org-synch.sh $TMPROOT $ADMINROOT'" >> $LOG
+    $ADMINROOT/org-synch.sh $TMPROOT $ADMINROOT >> $LOG 2>&1
+fi
+
+echo "Creating tarballs from unpacked packages $PACKAGE_TARBALLS in $TMPROOT" >> $LOG
+cd $TMPROOT
+for pt in $PACKAGE_TARBALLS; do
+    echo "Creating tarball of $pt: tar of $TMPROOT/$pt into $TMPROOT/$pt.tar" >> $LOG
+    tar -cf $pt.tar $pt
+    echo "Removing $TMPROOT/$pt" >> $LOG
+    rm -rf $pt
+done
+cd ..
 
 echo "[$TMPROOT -> $PKGROOT] Moving $TMPROOT to $PKGROOT" >> $LOG
-/bin/mv $PKGROOT $PKGROOT-old
-/bin/mv $TMPROOT $PKGROOT
-/bin/rm -rf $PKGROOT-old
+mv $PKGROOT $PKGROOT-old
+mv $TMPROOT $PKGROOT
+rm -rf $PKGROOT-old
 
 echo "Exporting packages into $TARBALL (root = $TARBALL_ROOT)" >> $LOG
-/usr/bin/bzr export --format=tgz --root=$TARBALL_ROOT $TARBALL $REPO_PACKAGES
+bzr export --format=tgz --root=$TARBALL_ROOT $TARBALL $REPO_PACKAGES
 
-/bin/chmod -R a+rX $PKGROOT
+chmod -R a+rX $PKGROOT
 
 echo "Update complete at" `/bin/date` >> $LOG