Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15500 - in main/branches/prefix/pym/portage: . dbapi proxy
Date: Sun, 28 Feb 2010 14:19:18
Message-Id: E1NljzI-0005CQ-Jr@stork.gentoo.org
1 Author: grobian
2 Date: 2010-02-28 14:19:16 +0000 (Sun, 28 Feb 2010)
3 New Revision: 15500
4
5 Modified:
6 main/branches/prefix/pym/portage/__init__.py
7 main/branches/prefix/pym/portage/dbapi/bintree.py
8 main/branches/prefix/pym/portage/dbapi/porttree.py
9 main/branches/prefix/pym/portage/dbapi/vartree.py
10 main/branches/prefix/pym/portage/proxy/objectproxy.py
11 Log:
12 Merged from trunk -r15493:15497
13
14 | 15494 | Remove print() usage. |
15 | zmedico | |
16
17 | 15495 | Remove print() usage. |
18 | zmedico | |
19
20 | 15496 | Fix broken reference to portage._spawn_misc_sh(). Thanks to |
21 | zmedico | Arfrever for reporting. |
22
23 | 15497 | Add ObjectProxy __gt__, __ge__, __lt__, and __le__ methods |
24 | zmedico | to fix TypeError with python3 reported by Arfrever: File |
25 | | "/usr/lib/portage/pym/portage/__init__.py", line 513, in |
26 | | portageexit if secpass > 1 and os.environ.get("SANDBOX_ON") |
27 | | != "1": TypeError: unorderable types: _LazyImportFrom() > |
28 | | int() |
29
30
31 Modified: main/branches/prefix/pym/portage/__init__.py
32 ===================================================================
33 --- main/branches/prefix/pym/portage/__init__.py 2010-02-28 14:18:21 UTC (rev 15499)
34 +++ main/branches/prefix/pym/portage/__init__.py 2010-02-28 14:19:16 UTC (rev 15500)
35 @@ -509,7 +509,7 @@
36 auxdbkeylen=len(auxdbkeys)
37
38 def portageexit():
39 - if secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
40 + if data.secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
41 close_portdbapi_caches()
42 try:
43 mtimedb
44
45 Modified: main/branches/prefix/pym/portage/dbapi/bintree.py
46 ===================================================================
47 --- main/branches/prefix/pym/portage/dbapi/bintree.py 2010-02-28 14:18:21 UTC (rev 15499)
48 +++ main/branches/prefix/pym/portage/dbapi/bintree.py 2010-02-28 14:19:16 UTC (rev 15500)
49 @@ -2,8 +2,6 @@
50 # Distributed under the terms of the GNU General Public License v2
51 # $Id$
52
53 -from __future__ import print_function
54 -
55 __all__ = ["bindbapi", "binarytree"]
56
57 import portage
58 @@ -868,7 +866,6 @@
59 mykey = portage.cpv_getkey(fullpkg)
60 try:
61 # invalid tbz2's can hurt things.
62 - #print "cpv_inject("+str(fullpkg)+")"
63 self.dbapi.cpv_inject(fullpkg)
64 remote_metadata = self.__remotepkgs[mypkg]
65 for k, v in remote_metadata.items():
66 @@ -885,7 +882,6 @@
67 remote_metadata.pop(k, None)
68
69 self._remotepkgs[fullpkg] = remote_metadata
70 - #print " -- Injected"
71 except SystemExit as e:
72 raise
73 except:
74 @@ -1151,7 +1147,6 @@
75 def gettbz2(self, pkgname):
76 """Fetches the package from a remote site, if necessary. Attempts to
77 resume if the file appears to be partially downloaded."""
78 - print("Fetching '"+str(pkgname)+"'")
79 tbz2_path = self.getname(pkgname)
80 tbz2name = os.path.basename(tbz2_path)
81 resume = False
82
83 Modified: main/branches/prefix/pym/portage/dbapi/porttree.py
84 ===================================================================
85 --- main/branches/prefix/pym/portage/dbapi/porttree.py 2010-02-28 14:18:21 UTC (rev 15499)
86 +++ main/branches/prefix/pym/portage/dbapi/porttree.py 2010-02-28 14:19:16 UTC (rev 15500)
87 @@ -2,8 +2,6 @@
88 # Distributed under the terms of the GNU General Public License v2
89 # $Id$
90
91 -from __future__ import print_function
92 -
93 __all__ = [
94 "close_portdbapi_caches", "FetchlistDict", "portagetree", "portdbapi"
95 ]
96 @@ -809,8 +807,8 @@
97 checksums = mf.getDigests()
98 if not checksums:
99 if debug:
100 - print("[empty/missing/bad digest]: "+mypkg)
101 - return None
102 + writemsg("[empty/missing/bad digest]: %s\n" % (mypkg,))
103 + return {}
104 filesdict={}
105 myfiles = self.getFetchMap(mypkg, useflags=useflags)
106 #XXX: maybe this should be improved: take partial downloads
107 @@ -1091,8 +1089,8 @@
108 else:
109 myval = list(self._iter_match(mydep, self.cp_list(mykey)))
110 else:
111 - print("ERROR: xmatch doesn't handle", level, "query!")
112 - raise KeyError
113 + raise AssertionError(
114 + "Invalid level argument: '%s'" % level)
115
116 if self.frozen and (level not in ["match-list", "bestmatch-list"]):
117 self.xcache[level][mydep] = myval
118
119 Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
120 ===================================================================
121 --- main/branches/prefix/pym/portage/dbapi/vartree.py 2010-02-28 14:18:21 UTC (rev 15499)
122 +++ main/branches/prefix/pym/portage/dbapi/vartree.py 2010-02-28 14:19:16 UTC (rev 15500)
123 @@ -5391,7 +5391,7 @@
124 phase = 'die_hooks'
125
126 if self._scheduler is None:
127 - portage._spawn_misc_sh(self.settings, [phase],
128 + _spawn_misc_sh(self.settings, [phase],
129 phase=phase)
130 else:
131 self._scheduler.dblinkEbuildPhase(
132
133 Modified: main/branches/prefix/pym/portage/proxy/objectproxy.py
134 ===================================================================
135 --- main/branches/prefix/pym/portage/proxy/objectproxy.py 2010-02-28 14:18:21 UTC (rev 15499)
136 +++ main/branches/prefix/pym/portage/proxy/objectproxy.py 2010-02-28 14:19:16 UTC (rev 15500)
137 @@ -61,6 +61,18 @@
138 def __hash__(self):
139 return hash(object.__getattribute__(self, '_get_target')())
140
141 + def __ge__(self, other):
142 + return object.__getattribute__(self, '_get_target')() >= other
143 +
144 + def __gt__(self, other):
145 + return object.__getattribute__(self, '_get_target')() > other
146 +
147 + def __le__(self, other):
148 + return object.__getattribute__(self, '_get_target')() <= other
149 +
150 + def __lt__(self, other):
151 + return object.__getattribute__(self, '_get_target')() < other
152 +
153 def __eq__(self, other):
154 return object.__getattribute__(self, '_get_target')() == other