diff options
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/const.py | 1 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/pym/portage/const.py b/pym/portage/const.py index 77c68eb0d..5fcb24f73 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -89,6 +89,7 @@ SUPPORTED_FEATURES = frozenset([ "assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy", "ccache", "chflags", "clean-logs", "collision-protect", "compress-build-logs", + "config-protect-if-modified", "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot", "fail-clean", "force-mirror", "force-prefix", "getbinpkg", "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror", diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index b9ef58341..a66316ba1 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -4056,6 +4056,10 @@ class dblink(object): destroot = normalize_path(destroot).rstrip(sep) + sep calc_prelink = "prelink-checksums" in self.settings.features + protect_if_modified = \ + "config-protect-if-modified" in self.settings.features and \ + self._installed_instance is not None + # 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. @@ -4297,9 +4301,18 @@ class dblink(object): # now, config file management may come into play. # we only need to tweak mydest if cfg file management is in play. if protected: + destmd5 = perform_md5(mydest, calc_prelink=calc_prelink) + if protect_if_modified: + contents_key = \ + self._installed_instance._match_contents(myrealdest) + if contents_key: + inst_info = self._installed_instance.getcontents()[contents_key] + if inst_info[0] == "obj" and inst_info[2] == destmd5: + protected = False + + if protected: # we have a protection path; enable config file management. cfgprot = 0 - destmd5 = perform_md5(mydest, calc_prelink=calc_prelink) if mymd5 == destmd5: #file already in place; simply update mtimes of destination moveme = 1 |