10
10
# University of Stuttgart. All rights reserved.
11
11
# Copyright (c) 2004-2005 The Regents of the University of California.
12
12
# 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.
14
14
# $COPYRIGHT$
15
15
#
16
16
# Additional copyrights may follow
@@ -174,26 +174,31 @@ do_command "git clone $giturl ompi"
174
174
cd ompi
175
175
do_command " git checkout $gitbranch "
176
176
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 "
180
182
if test -n " $debug " ; then
181
- echo " ** found $gitbranch describe : $describe "
183
+ echo " *** This snapshot version : $version "
182
184
fi
183
- version=$describe
184
185
185
186
# 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
187
188
if test -f " $destdir /latest_snapshot.txt" ; then
188
- snapshot_describe =` cat $destdir /latest_snapshot.txt`
189
+ snapshot_version =` cat $destdir /latest_snapshot.txt`
189
190
if test -n " $debug " ; then
190
- echo " ** last snapshot describe : $snapshot_describe "
191
+ echo " *** Last snapshot version : $snapshot_version "
191
192
fi
192
193
193
194
# 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
195
200
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"
197
202
fi
198
203
# Since we didn't do anything, there's no point in leaving the clone we
199
204
# just created
@@ -206,14 +211,14 @@ if test -f "$destdir/latest_snapshot.txt"; then
206
211
fi
207
212
208
213
if test -n " $debug " ; then
209
- echo " ** making snapshot for describe: $describe "
214
+ echo " *** Houston: we're a go to make snapshot $version "
210
215
fi
211
216
212
217
# Ensure that VERSION is set to indicate that it wants a snapshot, and
213
218
# insert the actual value that we want (so that ompi_get_version.sh
214
219
# 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 / \
217
222
VERSION > VERSION.new
218
223
cp -f VERSION.new VERSION
219
224
rm -f VERSION.new
0 commit comments