Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15509 - main/trunk/pym/portage/dbapi
Date: Mon, 01 Mar 2010 06:55:17
Message-Id: E1NlzX2-0005MM-Tj@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-03-01 06:55:08 +0000 (Mon, 01 Mar 2010)
3 New Revision: 15509
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.py
7 Log:
8 Use writemsg instead of print. Also don't use _ as a variable name since it
9 collides with _ from portage.localization.
10
11
12 Modified: main/trunk/pym/portage/dbapi/vartree.py
13 ===================================================================
14 --- main/trunk/pym/portage/dbapi/vartree.py 2010-03-01 05:02:23 UTC (rev 15508)
15 +++ main/trunk/pym/portage/dbapi/vartree.py 2010-03-01 06:55:08 UTC (rev 15509)
16 @@ -2,8 +2,6 @@
17 # Distributed under the terms of the GNU General Public License v2
18 # $Id$
19
20 -from __future__ import print_function
21 -
22 __all__ = ["PreservedLibsRegistry", "LinkageMap",
23 "vardbapi", "vartree", "dblink"] + \
24 ["write_contents", "tar_contents"]
25 @@ -500,7 +498,7 @@
26 if obj_key.file_exists():
27 # Get the arch and soname from LinkageMap._obj_properties if
28 # it exists. Otherwise, None.
29 - arch, _, _, soname, _ = \
30 + arch, _needed, _path, soname, _objs = \
31 self._obj_properties.get(obj_key, (None,)*5)
32 return cache_self.cache.setdefault(obj, \
33 (arch, soname, obj_key, True))
34 @@ -514,7 +512,7 @@
35
36 # Iterate over all obj_keys and their providers.
37 for obj_key, sonames in providers.items():
38 - arch, _, path, _, objs = self._obj_properties[obj_key]
39 + arch, _needed, path, _soname, objs = self._obj_properties[obj_key]
40 path = path.union(self._defpath)
41 # Iterate over each needed soname and the set of library paths that
42 # fulfill the soname to determine if the dependency is broken.
43 @@ -544,19 +542,23 @@
44 # XXX This is most often due to soname symlinks not in
45 # a library's directory. We could catalog symlinks in
46 # LinkageMap to avoid checking for this edge case here.
47 - print(_("Found provider outside of findProviders:"), \
48 - os.path.join(directory, soname), "->", \
49 - self._obj_properties[cachedKey][4], libraries)
50 + writemsg(
51 + _("Found provider outside of findProviders:") + \
52 + (" %s -> %s %s\n" % (os.path.join(directory, soname),
53 + self._obj_properties[cachedKey][4], libraries)),
54 + noiselevel=-1)
55 # A valid library has been found, so there is no need to
56 # continue.
57 break
58 if debug and cachedArch == arch and \
59 cachedKey in self._obj_properties:
60 - print(_("Broken symlink or missing/bad soname: %(dir_soname)s -> %(cachedKey)s "
61 + writemsg((_("Broken symlink or missing/bad soname: " + \
62 + "%(dir_soname)s -> %(cachedKey)s " + \
63 "with soname %(cachedSoname)s but expecting %(soname)s") % \
64 {"dir_soname":os.path.join(directory, soname),
65 "cachedKey": self._obj_properties[cachedKey],
66 - "cachedSoname": cachedSoname, "soname":soname})
67 + "cachedSoname": cachedSoname, "soname":soname}) + "\n",
68 + noiselevel=-1)
69 # This conditional checks if there are no libraries to satisfy the
70 # soname (empty set).
71 if not validLibraries:
72 @@ -572,10 +574,12 @@
73 rValue.setdefault(lib, set()).add(soname)
74 if debug:
75 if not os.path.isfile(lib):
76 - print(_("Missing library:"), lib)
77 + writemsg(_("Missing library:") + " %s\n" % (lib,),
78 + noiselevel=-1)
79 else:
80 - print(_("Possibly missing symlink:"), \
81 - os.path.join(os.path.dirname(lib), soname))
82 + writemsg(_("Possibly missing symlink:") + \
83 + "%s\n" % (os.path.join(os.path.dirname(lib), soname)),
84 + noiselevel=-1)
85 return rValue
86
87 def listProviders(self):
88 @@ -695,7 +699,7 @@
89 if obj_key not in self._obj_properties:
90 raise KeyError("%s (%s) not in object list" % (obj_key, obj))
91
92 - arch, needed, path, _, _ = self._obj_properties[obj_key]
93 + arch, needed, path, _soname, _objs = self._obj_properties[obj_key]
94 path_keys = set(self._path_key(x) for x in path.union(self._defpath))
95 for soname in needed:
96 rValue[soname] = set()
97 @@ -782,12 +786,12 @@
98 objs_dir_keys = set(self._path_key(os.path.dirname(x)) for x in objs)
99 defpath_keys = set(self._path_key(x) for x in self._defpath)
100
101 - arch, _, _, soname, _ = self._obj_properties[obj_key]
102 + arch, _needed, _path, soname, _objs = self._obj_properties[obj_key]
103 if arch in self._libs and soname in self._libs[arch]:
104 # For each potential consumer, add it to rValue if an object from the
105 # arguments resides in the consumer's runpath.
106 for consumer_key in self._libs[arch][soname].consumers:
107 - _, _, path, _, consumer_objs = \
108 + _arch, _needed, path, _soname, consumer_objs = \
109 self._obj_properties[consumer_key]
110 path_keys = defpath_keys.union(self._path_key(x) for x in path)
111 if objs_dir_keys.intersection(path_keys):