Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15487 - in main/trunk/pym/portage: . dbapi
Date: Sun, 28 Feb 2010 03:05:46
Message-Id: E1NlZTV-0003gZ-0O@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-02-28 03:05:44 +0000 (Sun, 28 Feb 2010)
3 New Revision: 15487
4
5 Modified:
6 main/trunk/pym/portage/_global_updates.py
7 main/trunk/pym/portage/dbapi/bintree.py
8 Log:
9 Make _global_updates ensure that the binarytree is only populated with local
10 packages (getbinpkgs=0), and fix binarytree.populate() to behave properly
11 when called more than once.
12
13
14 Modified: main/trunk/pym/portage/_global_updates.py
15 ===================================================================
16 --- main/trunk/pym/portage/_global_updates.py 2010-02-28 02:33:46 UTC (rev 15486)
17 +++ main/trunk/pym/portage/_global_updates.py 2010-02-28 03:05:44 UTC (rev 15487)
18 @@ -94,6 +94,10 @@
19 bindb = trees["/"]["bintree"].dbapi
20 if not os.access(bindb.bintree.pkgdir, os.W_OK):
21 bindb = None
22 + else:
23 + # Call binarytree.populate(), since we want to make sure it's
24 + # only populated with local packages here (getbinpkgs=0).
25 + bindb.bintree.populate()
26 for update_cmd in myupd:
27 if update_cmd[0] == "move":
28 moves = vardb.move_ent(update_cmd)
29
30 Modified: main/trunk/pym/portage/dbapi/bintree.py
31 ===================================================================
32 --- main/trunk/pym/portage/dbapi/bintree.py 2010-02-28 02:33:46 UTC (rev 15486)
33 +++ main/trunk/pym/portage/dbapi/bintree.py 2010-02-28 03:05:44 UTC (rev 15487)
34 @@ -482,6 +482,13 @@
35 if (not os.path.isdir(self.pkgdir) and not getbinpkgs):
36 return 0
37
38 + # Clear all caches in case populate is called multiple times
39 + # as may be the case when _global_updates calls populate()
40 + # prior to performing package moves since it only wants to
41 + # operate on local packages (getbinpkgs=0).
42 + self._remotepkgs = None
43 + self.dbapi._clear_cache()
44 + self.dbapi._aux_cache.clear()
45 if True:
46 pkg_paths = {}
47 self._pkg_paths = pkg_paths
48 @@ -693,10 +700,7 @@
49 writemsg(_("!!! PORTAGE_BINHOST unset, but use is requested.\n"),
50 noiselevel=-1)
51
52 - if getbinpkgs and \
53 - "PORTAGE_BINHOST" in self.settings and \
54 - not self._remotepkgs:
55 -
56 + if getbinpkgs and 'PORTAGE_BINHOST' in self.settings:
57 base_url = self.settings["PORTAGE_BINHOST"]
58 from portage.const import CACHE_PATH
59 try: