From bc18e1e7c3af475412e997489058c58942ebfdcb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 7 May 2012 23:23:40 -0700 Subject: 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. --- pym/portage/dbapi/vartree.py | 23 ++++++++-------------- .../package/ebuild/_config/special_env_vars.py | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'pym') 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 diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py index 8eac38034..763237d85 100644 --- a/pym/portage/package/ebuild/_config/special_env_vars.py +++ b/pym/portage/package/ebuild/_config/special_env_vars.py @@ -134,7 +134,7 @@ environ_filter += [ # portage config variables and variables set directly by portage environ_filter += [ "ACCEPT_CHOSTS", "ACCEPT_KEYWORDS", "ACCEPT_PROPERTIES", "AUTOCLEAN", - "CLEAN_DELAY", "COLLISION_IGNORE", "COLLISION_IGNORE_UNOWNED", + "CLEAN_DELAY", "COLLISION_IGNORE", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "EGENCACHE_DEFAULT_OPTS", "EMERGE_DEFAULT_OPTS", "EMERGE_LOG_DIR", -- cgit v1.2.3-1-g7c22