]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
Fix make_nightly_snapshot processing.
authorJeff Squyres <jsquyres@cisco.com>
Fri, 4 Oct 2013 02:19:48 +0000 (19:19 -0700)
committerJeff Squyres <jsquyres@cisco.com>
Fri, 4 Oct 2013 02:19:48 +0000 (19:19 -0700)
Leave *only one place* where "git desribe" is invoked and set into the
snapshot_version field in VERSION: the make_nightly_snapshot script.
distscript.csh no longer twiddles the VERSION file.

config/distscript.csh
contrib/nightly/make_snapshot_tarball [changed mode: 0644->0755]

index 5304ad4ec608a230a9226e3ed68a5e3690a42c7e..e52822389d44a36bfb121b576a3757d5b607c9d9 100755 (executable)
@@ -47,34 +47,6 @@ else
     set vpath_msg=no
 endif
 
-# Check the VERSION file.  If snapshot=1 and snapshot_version is
-# empty, then ensure that we're in a source tree and fill in
-# snapshot_version with an appropriate value (note: this case happens
-# when a developer just does "make dist" from a git clone/developer
-# tree, and doesn't use the contrib/nightly/make_nightly_snapshot
-# script, which will edit VERSION before running "make dist").
-if (-d .git || -d ../.git) then
-    set snapshot="`grep '^snapshot\s*=' ${distdir}/VERSION | cut -d= -f2`"
-    set snapshot_version="`grep '^snapshot_version\s*=' ${distdir}/VERSION | cut -d= -f2`"
-
-    # Update VERSION is $snapshot==1 and $snapshot_version is empty.
-    if ("$snapshot" == "1" && "$snapshot_version" == "") then
-        set describe=`git describe --always | sed -e s/^hwloc-// | grep -v fatal`
-        # Safety: if git describe failed, then assign "unknown" (I'm
-        # not sure how this can happen; just being defensive)
-        if ("$describe" == "") then
-            describe="unknown"
-        endif
-
-        sed -e 's/^snapshot_version\s*=.*/snapshot_version='$describe'/' "${distdir}/VERSION" > "${distdir}/version.new"
-        cp "${distdir}/version.new" "${distdir}/VERSION"
-        rm -f "${distdir}/version.new"
-        # Reset the timestamp to preserve AM dependencies
-        touch -r "${srcdir}/VERSION" "${distdir}/VERSION"
-        echo "*** Updated VERSION file with snapshot version: $describe"
-    endif
-endif
-
 set start=`date`
 cat <<EOF
  
old mode 100644 (file)
new mode 100755 (executable)
index 42ed7f9..f069caa
@@ -168,7 +168,7 @@ do_command "git checkout $gitbranch"
 
 # Find the "git describe" string for this branch (remove a leading "hwloc-"
 # prefix, if there is one).
-describe=`git describe --always | sed -e s/^hwloc-//`
+describe=`git describe --tags --always | sed -e s/^hwloc-//`
 if test -n "$debug"; then
     echo "** found $gitbranch describe: $describe"
 fi
@@ -201,11 +201,11 @@ if test -n "$debug"; then
     echo "** making snapshot for describe: $describe"
 fi
 
-# Ensure that VERSION is set to indicate that it wants a snapshot, but
-# don't specify the snapshot version string (because "make dist"
-# [i.e., config/distscript.csh] will insert the actual value).
+# Ensure that VERSION is set to indicate that it wants a snapshot, and
+# insert the actual value that we want (so that hwloc_get_version.sh
+# will report exactly that version).
 sed -e 's/^snapshot=.*/snapshot=1/' \
-    -e 's/^snapshot_version=.*/snapshot_version=/' \
+    -e 's/^snapshot_version=.*/snapshot_version='$describe/ \
     VERSION > VERSION.new
 cp -f VERSION.new VERSION
 rm -f VERSION.new