Skip to content
This repository was archived by the owner on Nov 15, 2018. It is now read-only.

Commit 2359030

Browse files
author
Andy Goldstein
committed
Corrected checksum calculation to be repeatedly consistent by untarring the entire archive and piping the contents to sha1sum, so we do not take the file timestamps into account any more
1 parent 21c56d5 commit 2359030

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gear/prepare

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if tar tf $tmp_file .openshift/action_hooks/user_prepare 2>&1 > /dev/null; then
3838
tmp_file=$user_artifact
3939
fi
4040

41-
artifact_sha1=`sha1sum $tmp_file | cut -f 1 -d ' '`
41+
artifact_sha1=`tar xOf $tmp_file | sha1sum | cut -f 1 -d ' '`
4242

4343
# move the artifact to the artifacts dir
4444
artifact_dir=$ARTIFACTS_DIR/$artifact_sha1

gear/validate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ checksum=$1
99

1010
artifact_dir=$ARTIFACTS_DIR/$checksum
1111

12-
calculated_sha1=`sha1sum $artifact_dir/$checksum | cut -f 1 -d ' '`
12+
calculated_sha1=`tar xOf $artifact_dir/$checksum | sha1sum | cut -f 1 -d ' '`
1313

1414
if [ $checksum != $calculated_sha1 ]; then
1515
echo 'Artifact checksum verification failed - exiting'

0 commit comments

Comments
 (0)