Skip to content

Instantly share code, notes, and snippets.

@tyrannasaurusbanks
Last active December 24, 2015 09:49
Show Gist options
  • Save tyrannasaurusbanks/6779968 to your computer and use it in GitHub Desktop.
Save tyrannasaurusbanks/6779968 to your computer and use it in GitHub Desktop.
find all bad dependencies listed in a file
#!/bin/sh
echo " This should be run from the the modules base directory. It should:"
echo " - loop through each dependency listed in the supplied file"
echo " - then check to see if that dependency is used in any of the ivy.xml files"
echo " - if it finds a match, then it should print it out along with the path to the file it was in."
USAGE="findBadDependencies toBeFound.txt"
if ["$1" = ""]; then
echo "Where's the dependencies file dufus?"
echo $USAGE
exit 1
fi
echo " file supplied: " $1
echo " Looping through dependencies listed in the file..."
while read line
do
echo "line = " $line
dependencyName=`echo $line`
echo $dependencyName
if [ "$dependencyName" != "" ]
then
#echo " - Downgrading " $dependencyName " to " $version
for FILE in `find . -name ivy.xml -exec grep -l "<dependency name=\"$dependencyName\"" {} \;`
do
echo " " $FILE " contains a dependency on " $dependencyName
done
fi
done < $1
echo " DONE!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment