Support COLLISION_IGNORE_UNOWNED="*.pyc *.pyo"
authorKrzysztof Pawlik <nelchael@gentoo.org>
Sat, 5 May 2012 06:47:27 +0000 (23:47 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 5 May 2012 06:47:27 +0000 (23:47 -0700)
This will fix bug #410691.

cnf/make.globals
man/make.conf.5
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/_config/special_env_vars.py

index 0f6f541651489606249cbad5077bc7b6a1cf4374..5f536c33ab0f54f65a4847e4edef8b3f753d4032 100644 (file)
@@ -61,6 +61,11 @@ FEATURES="assume-digests binpkg-logs distlocks ebuild-locks
 # 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"
index e8777c84050b9fce125f2bdfd25b51185b115f91..7b1d4c0469fcb3414210a4c58744c04f565999a2 100644 (file)
@@ -134,6 +134,13 @@ This variable allows the user to disable \fIcollision\-protect\fR and
 .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
index ec9f87c3570fc65ffbde257bb6be79860a9135c7..71b5d80e726e3e9216ceeb285c029cdddc55ba9f 100644 (file)
@@ -63,6 +63,7 @@ from _emerge.PollScheduler import PollScheduler
 from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
 
 import errno
+import fnmatch
 import gc
 import grp
 import io
@@ -3080,6 +3081,9 @@ class dblink(object):
                                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:
@@ -3188,6 +3192,10 @@ class dblink(object):
                                                                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
index 132f8ebd863e23c79ebbdde4938d92706e18c9d1..8eac3803431e2b04ae9465d60d44f7f8ea0fa6df 100644 (file)
@@ -134,8 +134,9 @@ environ_filter += [
 # 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",