Created
May 6, 2015 12:48
-
-
Save garymacindoe/2cc122dbc3edf7d40a7f to your computer and use it in GitHub Desktop.
Checks for invalid/obsolete entries in Gentoo Portage's world file
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 | |
# | |
# Author: Gary Macindoe | |
# Date: May 2015 | |
WORLD_FILE=/var/lib/portage/world | |
while read package; | |
do | |
DEPS=$(grep -l ${package} /var/db/pkg/*/*/{,R}DEPEND | cut -d'/' -f5,6 | sort -u); | |
if [ "${DEPS}" ] && [[ "${DEPS}" != "${package}"-* ]]; | |
then | |
echo -e "\E[1;31;40m${package}\E[0m" | |
echo "${DEPS}" | while read dep | |
do | |
echo " ${dep}" | |
done | |
else | |
echo -e "\E[1;32;40m${package}\E[0m" | |
fi | |
done < ${WORLD_FILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment