Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 150416

Summary: cleaning orphaned python bytecode more thoroughly in python.eclass
Product: Gentoo Linux Reporter: Fabian Groffen <grobian>
Component: EclassesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: grobian, haubi, liquidx
Priority: High    
Version: unspecified   
Hardware: All   
OS: Other   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch

Description Fabian Groffen gentoo-dev 2006-10-07 14:38:32 UTC
From Michael Haubenwallner:

Found this while preparing for another clean bootstrap, looking for
files left after the 'emerge -C':

$ cd var/db/pkg
$ emerge -C */*
$ cd ../../..
$ find . <some intelligent prunes to avoid finding cache & usr/portage>

patch (also attached)
@@ -217,11 +217,11 @@

        for path in ${SEARCH_PATH}; do
                einfo "Cleaning orphaned Python bytecode from ${path} .."
-               for obj in $(find ${path} -name *.pyc); do
-                       src_py="${obj%c}"
+               for obj in $(find ${path} -name *.py[co]); do
+                       src_py="${obj%[co]}"
                        if [ ! -f "${src_py}" ]; then
-                               einfo "Purging ${src_py}[co]"
-                               rm -f ${src_py}[co]
+                               einfo "Purging ${obj}"
+                               rm -f ${obj}
                        fi
                done
                # attempt to remove directories that maybe empty
Comment 1 Fabian Groffen gentoo-dev 2006-10-07 14:40:24 UTC
Created attachment 99081 [details, diff]
patch
Comment 2 Bryan Østergaard (RETIRED) gentoo-dev 2007-05-06 19:34:51 UTC
I fixed this quite a while ago.