Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9621 - in main/trunk/pym: _emerge portage/dbapi
Date: Sun, 30 Mar 2008 06:18:20
Message-Id: E1Jfqrw-0001SR-Vj@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-30 06:18:15 +0000 (Sun, 30 Mar 2008)
3 New Revision: 9621
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 main/trunk/pym/portage/dbapi/vartree.py
8 Log:
9 Move the AUTOCLEAN code into dblink.treewalk since it's already partially
10 supported there anyway (for replacement of identical cpv). This has the
11 benefit of guaranteeing that the order of installation and removal phases
12 is always the same.
13
14
15 Modified: main/trunk/pym/_emerge/__init__.py
16 ===================================================================
17 --- main/trunk/pym/_emerge/__init__.py 2008-03-30 05:52:04 UTC (rev 9620)
18 +++ main/trunk/pym/_emerge/__init__.py 2008-03-30 06:18:15 UTC (rev 9621)
19 @@ -4792,20 +4792,6 @@
20 if "--pretend" not in self.myopts and \
21 "--fetchonly" not in self.myopts and \
22 "--fetch-all-uri" not in self.myopts:
23 - # Clean the old package that we have merged over top of it.
24 - if pkgsettings.get("AUTOCLEAN", "yes") == "yes":
25 - xsplit=portage.pkgsplit(x[2])
26 - emergelog(xterm_titles, " >>> AUTOCLEAN: " + xsplit[0])
27 - retval = unmerge(self.trees[myroot]["root_config"],
28 - self.myopts,
29 - "clean", [xsplit[0]], ldpath_mtimes, autoclean=1)
30 - if not retval:
31 - emergelog(xterm_titles,
32 - " --- AUTOCLEAN: Nothing unmerged.")
33 - else:
34 - portage.writemsg_stdout(colorize("WARN", "WARNING:")
35 - + " AUTOCLEAN is disabled. This can cause serious"
36 - + " problems due to overlapping packages.\n")
37
38 # Figure out if we need a restart.
39 mysplit=portage.pkgsplit(x[2])
40
41 Modified: main/trunk/pym/portage/dbapi/vartree.py
42 ===================================================================
43 --- main/trunk/pym/portage/dbapi/vartree.py 2008-03-30 05:52:04 UTC (rev 9620)
44 +++ main/trunk/pym/portage/dbapi/vartree.py 2008-03-30 06:18:15 UTC (rev 9621)
45 @@ -2126,11 +2126,11 @@
46 "portage" == pkgsplit(self.pkg)[0]:
47 reinstall_self = True
48
49 + autoclean = self.settings.get("AUTOCLEAN", "yes") == "yes"
50 for dblnk in list(others_in_slot):
51 if dblnk is self:
52 continue
53 - if dblnk.mycpv != self.mycpv and \
54 - not reinstall_self:
55 + if not (autoclean or dblnk.mycpv == self.mycpv or reinstall_self):
56 continue
57 writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
58 others_in_slot.remove(dblnk) # dblnk will unmerge itself now
59 @@ -2139,9 +2139,13 @@
60 # TODO: Check status and abort if necessary.
61 dblnk.delete()
62 writemsg_stdout(">>> Original instance of package unmerged safely.\n")
63 - if not reinstall_self:
64 - break
65
66 + if len(others_in_slot) > 1:
67 + from portage.output import colorize
68 + writemsg_stdout(colorize("WARN", "WARNING:")
69 + + " AUTOCLEAN is disabled. This can cause serious"
70 + + " problems due to overlapping packages.\n")
71 +
72 # We hold both directory locks.
73 self.dbdir = self.dbpkgdir
74 self.delete()
75
76 --
77 gentoo-commits@l.g.o mailing list