Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/package/ebuild/_config/, cnf/
Date: Sat, 05 May 2012 06:48:10
Message-Id: 1336200447.33545ea18e8816addb3c54bb26a0cc788b8512e6.zmedico@gentoo
1 commit: 33545ea18e8816addb3c54bb26a0cc788b8512e6
2 Author: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 5 06:47:27 2012 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat May 5 06:47:27 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=33545ea1
7
8 Support COLLISION_IGNORE_UNOWNED="*.pyc *.pyo"
9
10 This will fix bug #410691.
11
12 ---
13 cnf/make.globals | 5 +++++
14 man/make.conf.5 | 7 +++++++
15 pym/portage/dbapi/vartree.py | 8 ++++++++
16 .../package/ebuild/_config/special_env_vars.py | 5 +++--
17 4 files changed, 23 insertions(+), 2 deletions(-)
18
19 diff --git a/cnf/make.globals b/cnf/make.globals
20 index 0f6f541..5f536c3 100644
21 --- a/cnf/make.globals
22 +++ b/cnf/make.globals
23 @@ -61,6 +61,11 @@ FEATURES="assume-digests binpkg-logs distlocks ebuild-locks
24 # FEATURES=protect-owned to operate smoothly in all cases.
25 COLLISION_IGNORE="/lib/modules"
26
27 +# Ignore file collisions for unowned *.pyo and *.pyc files, this helps during
28 +# transition from compiling python modules in live file system to compiling
29 +# them in src_install() function.
30 +COLLISION_IGNORE_UNOWNED="*.pyc *.pyo"
31 +
32 # Enable preserve-libs for testing with portage versions that support it.
33 # This setting is commented out for portage versions that don't support it.
34 FEATURES="${FEATURES} preserve-libs"
35
36 diff --git a/man/make.conf.5 b/man/make.conf.5
37 index e8777c8..7b1d4c0 100644
38 --- a/man/make.conf.5
39 +++ b/man/make.conf.5
40 @@ -134,6 +134,13 @@ This variable allows the user to disable \fIcollision\-protect\fR and
41 .br
42 Defaults to /lib/modules.
43 .TP
44 +\fBCOLLISION_IGNORE_UNOWNED\fR = \fI[space delimited list of shell patterns]\fR
45 +This variable allows the user to disable \fIcollision\-protect\fR and
46 +\fIprotect\-owned\fR for specific shell patterns for files that are
47 +not owned by any packages.
48 +.br
49 +Defaults to *.pyc and *.pyo patterns.
50 +.TP
51 \fBCONFIG_PROTECT\fR = \fI[space delimited list of files and/or directories]\fR
52 All files and/or directories that are defined here will have "config file protection"
53 enabled for them. See the \fBCONFIGURATION FILES\fR section
54
55 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
56 index ec9f87c..71b5d80 100644
57 --- a/pym/portage/dbapi/vartree.py
58 +++ b/pym/portage/dbapi/vartree.py
59 @@ -63,6 +63,7 @@ from _emerge.PollScheduler import PollScheduler
60 from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
61
62 import errno
63 +import fnmatch
64 import gc
65 import grp
66 import io
67 @@ -3080,6 +3081,9 @@ class dblink(object):
68 portage.util.shlex_split(
69 self.settings.get("COLLISION_IGNORE", ""))])
70
71 + unowned_ignore_patterns = self.settings.get(
72 + "COLLISION_IGNORE_UNOWNED", "").split()
73 +
74 # For collisions with preserved libraries, the current package
75 # will assume ownership and the libraries will be unregistered.
76 if self.vartree.dbapi._plib_registry is None:
77 @@ -3188,6 +3192,10 @@ class dblink(object):
78 if f.startswith(myignore + os.path.sep):
79 stopmerge = False
80 break
81 + for pattern in unowned_ignore_patterns:
82 + if fnmatch.fnmatch(f, pattern):
83 + stopmerge = False
84 + break
85 if stopmerge:
86 collisions.append(f)
87 return collisions, symlink_collisions, plib_collisions
88
89 diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
90 index 132f8eb..8eac380 100644
91 --- a/pym/portage/package/ebuild/_config/special_env_vars.py
92 +++ b/pym/portage/package/ebuild/_config/special_env_vars.py
93 @@ -134,8 +134,9 @@ environ_filter += [
94 # portage config variables and variables set directly by portage
95 environ_filter += [
96 "ACCEPT_CHOSTS", "ACCEPT_KEYWORDS", "ACCEPT_PROPERTIES", "AUTOCLEAN",
97 - "CLEAN_DELAY", "COLLISION_IGNORE", "CONFIG_PROTECT",
98 - "CONFIG_PROTECT_MASK", "EGENCACHE_DEFAULT_OPTS", "EMERGE_DEFAULT_OPTS",
99 + "CLEAN_DELAY", "COLLISION_IGNORE", "COLLISION_IGNORE_UNOWNED",
100 + "CONFIG_PROTECT", "CONFIG_PROTECT_MASK",
101 + "EGENCACHE_DEFAULT_OPTS", "EMERGE_DEFAULT_OPTS",
102 "EMERGE_LOG_DIR",
103 "EMERGE_WARNING_DELAY",
104 "FETCHCOMMAND", "FETCHCOMMAND_FTP",