summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-03-16 15:36:49 +0100
committerVlad Ureche <vlad.ureche@gmail.com>2012-03-16 16:44:14 +0100
commit9cb9c4077dfcbb8c9f5feabf33617ba9366d9a34 (patch)
treefa5a4152d6e1bd03f3562e839634d0239494c034 /tools
parentf987afe55e6d4f71c7e9ad10d1ca9f6120dc1132 (diff)
downloadscala-9cb9c4077dfcbb8c9f5feabf33617ba9366d9a34.tar.gz
scala-9cb9c4077dfcbb8c9f5feabf33617ba9366d9a34.tar.bz2
scala-9cb9c4077dfcbb8c9f5feabf33617ba9366d9a34.zip
Adapted tools/verify-jar-cache for 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