diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2012-07-06 08:24:50 -0400 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2012-07-06 08:24:50 -0400 |
commit | 494ee668bec03182822b022f805dd38c6e062e60 (patch) | |
tree | 97ed887585d0e46489b8542eef9b77639225a2b2 /tools | |
parent | c39c7276c38f9ef66fd7054609ef33627efe5177 (diff) | |
download | scala-494ee668bec03182822b022f805dd38c6e062e60.tar.gz scala-494ee668bec03182822b022f805dd38c6e062e60.tar.bz2 scala-494ee668bec03182822b022f805dd38c6e062e60.zip |
Fix to push-jars to use same sha fixing that pull uses.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/binary-repo-lib.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/binary-repo-lib.sh b/tools/binary-repo-lib.sh index a22747520c..64f62a103d 100755 --- a/tools/binary-repo-lib.sh +++ b/tools/binary-repo-lib.sh @@ -75,24 +75,21 @@ pushJarFile() { local jar_dir=$(dirname $jar) local jar_name=${jar#$jar_dir/} pushd $jar_dir >/dev/null - local jar_sha1=$(shasum -p $jar_name) - local version=${jar_sha1% ?$jar_name} + local version=$(makeJarSha $jar_name) local remote_uri=${version}${jar#$basedir} echo " Pushing to ${remote_urlbase}/${remote_uri} ..." echo " $curl" curlUpload $remote_uri $jar_name $user $pw echo " Making new sha1 file ...." - echo "$jar_sha1" > "${jar_name}${desired_ext}" + echo "$version ?$jar_name" > "${jar_name}${desired_ext}" popd >/dev/null # TODO - Git remove jar and git add jar.desired.sha1 # rm $jar } -getJarSha() { +makeJarSha() { local jar=$1 - if [[ ! -f "$jar" ]]; then - echo "" - elif which sha1sum 2>/dev/null >/dev/null; then + if which sha1sum 2>/dev/null >/dev/null; then shastring=$(sha1sum "$jar") echo "$shastring" | sed 's/ .*//' elif which shasum 2>/dev/null >/dev/null; then @@ -104,6 +101,15 @@ getJarSha() { fi } +getJarSha() { + local jar=$1 + if [[ ! -f "$jar" ]]; then + echo "" + else + echo $(makeJarSha $jar) + fi +} + # Tests whether or not the .desired.sha1 hash matches a given file. # Arugment 1 - The jar file to test validity. # Returns: Empty string on failure, "OK" on success. |