Skip to content

Commit 51def91

Browse files
committed
nightly tarballs: compare the hashes to know if they're new
The filenames contain date/timestamps; if you compare those, the tarball generated every night will *always* be new. Instead, separate out the git hash from the old and new tarballs, and compare those. Signed-off-by: Jeff Squyres <[email protected]>
1 parent cad4c03 commit 51def91

File tree

3 files changed

+42
-17
lines changed

3 files changed

+42
-17
lines changed

contrib/build-server/hwloc-nightly-tarball.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ for branch in $branches; do
6868
echo "=== Branch: $branch"
6969
# Get the last tarball version that was made
7070
prev_snapshot=`cat $outputroot/$branch/latest_snapshot.txt`
71+
prev_snapshot_hash=`echo $prev_snapshot | cut -d- -f3`
72+
echo "=== Previous snapshot: $prev_snapshot (hash: $prev_snapshot_hash)"
7173

7274
# Form a URL-specific script name
7375
script=$branch-`basename $script_uri`
@@ -100,12 +102,19 @@ for branch in $branches; do
100102
module unload autotools
101103
echo "=== Done running script"
102104

103-
# Did the script generate a new tarball? If so, save it so that we can
104-
# spawn the coverity checker on it afterwards. Only for this for the
105-
# master (for now).
105+
# Did the script generate a new tarball? Ensure to compare the
106+
# only the hash of the previous tarball and the hash of the new
107+
# tarball (the filename also contains the date/timestamp, which
108+
# will always be different).
109+
110+
# If so, save it so that we can spawn the coverity checker on it
111+
# afterwards. Only for this for the master (for now).
106112
latest_snapshot=`cat $outputroot/$branch/latest_snapshot.txt`
107-
echo "=== Latest snapshot: $latest_snapshot"
108-
if test "$prev_snapshot" != "$latest_snapshot"; then
113+
latest_snapshot_hash=`echo $latest_snapshot | cut -d- -f3`
114+
echo "=== Latest snapshot: $latest_snapshot (hash: $latest_snapshot_hash)"
115+
if test "$prev_snapshot_hash" = "$latest_snapshot_hash"; then
116+
echo "=== Hash has not changed; no need to upload/save the new tarball"
117+
else
109118
if test "$branch" = "master"; then
110119
echo "=== Saving output for a Coverity run"
111120
echo "$outputroot/$branch/hwloc-$latest_snapshot.tar.bz2" >> $pending_coverity

contrib/build-server/openmpi-nightly-tarball.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ for branch in $branches; do
7070
echo "=== Branch: $branch"
7171
# Get the last tarball version that was made
7272
prev_snapshot=`cat $outputroot/$branch/latest_snapshot.txt`
73-
echo "=== Previous snapshot: $prev_snapshot"
73+
prev_snapshot_hash=`echo $prev_snapshot | cut -d- -f3`
74+
echo "=== Previous snapshot: $prev_snapshot (hash: $prev_snapshot_hash)"
7475

7576
code_uri=$master_code_uri
7677
raw_uri=$master_raw_uri
@@ -105,12 +106,19 @@ for branch in $branches; do
105106
module unload autotools
106107
echo "=== Done running script"
107108

108-
# Did the script generate a new tarball? If so, save it so that we can
109-
# spawn the coverity checker on it afterwards. Only for this for the
110-
# master (for now).
109+
# Did the script generate a new tarball? Ensure to compare the
110+
# only the hash of the previous tarball and the hash of the new
111+
# tarball (the filename also contains the date/timestamp, which
112+
# will always be different).
113+
114+
# If so, save it so that we can spawn the coverity checker on it
115+
# afterwards. Only for this for the master (for now).
111116
latest_snapshot=`cat $outputroot/$branch/latest_snapshot.txt`
112-
echo "=== Latest snapshot: $latest_snapshot"
113-
if test "$prev_snapshot" != "$latest_snapshot"; then
117+
latest_snapshot_hash=`echo $latest_snapshot | cut -d- -f3`
118+
echo "=== Latest snapshot: $latest_snapshot (hash: $latest_snapshot_hash)"
119+
if test "$prev_snapshot_hash" = "$latest_snapshot_hash"; then
120+
echo "=== Hash has not changed; no need to upload/save the new tarball"
121+
else
114122
if test "$branch" = "master"; then
115123
echo "=== Saving output for a Coverity run"
116124
echo "$outputroot/$branch/openmpi-$latest_snapshot.tar.bz2" >> $pending_coverity

contrib/build-server/pmix-nightly-tarball.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ for branch in $branches; do
6969
echo "=== Branch: $branch"
7070
# Get the last tarball version that was made
7171
prev_snapshot=`cat $outputroot/$branch/latest_snapshot.txt`
72-
echo "=== Previous snapshot: $prev_snapshot"
72+
prev_snapshot_hash=`echo $prev_snapshot | cut -d- -f3`
73+
echo "=== Previous snapshot: $prev_snapshot (hash: $prev_snapshot_hash)"
7374

7475
if test "$branch" = "master"; then
7576
code_uri=$master_code_uri
@@ -110,12 +111,19 @@ for branch in $branches; do
110111
module unload autotools
111112
echo "=== Done running script"
112113

113-
# Did the script generate a new tarball? If so, save it so that we can
114-
# spawn the coverity checker on it afterwards. Only for this for the
115-
# master (for now).
114+
# Did the script generate a new tarball? Ensure to compare the
115+
# only the hash of the previous tarball and the hash of the new
116+
# tarball (the filename also contains the date/timestamp, which
117+
# will always be different).
118+
119+
# If so, save it so that we can spawn the coverity checker on it
120+
# afterwards. Only for this for the master (for now).
116121
latest_snapshot=`cat $outputroot/$branch/latest_snapshot.txt`
117-
echo "=== Latest snapshot: $latest_snapshot"
118-
if test "$prev_snapshot" != "$latest_snapshot"; then
122+
latest_snapshot_hash=`echo $latest_snapshot | cut -d- -f3`
123+
echo "=== Latest snapshot: $latest_snapshot (hash: $latest_snapshot_hash)"
124+
if test "$prev_snapshot_hash" = "$latest_snapshot_hash"; then
125+
echo "=== Hash has not changed; no need to upload/save the new tarball"
126+
else
119127
if test "$branch" = "master"; then
120128
echo "=== Saving output for a Coverity run"
121129
echo "$outputroot/$branch/pmix-$latest_snapshot.tar.bz2" >> $pending_coverity

0 commit comments

Comments
 (0)