[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 01/01: [maint] Fix bug: Rewrite PKG-VER extraction.

From: Thien-Thi Nguyen
Subject: [elpa] 01/01: [maint] Fix bug: Rewrite PKG-VER extraction.
Date: Thu, 22 May 2014 08:20:13 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 15f7732f4193e482df55e0843dbadac829f5d574
Author: Thien-Thi Nguyen <address@hidden>
Date:   Thu May 22 10:24:39 2014 +0200

    [maint] Fix bug: Rewrite PKG-VER extraction.
    Unfortunately, the inaugural run of this function gave bad results:
    * admin/update-archive.sh (announce_new): Take PKG-VER as $1;
    rename local var ‘file’ to ‘pv’, ‘version’ to ‘ver’; rewrite sed
    script; combine into one; use ‘eval’; add sanity check.
    <staging>: Extract PKG-VER into var ‘pv’; use it for ‘dst’;
    pass it to ‘announce_new’ instead of ‘f’.
 admin/update-archive.sh |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/admin/update-archive.sh b/admin/update-archive.sh
index d7d4e93..680298b 100755
--- a/admin/update-archive.sh
+++ b/admin/update-archive.sh
@@ -49,11 +49,11 @@ signal_error () {
 announce_new () {
     if [ "yes" != "$announce" ]; then return; fi
-    file="$1"
-    version="$(echo "$file" | sed -e 's|^.*/||' -e 
-    pkg="$(echo "$file" | sed -e 's|^.*/||' -e 
-    send_mail "$a_email" "[GNU ELPA] $pkg version $version" <<ENDDOC
-Version $version of GNU ELPA package $pkg has just been released.
+    pv="$1"
+    eval $(echo "$pv" | sed -e 's/^\(.*\)-\([^-]*\)$/pkg="\1" ver="\2"/')
+    test "$pkg" && test "$ver" || signal_error "bad PKG-VER: $pv"
+    send_mail "$a_email" "[GNU ELPA] $pkg version $ver" <<ENDDOC
+Version $ver of GNU ELPA package $pkg has just been released.
 You can now find it in M-x package-list RET.
 More at http://elpa.gnu.org/packages/$pkg.html
@@ -105,7 +105,9 @@ latest="emacs-packages-latest.tgz"
  cp -a staging staging-old
  # Move new files into place but don't throw out old package versions.
  for f in build/archive/packages/*; do
-     dst="staging/packages/$(basename "$f")"
+     # PKG-VER
+     pv=$(basename "$f")
+     dst="staging/packages/$pv"
      # Actually, let's never overwrite an existing version.  So changes can
      # be installed without causing a new package to be built until the
      # version field is changed.  Some files need to be excluded from the
@@ -118,7 +120,7 @@ latest="emacs-packages-latest.tgz"
                  mv "$f" "$dst"
                  # FIXME: Add a tag to remember the precise code used.
-                 announce_new "$f"
+                 announce_new "$pv"
              fi ;;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]