Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13759 - main/trunk/pym/_emerge
Date: Fri, 03 Jul 2009 00:52:55
Message-Id: E1MMX1A-0000no-Uv@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-07-03 00:52:44 +0000 (Fri, 03 Jul 2009)
3 New Revision: 13759
4
5 Modified:
6 main/trunk/pym/_emerge/depgraph.py
7 Log:
8 Use depgraph._pkg() whenever possible.
9
10
11 Modified: main/trunk/pym/_emerge/depgraph.py
12 ===================================================================
13 --- main/trunk/pym/_emerge/depgraph.py 2009-07-02 23:56:18 UTC (rev 13758)
14 +++ main/trunk/pym/_emerge/depgraph.py 2009-07-03 00:52:44 UTC (rev 13759)
15 @@ -1127,12 +1127,9 @@
16 os.path.realpath(self._frozen_config.trees[myroot]["bintree"].getname(mykey)):
17 print colorize("BAD", "\n*** You need to adjust PKGDIR to emerge this package.\n")
18 return 0, myfavorites
19 - db_keys = list(bindb._aux_cache_keys)
20 - metadata = izip(db_keys, bindb.aux_get(mykey, db_keys))
21 - pkg = Package(type_name="binary", root_config=root_config,
22 - cpv=mykey, built=True, metadata=metadata,
23 +
24 + pkg = self._pkg(mykey, "binary", root_config,
25 onlydeps=onlydeps)
26 - self._dynamic_config._pkg_cache[pkg] = pkg
27 args.append(PackageArg(arg=x, package=pkg,
28 root_config=root_config))
29 elif ext==".ebuild":
30 @@ -1165,11 +1162,8 @@
31 else:
32 raise portage.exception.PackageNotFound(
33 "%s is not in a valid portage tree hierarchy or does not exist" % x)
34 - db_keys = list(portdb._aux_cache_keys)
35 - metadata = izip(db_keys, portdb.aux_get(mykey, db_keys))
36 - pkg = Package(type_name="ebuild", root_config=root_config,
37 - cpv=mykey, metadata=metadata, onlydeps=onlydeps)
38 - self._dynamic_config._pkg_cache[pkg] = pkg
39 + pkg = self._pkg(mykey, "ebuild", root_config,
40 + onlydeps=onlydeps)
41 args.append(PackageArg(arg=x, package=pkg,
42 root_config=root_config))
43 elif x.startswith(os.path.sep):
44 @@ -2997,8 +2991,8 @@
45 continue
46
47 root_config = self._frozen_config.roots[task.root]
48 - inst_pkg = self._dynamic_config._pkg_cache[
49 - ("installed", task.root, task.cpv, "nomerge")]
50 + inst_pkg = self._pkg(task.cpv, "installed", root_config,
51 + installed=True)
52
53 if self._dynamic_config.digraph.contains(inst_pkg):
54 continue
55 @@ -3549,8 +3543,9 @@
56
57 # Remove the corresponding "nomerge" node and substitute
58 # the Uninstall node.
59 - inst_pkg = self._dynamic_config._pkg_cache[
60 - ("installed", uninstall.root, uninstall.cpv, "nomerge")]
61 + inst_pkg = self._pkg(uninstall.cpv, "installed",
62 + uninstall.root_config, installed=True)
63 +
64 try:
65 mygraph.remove(inst_pkg)
66 except KeyError:
67 @@ -4378,30 +4373,16 @@
68 continue
69 if action != "merge":
70 continue
71 - tree_type = self.pkg_tree_map[pkg_type]
72 - mydb = trees[myroot][tree_type].dbapi
73 - db_keys = list(self._frozen_config._trees_orig[myroot][
74 - tree_type].dbapi._aux_cache_keys)
75 + root_config = self._frozen_config.roots[myroot]
76 try:
77 - metadata = izip(db_keys, mydb.aux_get(pkg_key, db_keys))
78 - except KeyError:
79 + pkg = self._pkg(pkg_key, pkg_type, root_config)
80 + except portage.exception.PackageNotFound:
81 # It does no exist or it is corrupt.
82 - if action == "uninstall":
83 - continue
84 if skip_missing:
85 # TODO: log these somewhere
86 continue
87 - raise portage.exception.PackageNotFound(pkg_key)
88 - installed = action == "uninstall"
89 - built = pkg_type != "ebuild"
90 - root_config = self._frozen_config.roots[myroot]
91 - pkg = Package(built=built, cpv=pkg_key,
92 - installed=installed, metadata=metadata,
93 - operation=action, root_config=root_config,
94 - type_name=pkg_type)
95 - self._dynamic_config._pkg_cache[pkg] = pkg
96 + raise
97
98 - root_config = self._frozen_config.roots[pkg.root]
99 if "merge" == pkg.operation and \
100 not visible(root_config.settings, pkg):
101 if skip_masked: