* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/package/ebuild/_config/, cnf/
@ 2012-05-05 6:47 Zac Medico
0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2012-05-05 6:47 UTC (permalink / raw
To: gentoo-commits
commit: 33545ea18e8816addb3c54bb26a0cc788b8512e6
Author: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
AuthorDate: Sat May 5 06:47:27 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 5 06:47:27 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=33545ea1
Support COLLISION_IGNORE_UNOWNED="*.pyc *.pyo"
This will fix bug #410691.
---
cnf/make.globals | 5 +++++
man/make.conf.5 | 7 +++++++
pym/portage/dbapi/vartree.py | 8 ++++++++
.../package/ebuild/_config/special_env_vars.py | 5 +++--
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/cnf/make.globals b/cnf/make.globals
index 0f6f541..5f536c3 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -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"
diff --git a/man/make.conf.5 b/man/make.conf.5
index e8777c8..7b1d4c0 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -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
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index ec9f87c..71b5d80 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -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
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 132f8eb..8eac380 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -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",
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/package/ebuild/_config/, cnf/
@ 2012-05-08 6:26 Zac Medico
0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2012-05-08 6:26 UTC (permalink / raw
To: gentoo-commits
commit: bc18e1e7c3af475412e997489058c58942ebfdcb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 8 06:23:40 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 8 06:23:40 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bc18e1e7
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.
---
cnf/make.globals | 4 +--
man/make.conf.5 | 15 ++++--------
pym/portage/dbapi/vartree.py | 23 +++++++-------------
.../package/ebuild/_config/special_env_vars.py | 2 +-
4 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/cnf/make.globals b/cnf/make.globals
index fa76c09..975726a 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -59,12 +59,10 @@ FEATURES="assume-digests binpkg-logs distlocks ebuild-locks
# Ignore file collisions in /lib/modules since files inside this directory
# are never unmerged, and therefore collisions must be ignored in order for
# 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="*.py[co]"
+COLLISION_IGNORE="/lib/modules/* *.py[co]"
# Enable preserve-libs for testing with portage versions that support it.
# This setting is commented out for portage versions that don't support it.
diff --git a/man/make.conf.5 b/man/make.conf.5
index 7b1d4c0..39c3f8e 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -128,18 +128,13 @@ Determines how long the countdown delay will be after running
.br
Defaults to 5 seconds.
.TP
-\fBCOLLISION_IGNORE\fR = \fI[space delimited list of files and/or directories]\fR
+\fBCOLLISION_IGNORE\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 files and/or directories.
+\fIprotect\-owned\fR for specific shell patterns. For backward
+compatibility, directories that are listed without a shell pattern will
+automatically have /* appended to them.
.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.
+Defaults to "/lib/modules/* *.py[co]".
.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"
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index ee77fac..158fc4a 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 8eac380..763237d 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",
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/package/ebuild/_config/, cnf/
@ 2012-06-22 22:33 Zac Medico
0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2012-06-22 22:33 UTC (permalink / raw
To: gentoo-commits
commit: d1a59831eb2a5205d050884c760cca1d73be8fdf
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 22:33:07 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 22:33:07 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d1a59831
Add UNINSTALL_IGNORE variable for bug #421659.
UNINSTALL_IGNORE = [space delimited list of fnmatch patterns]
This variable prevents uninstallation of files that match
specific fnmatch(3) patterns. In order to ignore file collisions
with these files at install time, the same patterns can be
added to the COLLISION_IGNORE variable.
---
cnf/make.globals | 1 +
man/make.conf.5 | 8 +++++
pym/portage/dbapi/vartree.py | 28 ++++++++++---------
.../package/ebuild/_config/special_env_vars.py | 2 +-
4 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/cnf/make.globals b/cnf/make.globals
index b156988..c354291 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -64,6 +64,7 @@ FEATURES="assume-digests binpkg-logs
# transition from compiling python modules in live file system to compiling
# them in src_install() function.
COLLISION_IGNORE="/lib/modules/* *.py[co]"
+UNINSTALL_IGNORE="/lib/modules/*"
# Enable preserve-libs for testing with portage versions that support it.
# This setting is commented out for portage versions that don't support it.
diff --git a/man/make.conf.5 b/man/make.conf.5
index 6882637..7d07344 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -896,6 +896,14 @@ is used to sync the local portage tree when `emerge \-\-sync` is run.
.br
Defaults to rsync://rsync.gentoo.org/gentoo\-portage
.TP
+\fBUNINSTALL_IGNORE\fR = \fI[space delimited list of fnmatch patterns]\fR
+This variable prevents uninstallation of files that match
+specific \fBfnmatch\fR(3) patterns. In order to ignore file
+collisions with these files at install time, the same patterns
+can be added to the \fBCOLLISION_IGNORE\fR variable.
+.br
+Defaults to "/lib/modules/*".
+.TP
\fBUSE\fR = \fI[space delimited list of USE items]\fR
This variable contains options that control the build behavior of several
packages. More information in \fBebuild\fR(5). Possible USE values
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index b8405d4..60bab73 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2064,7 +2064,9 @@ class dblink(object):
#process symlinks second-to-last, directories last.
mydirs = set()
- modprotect = os.path.join(self._eroot, "lib/modules/")
+
+ uninstall_ignore = portage.util.shlex_split(
+ self.settings.get("UNINSTALL_IGNORE", ""))
def unlink(file_name, lstatobj):
if bsd_chflags:
@@ -2171,6 +2173,18 @@ class dblink(object):
if lstatobj is None:
show_unmerge("---", unmerge_desc["!found"], file_type, obj)
continue
+
+ f_match = obj[len(eroot)-1:]
+ ignore = False
+ for pattern in uninstall_ignore:
+ if fnmatch.fnmatch(f_match, pattern):
+ ignore = True
+ break
+
+ if ignore:
+ show_unmerge("---", unmerge_desc["cfgpro"], file_type, obj)
+ continue
+
# don't use EROOT, CONTENTS entries already contain EPREFIX
if obj.startswith(real_root):
relative_path = obj[real_root_len:]
@@ -2214,18 +2228,6 @@ class dblink(object):
continue
elif relative_path in cfgfiledict:
stale_confmem.append(relative_path)
- # next line includes a tweak to protect modules from being unmerged,
- # but we don't protect modules from being overwritten if they are
- # upgraded. We effectively only want one half of the config protection
- # functionality for /lib/modules. For portage-ng both capabilities
- # should be able to be independently specified.
- # TODO: For rebuilds, re-parent previous modules to the new
- # installed instance (so they are not orphans). For normal
- # uninstall (not rebuild/reinstall), remove the modules along
- # with all other files (leave no orphans).
- if obj.startswith(modprotect):
- show_unmerge("---", unmerge_desc["cfgpro"], file_type, obj)
- continue
# Don't unlink symlinks to directories here since that can
# remove /lib and /usr/lib symlinks.
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 4795e88..a01c177 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -164,7 +164,7 @@ environ_filter += [
"RESUMECOMMAND", "RESUMECOMMAND_FTP",
"RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTPS",
"RESUMECOMMAND_RSYNC", "RESUMECOMMAND_SFTP",
- "SYNC", "USE_EXPAND_HIDDEN", "USE_ORDER",
+ "SYNC", "UNINSTALL_IGNORE", "USE_EXPAND_HIDDEN", "USE_ORDER",
]
environ_filter = frozenset(environ_filter)
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-22 22:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 22:33 [gentoo-commits] proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/package/ebuild/_config/, cnf/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2012-05-08 6:26 Zac Medico
2012-05-05 6:47 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox