Created
February 1, 2013 05:05
-
-
Save leckylao/4689401 to your computer and use it in GitHub Desktop.
validate local cache gem checksums with the one from RubyGems (SHA512): http://cl.ly/MYie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
sum=$1 | |
gem=$(basename $2) | |
dir=${gem/.gem/} | |
home=$(gem env GEM_HOME) | |
# cd latest/$dir | |
cd $home/cache | |
local=`sha512sum ./$gem` | |
echo "==============" | |
echo $sum | |
echo $local | |
echo "==============" | |
# if [[ "" = $((echo $1 $2; $local | awk '{print $1 " " $2}') | uniq -u) ]]; then | |
if [[ $local != $sum ]]; then | |
echo $gem >> ../../valid_checksums.list | |
else | |
echo $gem >> ../../invalid_checksums.list | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
cat rubygems-shas | xargs -n 2 -P 20 ./validate_checksum.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment