* By default, disable the calc_prelink parameter to perform_md5() for
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 23:05:51 +0000 (16:05 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 23:05:51 +0000 (16:05 -0700)
  merge and unmerge.
* Add FEATURES=prelink-checksums in order to trigger the old behavior.

man/make.conf.5
pym/portage/const.py
pym/portage/dbapi/vartree.py

index 74b24576bfa2ceb870d1a725adf0e6b1635af629..8a36193be34edb0ad45b8208bc4c71910ca8e4f2 100644 (file)
@@ -358,6 +358,13 @@ Parse \fBEAPI\fR from the head of the ebuild (first 30 lines). This feature
 is only intended for experimental purposes and should not be enabled under
 normal circumstances.
 .TP
+.B prelink\-checksums
+If \fBprelink\fR(8) is installed then use it to undo any prelinks on files
+before computing checksums for merge and unmerge. This feature is
+useful only if \fBprelink\fR(8) is installed and accurate checksums (despite
+prelinking) are needed for some reason such as for checking the integrity of
+installed files or because the \fIunmerge\-orphans\fR feature is disabled.
+.TP
 .B preserve\-libs
 Preserve libraries when the sonames change during upgrade or downgrade.
 Libraries are preserved only if consumers of those libraries are detected.
index bd2c5be8da6540dfd5111ac4faa94b342c7d7885..db543d76cdcfc8ec5c0827928a9a9fdafd157db7 100644 (file)
@@ -92,8 +92,9 @@ SUPPORTED_FEATURES       = frozenset([
                            "metadata-transfer", "mirror", "multilib-strict", "news",
                            "noauto", "noclean", "nodoc", "noinfo", "noman", "nostrip",
                            "notitles", "parallel-fetch", "parse-eapi-ebuild-head",
-                           "parse-eapi-glep-55", "preserve-libs", "protect-owned",
-                           "python-trace", "sandbox", "sesandbox", "severe", "sfperms",
+                           "parse-eapi-glep-55", "prelink-checksums", "preserve-libs",
+                           "protect-owned", "python-trace", "sandbox",
+                           "sesandbox", "severe", "sfperms",
                            "sign", "skiprocheck", "split-elog", "split-log", "splitdebug",
                            "strict", "stricter", "suidctl", "test", "test-fail-continue",
                            "unknown-features-warn",
index f986c0a3c97046cf16565f5bbbdd30a7af46fef0..b2e03e9c3fce682b45eaa86c6e5357935532d514 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1998-2009 Gentoo Foundation
+# Copyright 1998-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = ["PreservedLibsRegistry", "LinkageMap",
@@ -2446,6 +2446,7 @@ class dblink(object):
                stale_confmem = []
 
                unmerge_orphans = "unmerge-orphans" in self.settings.features
+               calc_prelink = "prelink-checksums" in self.settings.features
 
                if pkgfiles:
                        self.updateprotect()
@@ -2630,7 +2631,7 @@ class dblink(object):
                                                continue
                                        mymd5 = None
                                        try:
-                                               mymd5 = perf_md5(obj, calc_prelink=1)
+                                               mymd5 = perf_md5(obj, calc_prelink=calc_prelink)
                                        except FileNotFound as e:
                                                # the file has disappeared between now and our stat call
                                                show_unmerge("---", unmerge_desc["!obj"], file_type, obj)
@@ -4153,7 +4154,8 @@ class dblink(object):
                join = os.path.join
                srcroot = normalize_path(srcroot).rstrip(sep) + sep
                destroot = normalize_path(destroot).rstrip(sep) + sep
-               
+               calc_prelink = "prelink-checksums" in self.settings.features
+
                # this is supposed to merge a list of files.  There will be 2 forms of argument passing.
                if isinstance(stufftomerge, basestring):
                        #A directory is specified.  Figure out protection paths, listdir() it and process it.
@@ -4314,7 +4316,7 @@ class dblink(object):
                                        return 1
                        elif stat.S_ISREG(mymode):
                                # we are merging a regular file
-                               mymd5 = perform_md5(mysrc, calc_prelink=1)
+                               mymd5 = perform_md5(mysrc, calc_prelink=calc_prelink)
                                # calculate config file protection stuff
                                mydestdir = os.path.dirname(mydest)
                                moveme = 1
@@ -4345,7 +4347,7 @@ class dblink(object):
                                                if protected:
                                                        # we have a protection path; enable config file management.
                                                        cfgprot = 0
-                                                       destmd5 = perform_md5(mydest, calc_prelink=1)
+                                                       destmd5 = perform_md5(mydest, calc_prelink=calc_prelink)
                                                        if mymd5 == destmd5:
                                                                #file already in place; simply update mtimes of destination
                                                                moveme = 1