Skip to content

Commit 5e7d863

Browse files
authored
Merge pull request #2338 from jsquyres/pr/rename-nightly-tarball
create_tarball.sh: update snapshot filename
2 parents 0cd200d + 78d1e4e commit 5e7d863

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

contrib/nightly/create_tarball.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# University of Stuttgart. All rights reserved.
1111
# Copyright (c) 2004-2005 The Regents of the University of California.
1212
# All rights reserved.
13-
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
1414
# $COPYRIGHT$
1515
#
1616
# Additional copyrights may follow
@@ -174,26 +174,31 @@ do_command "git clone $giturl ompi"
174174
cd ompi
175175
do_command "git checkout $gitbranch"
176176

177-
# Find the "git describe" string for this branch (remove a leading "ompi-"
178-
# prefix, if there is one).
179-
describe=`git describe --tags --always | sed -e s/^ompi-//`
177+
# Nightly tarballs are named in this format:
178+
# openmpi-${BRANCHNAME}-${YYYYMMDDHHMM}-${SHORTHASH}.tar.${COMPRESSION}
179+
timestamp=`date '+%Y%m%d%H%M'`
180+
githash=`git show '--pretty=format:%h'`
181+
version="$gitbranch-$timestamp-$githash"
180182
if test -n "$debug"; then
181-
echo "** found $gitbranch describe: $describe"
183+
echo "*** This snapshot version: $version"
182184
fi
183-
version=$describe
184185

185186
# if there's a $destdir/latest_snapshot.txt, see if anything has
186-
# happened since the describe listed in that file
187+
# happened since the version listed in that file
187188
if test -f "$destdir/latest_snapshot.txt"; then
188-
snapshot_describe=`cat $destdir/latest_snapshot.txt`
189+
snapshot_version=`cat $destdir/latest_snapshot.txt`
189190
if test -n "$debug"; then
190-
echo "** last snapshot describe: $snapshot_describe"
191+
echo "*** Last snapshot version: $snapshot_version"
191192
fi
192193

193194
# Do we need a new snapshot?
194-
if test "$describe" = "$snapshot_describe"; then
195+
# Snip the timestamp out of the versions and compare just
196+
# ${BRANCHNAME}-${SHORTHASH}.
197+
compare_version="$gitbranch-$githash"
198+
compare_snapshot_version=`echo $snapshot_version | perl -pi -e 's/^([a-z]+)-(\d+)-(.*+)$/$1-$3/'`
199+
if test "$compare_version" = "$compare_snapshot_version"; then
195200
if test -n "$debug"; then
196-
echo "** git $gitbranch describe is same as latest_snapshot -- not doing anything"
201+
echo "*** Our branch/git hash is the same as the last snapshot -- not doing anything"
197202
fi
198203
# Since we didn't do anything, there's no point in leaving the clone we
199204
# just created
@@ -206,14 +211,14 @@ if test -f "$destdir/latest_snapshot.txt"; then
206211
fi
207212

208213
if test -n "$debug"; then
209-
echo "** making snapshot for describe: $describe"
214+
echo "*** Houston: we're a go to make snapshot $version"
210215
fi
211216

212217
# Ensure that VERSION is set to indicate that it wants a snapshot, and
213218
# insert the actual value that we want (so that ompi_get_version.sh
214219
# will report exactly that version).
215-
sed -e 's/^repo_rev=.*/repo_rev='$describe/ \
216-
-e 's/^tarball_version=.*/tarball_version='$describe/ \
220+
sed -e 's/^repo_rev=.*/repo_rev='$githash/ \
221+
-e 's/^tarball_version=.*/tarball_version='$version/ \
217222
VERSION > VERSION.new
218223
cp -f VERSION.new VERSION
219224
rm -f VERSION.new

0 commit comments

Comments
 (0)