+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.
-(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)
# 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
#/bin/sh
+PATH=/bin:/usr/bin:/usr/local/bin
ROOT=$1
+FETCHEXTRAS=$2
+
LOG=$ROOT/update-log
PKGROOT=$ROOT/packages
ADMINROOT=$ROOT/admin
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'"
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