Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1
fi
path="$HOME/.rvm/gems"
if [ ! -d $path ]
then
path=$(rvm info | grep "gem:" | grep -v bin | cut -f2 -d"\"")
path=$(dirname $path)
fi
echo Checking $path dir ...
echo This will take a while...
for x in $path/*; do
home=$x
cache=$home/cache
if [ -d $cache ]
then
for gem in $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 $gemfile mismatch. local: $local, remote: $remote
fi
done
fi
done
echo All done.
#!/bin/bash
if ! which openssl > /dev/null; then
echo Install openssl
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1
fi
path="$HOME/.rvm/gems"
if [ ! -d $path ]
then
path=$(rvm info | grep "gem:" | grep -v bin | cut -f2 -d"\"")
path=$(dirname $path)
fi
echo Checking $path dir ...
echo This will take a while...
for x in $path/*; do
home=$x
cache=$home/cache
if [ -d $cache ]
then
for gem in $cache/*.gem; do
gemfile=$(basename $gem)
local=$(openssl md5 $gem | awk '{print $2}')
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 $gemfile mismatch. local: $local, remote: $remote
fi
done
fi
done
echo All done.
@mpapis

This comment has been minimized.

Copy link

@mpapis mpapis commented Jan 31, 2013

extended version:

rvm get head
rvm rubygems validate
@taq

This comment has been minimized.

Copy link
Owner Author

@taq taq commented Jan 31, 2013

Nice!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment