TIP Clean Portage Package Dot Files

From Gentoo Linux Wiki

Jump to: navigation, search


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


[edit] See also:

TIP_Easy_cleaning_of_/etc/portage/package.keywords

Personal tools