Permalink
Browse files

HWLOC_SVN_R no longer exists; remove it from Makefile.am, and don't

expect a 4th argument to distscript.csh.

Also, have distscript fill in VERSION:snapshot_version only if
snapshot=1 and snapshot_version is empty.
  • Loading branch information...
1 parent 233232e commit c2b7f3d3c713feadb1d2c5a7ccd747cb6673d249 @jsquyres jsquyres committed Sep 28, 2013
Showing with 26 additions and 27 deletions.
  1. +1 −1 Makefile.am
  2. +25 −26 config/distscript.csh
View
@@ -62,7 +62,7 @@ if !HWLOC_BUILD_README
dist-hook: cannot-dist
else
dist-hook:
- csh "$(top_srcdir)/config/distscript.csh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)" "$(HWLOC_SVN_R)"
+ csh "$(top_srcdir)/config/distscript.csh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)"
endif HWLOC_BUILD_README
endif HWLOC_BUILD_DOXYGEN
endif HWLOC_BUILD_STANDALONE
View
@@ -28,7 +28,6 @@ cd "$builddir"
set distdir="$builddir/$2"
set HWLOC_VERSION="$3"
-set HWLOC_REPO_REV="$4"
if ("$distdir" == "") then
echo "Must supply relative distdir as argv[2] -- aborting"
@@ -48,13 +47,32 @@ else
set vpath_msg=no
endif
-# We can catch some hard (but possible) to do mistakes by looking at
-# our tree's revision number, but only if we are in the source tree.
-# Otherwise, use what configure told us, at the cost of allowing one
-# or two corner cases in (but otherwise VPATH builds won't work).
-set repo_rev=$HWLOC_REPO_REV
+# 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 repo_rev=`git describe --always | sed -e s/^hwloc-//`
+ 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`
@@ -64,7 +82,6 @@ Creating hwloc distribution
In directory: `pwd`
Srcdir: $srcdir
Builddir: $builddir
-Repo rev: $repo_rev
VPATH: $vpath_msg
Version: $HWLOC_VERSION
Started: $start
@@ -80,24 +97,6 @@ if (! -d "$distdir") then
endif
#
-# See if we need to update the version file with the current repo
-# revision number. Do this *before* entering the distribution tree to
-# solve a whole host of problems with VPATH (since srcdir may be
-# relative or absolute)
-#
-set cur_repo_rev="`grep '^repo_rev' ${distdir}/VERSION | cut -d= -f2`"
-if ("$cur_repo_rev" == "-1") then
- sed -e 's/^repo_rev=.*/repo_rev='$repo_rev'/' "${distdir}/VERSION" > "${distdir}/version.new"
- cp "${distdir}/version.new" "${distdir}/VERSION"
- rm -f "${distdir}/version.new"
- # need to reset the timestamp to not annoy AM dependencies
- touch -r "${srcdir}/VERSION" "${distdir}/VERSION"
- echo "*** Updated VERSION file with repo rev number: $repo_rev"
-else
- echo "*** Did NOT update VERSION file with repo rev number"
-endif
-
-#
# VPATH builds only work if the srcdir has valid docs already built.
# If we're VPATH and the srcdir doesn't have valid docs, then fail.
#

0 comments on commit c2b7f3d

Please sign in to comment.