Search:  
Gentoo Wiki

TIP_Clean_Portage_Package_Dot_Files

This is a script I created to determine what I could remove from package.use and package.keywords. I hope you find it useful.

It will not change any files; it will merely show you which ones are unnessecary.. usage: ./CheckPackageFiles.sh use/keywords

File: CheckPackageFiles.sh
#!/bin/bash

TMPDIR=`mktemp -d`

case $1 in 
	use )
		for i in `< /etc/portage/package.use` ; do echo $i >> $TMPDIR/usetmp1 ; done
		grep "/" $TMPDIR/usetmp1 | sort > $TMPDIR/usetmp2
		qpkg -I -nc | sort > $TMPDIR/usetmp3
		echo "The following packages are not installed on the system, yet present in package.use"
		diff $TMPDIR/usetmp2 $TMPDIR/usetmp3 | grep "<"
	;;
	keywords )
		for i in `< /etc/portage/package.keywords` ; do echo $i >> $TMPDIR/keywordstmp1 ; done
		grep "/" $TMPDIR/keywordstmp1 | sort > $TMPDIR/keywordstmp2
		qpkg -I -nc | sort > $TMPDIR/keywordstmp3
		echo "The following packages are not installed on the system, yet present in package.keywords"
		diff $TMPDIR/keywordstmp2 $TMPDIR/keywordstmp3 | grep "<"
	;;
esac

rm -fr $TMPDIR


See also:

TIP Easy cleaning of /etc/portage/package.keywords

Retrieved from "http://www.gentoo-wiki.info/TIP_Clean_Portage_Package_Dot_Files"

Last modified: Fri, 05 Sep 2008 22:10:00 +0000 Hits: 13,104