Skip to content

Instantly share code, notes, and snippets.

@mccraigmccraig
Created January 31, 2013 12:02
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 mccraigmccraig/4682402 to your computer and use it in GitHub Desktop.
Save mccraigmccraig/4682402 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1
fi
echo This will take a while...
for gem in ~/.rbenv/versions/*/gemsets/*/cache/*.gem ; do
gemfile=$(basename $gem)
local=$(md5sum $gem | awk '{print $1}')
remote=$(curl -s -D - -X HEAD -H 'Connection:close' http://production.cf.rubygems.org/gems/$gemfile | grep 'ETag' | cut -d '"' -f 2)
if [[ ! $local = $remote ]]; then
echo FAIL: $gem mismatch. local: $local, remote: $remote
else
echo OK: $gem
fi
done
echo All done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment