summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-03-16 09:01:19 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-03-16 09:01:19 -0700
commitf553ebb2dd0284805d8e49d48969ebde48ae2e25 (patch)
tree452532afae6b66fc29abd7716b69ab8088ea68a5 /tools
parentbc7bf663f2df564805fa5121de7b0006cf2149f2 (diff)
parent9cb9c4077dfcbb8c9f5feabf33617ba9366d9a34 (diff)
downloadscala-f553ebb2dd0284805d8e49d48969ebde48ae2e25.tar.gz
scala-f553ebb2dd0284805d8e49d48969ebde48ae2e25.tar.bz2
scala-f553ebb2dd0284805d8e49d48969ebde48ae2e25.zip
Merge pull request #281 from VladUreche/hack/verify-script
Adapted tools/verify-jar-cache to run on Ubuntu
Diffstat (limited to 'tools')
-rwxr-xr-xtools/verify-jar-cache10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/verify-jar-cache b/tools/verify-jar-cache
index 1e86264ecb..8a376a6987 100755
--- a/tools/verify-jar-cache
+++ b/tools/verify-jar-cache
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Discovers files whose sha sum does not match the
# sha embedded in their directory name from ~/.sbt/cache/scala.
@@ -9,14 +9,14 @@ cd ~/.sbt/cache/scala
unset failed
unset removal
-[[ $1 == "-f" ]] && removal=true
+[[ "$1" == "-f" ]] && removal=true
for file in $(find . -type f); do
sha=$(echo "${file:2}" | sed 's/\/.*$//')
sum=$(shasum "$file" | sed 's/ .*$//')
if [[ $sum != $sha ]]; then
failed=true
- if [[ -n $removal ]]; then
+ if [[ -n "$removal" ]]; then
echo "Removing corrupt file $file, shasum=$sum"
rm -rf $sha
else
@@ -25,9 +25,9 @@ for file in $(find . -type f); do
fi
done
-if [[ -z $failed ]]; then
+if [[ -z "$failed" ]]; then
echo "All cached files match their shas."
-elif [[ -z $removal ]]; then
+elif [[ -z "$removal" ]]; then
echo ""
echo "Run again with -f to remove the corrupt files."
fi