Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10251 - main/branches/2.1.2/pym
Date: Thu, 08 May 2008 21:19:40
Message-Id: E1JuDWa-0004ep-En@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-08 21:19:35 +0000 (Thu, 08 May 2008)
3 New Revision: 10251
4
5 Modified:
6 main/branches/2.1.2/pym/portage.py
7 Log:
8 Make some confmem behavior modifications in order to try and make it
9 less confusing for people who have forgotten about the --noconfmem
10 option or are completely unaware of it. Thanks to Joe Peterson
11 <lavajoe@g.o> for suggesting these:
12
13 * Always behave like --noconfmem is enabled for downgrades.
14
15 * Purge confmem entries when a package is unmerged rather
16 than replaced.
17
18 (trunk r10250)
19
20
21 Modified: main/branches/2.1.2/pym/portage.py
22 ===================================================================
23 --- main/branches/2.1.2/pym/portage.py 2008-05-08 21:18:01 UTC (rev 10250)
24 +++ main/branches/2.1.2/pym/portage.py 2008-05-08 21:19:35 UTC (rev 10251)
25 @@ -8822,8 +8822,12 @@
26 vartree=self.vartree))
27 dest_root = normalize_path(self.vartree.root).rstrip(os.path.sep) + \
28 os.path.sep
29 - dest_root_len = len(dest_root)
30 + dest_root_len = len(dest_root) - 1
31
32 + conf_mem_file = os.path.join(dest_root, CONFIG_MEMORY_FILE)
33 + cfgfiledict = grabdict(conf_mem_file)
34 + stale_confmem = []
35 +
36 unmerge_orphans = "unmerge-orphans" in self.settings.features
37
38 if pkgfiles:
39 @@ -8887,6 +8891,9 @@
40 continue
41 if obj.startswith(dest_root):
42 relative_path = obj[dest_root_len:]
43 + if not others_in_slot and \
44 + relative_path in cfgfiledict:
45 + stale_confmem.append(relative_path)
46 is_owned = False
47 for dblnk in others_in_slot:
48 if dblnk.isowner(relative_path, dest_root):
49 @@ -9011,6 +9018,12 @@
50 show_unmerge("---", "!empty", "dir", obj)
51 del e
52
53 + # Remove stale entries from config memory.
54 + if stale_confmem:
55 + for filename in stale_confmem:
56 + del cfgfiledict[filename]
57 + writedict(cfgfiledict, conf_mem_file)
58 +
59 #remove self from vartree database so that our own virtual gets zapped if we're the last node
60 self.vartree.zap(self.mycpv)
61
62 @@ -9504,6 +9517,15 @@
63 else:
64 cfgfiledict["IGNORE"]=0
65
66 + # Always behave like --noconfmem is enabled for downgrades
67 + # so that people who don't know about this option are less
68 + # likely to get confused when doing upgrade/downgrade cycles.
69 + pv_split = catpkgsplit(self.mycpv)[1:]
70 + for other in others_in_slot:
71 + if pkgcmp(pv_split, catpkgsplit(other.mycpv)[1:]) < 0:
72 + cfgfiledict["IGNORE"] = 1
73 + break
74 +
75 # Don't bump mtimes on merge since some application require
76 # preservation of timestamps. This means that the unmerge phase must
77 # check to see if file belongs to an installed instance in the same
78
79 --
80 gentoo-commits@l.g.o mailing list