Created
June 13, 2011 16:30
-
-
Save natw/1023117 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
function main() { | |
for rpath in `repo_paths`; do | |
url="http://frogbucket$rpath/raw-file/tip/Gemfile.lock" | |
lines=`core_line` | |
if [[ $lines ]]; then | |
echo "$rpath" | |
echo "$lines" | while read line; do | |
echo -e "\t$line" | |
done | |
fi | |
done | |
} | |
function repo_paths() { | |
curl http://frogbucket/repos/ 2> /dev/null | | |
grep "a href" | | |
grep "lpp_" | | |
grep -v "/users" | # remove assorted undesirable lines | |
grep -v "<li>" | | |
grep -v "/rev/" | | |
tail -r | # reverse the order of the lines | |
cut -d \" -f 2 | # just the URI | |
grep -v "/admin/" | # remove a few more undesirable URIs | |
grep -v "login/?next" | | |
grep -v "^/$" | |
} | |
function core_line() { | |
curl -f $url 2> /dev/null | | |
grep "lpp-core " | | |
sed 's/^\s*//g' | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment