This will fix bug #410691.
# FEATURES=protect-owned to operate smoothly in all cases.
COLLISION_IGNORE="/lib/modules"
+# Ignore file collisions for unowned *.pyo and *.pyc files, this helps during
+# transition from compiling python modules in live file system to compiling
+# them in src_install() function.
+COLLISION_IGNORE_UNOWNED="*.pyc *.pyo"
+
# Enable preserve-libs for testing with portage versions that support it.
# This setting is commented out for portage versions that don't support it.
FEATURES="${FEATURES} preserve-libs"
.br
Defaults to /lib/modules.
.TP
+\fBCOLLISION_IGNORE_UNOWNED\fR = \fI[space delimited list of shell patterns]\fR
+This variable allows the user to disable \fIcollision\-protect\fR and
+\fIprotect\-owned\fR for specific shell patterns for files that are
+not owned by any packages.
+.br
+Defaults to *.pyc and *.pyo patterns.
+.TP
\fBCONFIG_PROTECT\fR = \fI[space delimited list of files and/or directories]\fR
All files and/or directories that are defined here will have "config file protection"
enabled for them. See the \fBCONFIGURATION FILES\fR section
from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
import errno
+import fnmatch
import gc
import grp
import io
portage.util.shlex_split(
self.settings.get("COLLISION_IGNORE", ""))])
+ unowned_ignore_patterns = self.settings.get(
+ "COLLISION_IGNORE_UNOWNED", "").split()
+
# For collisions with preserved libraries, the current package
# will assume ownership and the libraries will be unregistered.
if self.vartree.dbapi._plib_registry is None:
if f.startswith(myignore + os.path.sep):
stopmerge = False
break
+ for pattern in unowned_ignore_patterns:
+ if fnmatch.fnmatch(f, pattern):
+ stopmerge = False
+ break
if stopmerge:
collisions.append(f)
return collisions, symlink_collisions, plib_collisions
# portage config variables and variables set directly by portage
environ_filter += [
"ACCEPT_CHOSTS", "ACCEPT_KEYWORDS", "ACCEPT_PROPERTIES", "AUTOCLEAN",
- "CLEAN_DELAY", "COLLISION_IGNORE", "CONFIG_PROTECT",
- "CONFIG_PROTECT_MASK", "EGENCACHE_DEFAULT_OPTS", "EMERGE_DEFAULT_OPTS",
+ "CLEAN_DELAY", "COLLISION_IGNORE", "COLLISION_IGNORE_UNOWNED",
+ "CONFIG_PROTECT", "CONFIG_PROTECT_MASK",
+ "EGENCACHE_DEFAULT_OPTS", "EMERGE_DEFAULT_OPTS",
"EMERGE_LOG_DIR",
"EMERGE_WARNING_DELAY",
"FETCHCOMMAND", "FETCHCOMMAND_FTP",