Running dep-clean gives the output These packages are installed but not in the portage tree. <list of packages> for all ebuilds in my local portage tree. Upon investigating the script, the problem is due to the cut command in the command the determines the ebuilds installed on the system. The command is extracting fields 4 and 6 from the output. This only works if the PORTDIR_OVERLAY directory is named something like /usr/portage.local In my case, I have /usr/local/portage as my local portage directory structure. I was able to fix the problem by changing lines 264-265 from: find /usr/portage ${PORTDIR_OVERLAY} -iname '*.ebuild' | \ cut -f4,6 -d/ | sed -e 's:\.ebuild::' > ${tmp}/ebuilds to: find /usr/portage ${PORTDIR_OVERLAY} -iname '*.ebuild' | \ awk -F'/' '{printf("%s/%s\n", $(NF-2), $NF)}' | \ sed -e 's:\.ebuild::' > ${tmp}/ebuilds There may be a more elegant method than AWK, but the above works correctly by printing the fields based upon the number of fields, rather than based upon a set number. Reproducible: Always Steps to Reproduce: 1. Set PORTDIR_OVERLAY to /usr/local/portage (or any directory structure more than two deep. 2. mkdir /usr/local/portage and place some ebuilds under the tree 3. dep-clean Actual Results: dep-clean will print all of the ebuilds in the local portage tree with the output: These packages are installed but not in the portage tree. <list of packages> Expected Results: dep-clean should not print the names of any of the packages that exist in the local portage tree as installed but not in the tree. Portage 2.0.49-r3 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-SuSE-100) ================================================================= System uname: 2.4.20-SuSE-100 i686 Pentium III (Coppermine) ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -O3 -pipe -funroll-loops" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=pentium3 -O3 -pipe -funroll-loops" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs sandbox ccache fixpackages" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 apm avi crypt cups encode foomaticdb gif jpeg libg++ libwww mad mikmod mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline arts svga java X sdl gpm tcpd pam ssl perl python esd imlib oggvorbis gnome gtk qt kde motif opengl mozilla alsa -oss pda samba i8x0 gtk2"
Created attachment 20838 [details, diff] Patch to fix incorrect cut & sed Since I messed up the line numbers in my last message. I adding the patch that I currently use against dep-clean to correct the cut & sed issue. This patch also gets the value of PORTDIR from portage instead of the hardcoded /usr/portage
fixed in CVS