Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10250 - main/trunk/pym/portage/dbapi
Date: Thu, 08 May 2008 21:18:05
Message-Id: E1JuDV4-0004dx-Ly@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-08 21:18:01 +0000 (Thu, 08 May 2008)
3 New Revision: 10250
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.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
19 Modified: main/trunk/pym/portage/dbapi/vartree.py
20 ===================================================================
21 --- main/trunk/pym/portage/dbapi/vartree.py 2008-05-08 20:05:53 UTC (rev 10249)
22 +++ main/trunk/pym/portage/dbapi/vartree.py 2008-05-08 21:18:01 UTC (rev 10250)
23 @@ -1403,8 +1403,12 @@
24 vartree=self.vartree))
25 dest_root = normalize_path(self.vartree.root).rstrip(os.path.sep) + \
26 os.path.sep
27 - dest_root_len = len(dest_root)
28 + dest_root_len = len(dest_root) - 1
29
30 + conf_mem_file = os.path.join(dest_root, CONFIG_MEMORY_FILE)
31 + cfgfiledict = grabdict(conf_mem_file)
32 + stale_confmem = []
33 +
34 unmerge_orphans = "unmerge-orphans" in self.settings.features
35
36 if pkgfiles:
37 @@ -1468,6 +1472,9 @@
38 continue
39 if obj.startswith(dest_root):
40 relative_path = obj[dest_root_len:]
41 + if not others_in_slot and \
42 + relative_path in cfgfiledict:
43 + stale_confmem.append(relative_path)
44 is_owned = False
45 for dblnk in others_in_slot:
46 if dblnk.isowner(relative_path, dest_root):
47 @@ -1592,6 +1599,12 @@
48 show_unmerge("---", "!empty", "dir", obj)
49 del e
50
51 + # Remove stale entries from config memory.
52 + if stale_confmem:
53 + for filename in stale_confmem:
54 + del cfgfiledict[filename]
55 + writedict(cfgfiledict, conf_mem_file)
56 +
57 #remove self from vartree database so that our own virtual gets zapped if we're the last node
58 self.vartree.zap(self.mycpv)
59
60 @@ -2206,6 +2219,15 @@
61 else:
62 cfgfiledict["IGNORE"]=0
63
64 + # Always behave like --noconfmem is enabled for downgrades
65 + # so that people who don't know about this option are less
66 + # likely to get confused when doing upgrade/downgrade cycles.
67 + pv_split = catpkgsplit(self.mycpv)[1:]
68 + for other in others_in_slot:
69 + if pkgcmp(pv_split, catpkgsplit(other.mycpv)[1:]) < 0:
70 + cfgfiledict["IGNORE"] = 1
71 + break
72 +
73 # Don't bump mtimes on merge since some application require
74 # preservation of timestamps. This means that the unmerge phase must
75 # check to see if file belongs to an installed instance in the same
76
77 --
78 gentoo-commits@l.g.o mailing list