Merged from trunk -r11477:11483
authorFabian Groffen <grobian@gentoo.org>
Mon, 1 Sep 2008 18:48:49 +0000 (18:48 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 1 Sep 2008 18:48:49 +0000 (18:48 -0000)
   | 11478   | In dep_zapdeps(), add a new choice category for choices that |
   | zmedico | have packages that aren't yet installed but have been added  |
   |         | to the graph. This category is given lower priority that the |
   |         | category for packages that are already installed. This helps |
   |         | dep_zapdeps() avoid making choices in some cases that would  |
   |         | result in an unsolvable circular dependency. Thanks to Diego |
   |         | "Flameeyes" Pettenò for reporting a circular dependency     |
   |         | issue involving that java overlay which is solved by this    |
   |         | patch. The particular issue was triggered when attempting to |
   |         | install dev-java/icedtea6 for the first time. A circular     |
   |         | dependency between dev-java/eclipse-ecj-3.2.2-r1 and         |
   |         | dev-java/icedtea6-1.2 occured since icedtea6 was chosen to   |
   |         | satisfy the jdk dependency of eclipse-ecj, even though       |
   |         | sun-jdk-1.6.0.07 was already installed and capable of        |
   |         | satisfying the dependency. This patch solves the issue by    |
   |         | causing sun-jdk to be properly selected to satisfy the jdk   |
   |         | dependency of eclipse-ecj.                                   |

   | 11479   | Add support for FEATURES="protect-owned" which is identical  |
   | zmedico | 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.                                          |

   | 11480   | Add a warning for emake -j1 calls which disable              |
   | zmedico | parallelization. Thanks to Diego "Flameeyes" Pettenò for    |
   |         | the suggestion.                                              |

   | 11481   | Check for calls to the deprecated bindnow-flags function.    |
   | zmedico | Thanks to Diego "Flameeyes" Pettenò for the suggestion.     |

   | 11482   | Adjust EMakeParallelDisabled.re to require at least one      |
   | zmedico | space after emake.                                           |

   | 11483   | Update PORTAGE_RSYNC_OPTS docs to reflect that               |
   | zmedico | --delete-after is no longer used by default.                 |

svn path=/main/branches/prefix/; revision=11484

cnf/make.globals
man/make.conf.5
pym/portage/__init__.py
pym/portage/dbapi/vartree.py
pym/repoman/checks.py
pym/repoman/errors.py

index fcd7f9c252a77cdfafda6b5d3121b65ee8468d82..5580090cc9df89b47bc630672f1474062dc44406 100644 (file)
@@ -38,7 +38,13 @@ FETCHCOMMAND="wget -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI
 RESUMECOMMAND="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"
index 6eab4b2ddd8da6c5c392e21b969a52554c90eff3..9adc076826b525964e219c5e420764e2202fffa5 100644 (file)
@@ -82,8 +82,10 @@ Determines how long the countdown delay will be after running `emerge clean`.
 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"
@@ -171,7 +173,7 @@ ${PORTAGE_TMPDIR}/ccache.
 .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
@@ -267,6 +269,20 @@ Fetch in the background while compiling. Run
 `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
@@ -321,7 +337,7 @@ the package compiled properly.  See \fItest\fR in \fBebuild\fR(1)
 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.
@@ -500,7 +516,7 @@ Default rsync options to be used by \fBemerge \-\-sync\fR.
 \fBDon't change this unless you know exactly what you're doing!\fR
 .br
 Defaults to "\-\-recursive \-\-links \-\-safe\-links \-\-perms \-\-times
-\-\-compress \-\-force \-\-whole\-file \-\-delete \-\-delete\-after \-\-stats
+\-\-compress \-\-force \-\-whole\-file \-\-delete \-\-stats
 \-\-timeout=180 \-\-exclude='/distfiles' \-\-exclude='/local'
 \-\-exclude='/packages'"
 .TP
index 9372f33f7a3925a627f270733f58ce43ddd1d212..663feb7469c9f06acccf691eb2f7bb86a9c70df5 100644 (file)
@@ -6266,6 +6266,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
        # d) is the first item
 
        preferred = []
+       preferred_not_installed = []
        preferred_any_slot = []
        possible_upgrades = []
        other = []
@@ -6346,7 +6347,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                                                break
                                if all_in_graph:
                                        if parent is None:
-                                               preferred.append(this_choice)
+                                               preferred_not_installed.append(this_choice)
                                        else:
                                                # Check if the atom would result in a direct circular
                                                # dependency and try to avoid that if it seems likely
@@ -6366,7 +6367,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                                                                circular_atom = atom
                                                                break
                                                if circular_atom is None:
-                                                       preferred.append(this_choice)
+                                                       preferred_not_installed.append(this_choice)
                                                else:
                                                        other.append(this_choice)
                                else:
@@ -6380,6 +6381,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
        # into || ( highest version ... lowest version ).  We want to prefer the
        # highest all_available version of the new-style virtual when there is a
        # lower all_installed version.
+       preferred.extend(preferred_not_installed)
        preferred.extend(preferred_any_slot)
        preferred.extend(possible_upgrades)
        possible_upgrades = preferred[1:]
index 89dcffa585e0f8c2abcf4de01a70071689385ddd..93b76b825387c1b1377cd242916d38d37172fc36 100644 (file)
@@ -3379,12 +3379,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" + \
@@ -3452,6 +3455,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
@@ -3459,7 +3465,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,
index 4b002568f74376b31b11db09cd86260290c14859..f4a7733a07ef9e1aaca4ab53ffde06f71155165c 100644 (file)
@@ -268,12 +268,25 @@ class IUseUndefined(LineCheck):
                if self._iuse_def is None:
                        yield 'IUSE is not defined'
 
+class EMakeParallelDisabled(LineCheck):
+       """Check for emake -j1 calls which disable parallelization."""
+       repoman_check_name = 'ebuild.minorsyn'
+       re = re.compile(r'^\s*emake\s+-j\s*1\s')
+       error = errors.EMAKE_PARALLEL_DISABLED
+
+class DeprecatedBindnowFlags(LineCheck):
+       """Check for calls to the deprecated bindnow-flags function."""
+       repoman_check_name = 'ebuild.minorsyn'
+       re = re.compile(r'.*\$\(bindnow-flags\)')
+       error = errors.DEPRECATED_BINDNOW_FLAGS
+
 _constant_checks = tuple((c() for c in (
        EbuildHeader, EbuildWhitespace, EbuildQuote,
        EbuildAssignment, EbuildUselessDodoc,
        EbuildUselessCdS, EbuildNestedDie,
        EbuildPatches, EbuildQuotedA,
-       IUseUndefined, InheritAutotools)))
+       IUseUndefined, InheritAutotools,
+       EMakeParallelDisabled, DeprecatedBindnowFlags)))
 
 def run_checks(contents, pkg):
        checks = _constant_checks
index 90fa83820295bba178dc2a480754d9f8dceb2484..7c54cc13d9982c013cc9130932c58cbe2dab27a8 100644 (file)
@@ -13,3 +13,5 @@ MISSING_QUOTES_ERROR = 'Unquoted Variable on line: %d'
 NESTED_DIE_ERROR = 'Ebuild calls die in a subshell on line: %d'
 PATCHES_ERROR = 'PATCHES is not a bash array on line: %d'
 REDUNDANT_CD_S_ERROR = 'Ebuild has redundant cd ${S} statement on line: %d'
+EMAKE_PARALLEL_DISABLED = 'Ebuild calls emake -j1 on line: %d'
+DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d'