diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-08-30 21:43:52 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-08-30 21:43:52 +0000 |
commit | d995371c4689a9d541f543ce4aa7f89c938394ec (patch) | |
tree | 4a483b300a490d4161c70ac55f2cda92653bc000 /pym | |
parent | ed589e570b592a8aad5665f8763e947164abd1ce (diff) | |
download | portage-d995371c4689a9d541f543ce4aa7f89c938394ec.tar.gz portage-d995371c4689a9d541f543ce4aa7f89c938394ec.tar.bz2 portage-d995371c4689a9d541f543ce4aa7f89c938394ec.zip |
Add support for FEATURES="protect-owned" which is identical to the
collision-protect feature except that files may be overwritten if they are
not explicitly listed in the contents of a currently installed package.
This is particularly useful on systems that have lots of orphan files that
have been left behind by older versions of portage that did not support the
unmerge-orphans feature.
The additional tolerance makes this feature more suitable than
collision-protect for being enabled by default. In order to ensure smooth
operation of protect-owned in all cases, we also have to set
COLLISION_IGNORE="/lib/modules" since files inside this directory are
never unmerge. By enabling protect-owned by default, users are protected
from problems that may occur due interactions with file collisions and the
unmerge-orphans feature which is also enabled by default.
svn path=/main/trunk/; revision=11479
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/dbapi/vartree.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 8d5d33d35..56e084028 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2918,12 +2918,15 @@ class dblink(object): if collisions: collision_protect = "collision-protect" in self.settings.features + protect_owned = "protect-owned" in self.settings.features msg = "This package will overwrite one or more files that" + \ " may belong to other packages (see list below)." - if not collision_protect: - msg += " Add \"collision-protect\" to FEATURES in" + \ + if not (collision_protect or protect_owned): + msg += " Add either \"collision-protect\" or" + \ + " \"protect-owned\" to FEATURES in" + \ " make.conf if you would like the merge to abort" + \ - " in cases like this." + " in cases like this. See the make.conf man page for" + \ + " more information about these features." if self.settings.get("PORTAGE_QUIET") != "1": msg += " You can use a command such as" + \ " `portageq owners / <filename>` to identify the" + \ @@ -2991,6 +2994,9 @@ class dblink(object): if collision_protect: msg = "Package '%s' NOT merged due to file collisions." % \ self.settings.mycpv + elif protect_owned and owners: + msg = "Package '%s' NOT merged due to file collisions." % \ + self.settings.mycpv else: msg = "Package '%s' merged despite file collisions." % \ self.settings.mycpv @@ -2998,7 +3004,7 @@ class dblink(object): "messages for the whole content of the above message." eerror(wrap(msg, 70)) - if collision_protect: + if collision_protect or (protect_owned and owners): return 1 # The merge process may move files out of the image directory, |