aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-07 23:23:40 -0700
committerZac Medico <zmedico@gentoo.org>2012-05-07 23:23:40 -0700
commitbc18e1e7c3af475412e997489058c58942ebfdcb (patch)
tree807396453e764cfb42796aeef0b11c8d4dbb17a3 /pym/portage/dbapi
parentCOLLISION_IGNORE: handle prefix (diff)
downloadportage-bc18e1e7c3af475412e997489058c58942ebfdcb.tar.gz
portage-bc18e1e7c3af475412e997489058c58942ebfdcb.tar.bz2
portage-bc18e1e7c3af475412e997489058c58942ebfdcb.zip
COLLISION_IGNORE: support fnmatch patterns
This allows it to be combined with the COLLISION_IGNORE_UNOWNED variable from commit 33545ea18e8816addb3c54bb26a0cc788b8512e6, so only one variable is needed.
Diffstat (limited to 'pym/portage/dbapi')
-rw-r--r--pym/portage/dbapi/vartree.py23
1 files changed, 8 insertions, 15 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index ee77fac4f..158fc4a02 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3077,12 +3077,13 @@ class dblink(object):
os = _os_merge
- collision_ignore = set([normalize_path(myignore) for myignore in \
- portage.util.shlex_split(
- self.settings.get("COLLISION_IGNORE", ""))])
-
- unowned_ignore_patterns = self.settings.get(
- "COLLISION_IGNORE_UNOWNED", "").split()
+ collision_ignore = []
+ for x in portage.util.shlex_split(
+ self.settings.get("COLLISION_IGNORE", "")):
+ if os.path.isdir(os.path.join(self._eroot, x.lstrip(os.sep))):
+ x = normalize_path(x)
+ x += "/*"
+ collision_ignore.append(x)
# For collisions with preserved libraries, the current package
# will assume ownership and the libraries will be unregistered.
@@ -3185,15 +3186,7 @@ class dblink(object):
if not isowned:
f_match = full_path[len(self._eroot)-1:]
stopmerge = True
- if collision_ignore:
- if f_match in collision_ignore:
- stopmerge = False
- else:
- for myignore in collision_ignore:
- if f_match.startswith(myignore + os.path.sep):
- stopmerge = False
- break
- for pattern in unowned_ignore_patterns:
+ for pattern in collision_ignore:
if fnmatch.fnmatch(f_match, pattern):
stopmerge = False
break