diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-17 22:13:36 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-17 22:13:36 +0000 |
commit | 4193b7b43b26b8864b31ab5bbceddfb4145b4598 (patch) | |
tree | 400e94993079f376e2c3834397e5cfd7ef75b3f0 /pym/portage.py | |
parent | 64f8c4f7a2522654989008adb5be79f64f02528e (diff) | |
download | portage-4193b7b43b26b8864b31ab5bbceddfb4145b4598.tar.gz portage-4193b7b43b26b8864b31ab5bbceddfb4145b4598.tar.bz2 portage-4193b7b43b26b8864b31ab5bbceddfb4145b4598.zip |
For bug #182346, use dblink.isowner() during unmerge so that device/inode numbers are used to determine ownership (despite path mismatch due to symlinks). (trunk r6863)
svn path=/main/branches/2.1.2/; revision=6864
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/pym/portage.py b/pym/portage.py index 09554e935..dc54e8abb 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7111,9 +7111,9 @@ class dblink: others_in_slot.append(dblink(self.cat, catsplit(cur_cpv)[1], self.vartree.root, self.settings, vartree=self.vartree)) - claimed_paths = set() - for dblnk in others_in_slot: - claimed_paths.update(dblnk.getcontents()) + dest_root = normalize_path(self.vartree.root).rstrip(os.path.sep) + \ + os.path.sep + dest_root_len = len(dest_root) unmerge_orphans = "unmerge-orphans" in self.settings.features @@ -7129,12 +7129,6 @@ class dblink: obj = normalize_path(objkey) file_data = pkgfiles[objkey] file_type = file_data[0] - if obj in claimed_paths: - # A new instance of this package claims the file, so don't - # unmerge it. - writemsg_stdout("--- !owned %s %s\n" % \ - (pkgfiles[objkey][0], obj)) - continue statobj = None try: statobj = os.stat(obj) @@ -7149,6 +7143,19 @@ class dblink: if lstatobj is None: writemsg_stdout("--- !found %s %s\n" % (file_type, obj)) continue + if obj.startswith(dest_root): + relative_path = obj[dest_root_len:] + is_owned = False + for dblnk in others_in_slot: + if dblnk.isowner(relative_path, dest_root): + is_owned = True + break + if is_owned: + # A new instance of this package claims the file, so + # don't unmerge it. + writemsg_stdout("--- !owned %s %s\n" % \ + (file_type, obj)) + continue # next line includes a tweak to protect modules from being unmerged, # but we don't protect modules from being overwritten if they are # upgraded. We effectively only want one half of the config protection |