Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 102749 Details for
Bug 8423
Split CONFIG_PROTECT into separate installing and uninstalling options (nuke untouched files)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
when necessary, bump the mtime to prevent uninstallation of config protected files
untouched_config_files.patch (text/plain), 2.68 KB, created by
Zac Medico
on 2006-11-26 05:00:05 UTC
(
hide
)
Description:
when necessary, bump the mtime to prevent uninstallation of config protected files
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2006-11-26 05:00:05 UTC
Size:
2.68 KB
patch
obsolete
>Index: pym/portage.py >=================================================================== >--- pym/portage.py (revision 5128) >+++ pym/portage.py (revision 5134) >@@ -6093,7 +6093,8 @@ > mysettings.get("CONFIG_PROTECT","").split(), > mysettings.get("CONFIG_PROTECT_MASK","").split()) > self.updateprotect = protect_obj.updateprotect >- self.isprotected = protect_obj.isprotected >+ self._config_protect = protect_obj >+ self._installed_instance = None > self.contentscache=[] > self._contents_inodes = None > >@@ -6293,8 +6294,6 @@ > mykeys.sort() > mykeys.reverse() > >- self.updateprotect() >- > #process symlinks second-to-last, directories last. > mydirs=[] > modprotect="/lib/modules/" >@@ -6325,7 +6324,7 @@ > # upgraded. We effectively only want one half of the config protection > # functionality for /lib/modules. For portage-ng both capabilities > # should be able to be independently specified. >- if self.isprotected(obj) or ((len(obj) > len(modprotect)) and (obj[0:len(modprotect)]==modprotect)): >+ if obj.startswith(modprotect): > writemsg_stdout("--- cfgpro %s %s\n" % (pkgfiles[objkey][0], obj)) > continue > >@@ -6427,6 +6426,31 @@ > > return False > >+ def isprotected(self, filename): >+ """In cases where an installed package in the same slot owns a >+ protected file that will be merged, bump the mtime on the installed >+ file in order to ensure that it isn't unmerged.""" >+ if not self._config_protect.isprotected(filename): >+ return False >+ if self._installed_instance is None: >+ return True >+ mydata = self._installed_instance.getcontents().get(filename, None) >+ if mydata is None: >+ return True >+ >+ # Bump the mtime in order to ensure that the old config file doesn't >+ # get unmerged. The user will have an opportunity to merge the new >+ # config with the old one. >+ try: >+ os.utime(filename, None) >+ except OSError, e: >+ if e.errno != errno.ENOENT: >+ raise >+ del e >+ # The file has disappeared, so it's not protected. >+ return False >+ return True >+ > def treewalk(self, srcroot, destroot, inforoot, myebuild, cleanup=0, > mydbapi=None, prev_mtimes=None): > # srcroot = ${D}; >@@ -6447,6 +6471,14 @@ > for v in self.vartree.dbapi.cp_list(self.mysplit[0]): > otherversions.append(v.split("/")[1]) > >+ slot_matches = self.vartree.dbapi.match( >+ "%s:%s" % (self.mysplit[0], self.settings["SLOT"])) >+ if slot_matches: >+ # Used by self.isprotected(). >+ self._installed_instance = dblink(self.cat, >+ catsplit(slot_matches[0])[1], destroot, self.settings, >+ vartree=self.vartree) >+ > # check for package collisions > if "collision-protect" in self.settings.features: > collision_ignore = set([normalize_path(myignore) for myignore in \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 8423
:
52335
|
57230
|
102733
| 102749