From: Ted Zlatanov Date: Thu, 25 Nov 2010 09:27:59 +0000 (-0600) Subject: * admin/package-update.sh: Disable org-mode fetch by default. Add X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/46c8775caa216d130b8fb8b1ceb568f4dc6d2717 * 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. * 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. --- diff --git a/ChangeLog b/ChangeLog index ac586c11a..fa0f3278b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2010-11-25 Teodor Zlatanov + + * 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 * html/index.html, html/layout.css : Initial import. diff --git a/admin/org-synch.el b/admin/org-synch.el index b3fb70a20..2d9782a0c 100644 --- a/admin/org-synch.el +++ b/admin/org-synch.el @@ -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) diff --git a/admin/org-synch.sh b/admin/org-synch.sh index 45000b8f5..79c551b66 100755 --- a/admin/org-synch.sh +++ b/admin/org-synch.sh @@ -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 diff --git a/admin/package-update.sh b/admin/package-update.sh index db99b2794..38708b702 100755 --- a/admin/package-update.sh +++ b/admin/package-update.sh @@ -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