RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
# Default user options
-FEATURES="distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
+FEATURES="distlocks parallel-fetch protect-owned sandbox
+ sfperms strict unmerge-orphans userfetch"
+
+# 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"
# Enable for global testing
FEATURES="${FEATURES} preserve-libs"
Defaults to 5 seconds.
.TP
\fBCOLLISION_IGNORE\fR = \fI[space delimited list of files and/or directories]\fR
-This variable allows the user to disable \fIcollision\-protect\fR for specific
-files and/or directories.
+This variable allows the user to disable \fIcollision\-protect\fR and
+\fIprotect\-owned\fR for specific files and/or directories.
+.br
+Defaults to /lib/modules.
.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"
.B collision\-protect
A QA\-feature to ensure that a package doesn't overwrite files it doesn't own.
The \fICOLLISION_IGNORE\fR variable can be used to selectively disable this
-feature.
+feature. Also see the related \fIprotect\-owned\fR feature.
.TP
.B digest
Autogenerate digests for packages when running the \fBemerge\fR(1) command. If
`tail \-f /var/log/emerge\-fetch.log` in a
terminal to view parallel-fetch progress.
.TP
+.B protect\-owned
+This is identical to the \fIcollision\-protect\fR 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 \fIunmerge\-orphans\fR feature. Like
+\fIcollision\-protect\fR, the \fICOLLISION_IGNORE\fR variable can be used to
+selectively disable this feature. It is recommended to leave either
+\fIprotect\-owned\fR or \fIcollision\-protect\fR enabled at all times,
+since otherwise file collisions between packages may result in files being
+overwritten or uninstalled at inappropriate times.
+If \fIcollision\-protect\fR is enabled then it takes precedence over
+\fIprotect\-owned\fR.
+.TP
.B sandbox
Enable sandbox\-ing when running \fBemerge\fR(1) and \fBebuild\fR(1).
.TP
and \fIsrc_test()\fR in \fBebuild\fR(5). This feature implies the "test"
\fBUSE\fR flag.
.TP
-.B unmerge-orphans
+.B unmerge\-orphans
If a file is not claimed by another package in the same slot and it is not
protected by \fICONFIG_PROTECT\fR, unmerge it even if the modification time or
checksum differs from the file that was originally installed.
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" + \
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
"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,