Skip to content

Instantly share code, notes, and snippets.

@leckylao
Created February 1, 2013 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leckylao/4689401 to your computer and use it in GitHub Desktop.
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
#!/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
#!/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