From 55cafc3f331a4ce17ecf0953eacc37842f6da6c0 Mon Sep 17 00:00:00 2001 From: worch Date: Sat, 2 Aug 2008 20:02:53 -0500 Subject: [PATCH] Fixed some formating. --- pym/portage/dbapi/vartree.py | 18 ++++++++++++------ vartree.py.2.2_rc6.patch | 22 ++++++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index eb93ed3..b2bd6b9 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -244,14 +244,18 @@ class LinkageMap(object): # Get the soname from LinkageMap._obj_properties if it # exists. Otherwise, None. soname = self._obj_properties.get(realpath, (None,)*3)[3] - # Both path and realpath are cached and the result is returned. - cache_self.cache.setdefault(realpath, (soname, realpath, True)) - return cache_self.cache.setdefault(path, (soname, realpath, True)) + # Both path and realpath are cached and the result is + # returned. + cache_self.cache.setdefault(realpath, \ + (soname, realpath, True)) + return cache_self.cache.setdefault(path, \ + (soname, realpath, True)) else: # realpath is not cached here, because the majority of cases # where realpath is not a file, path is the same as realpath. # Thus storing twice slows down the cache performance. - return cache_self.cache.setdefault(path, (None, realpath, False)) + return cache_self.cache.setdefault(path, \ + (None, realpath, False)) debug = False rValue = {} @@ -405,7 +409,8 @@ class LinkageMap(object): libraries = set() for libs in rValue[binary].values(): libraries.update(set(libs)) - rValue.update(self.listProvidersForReachableBinaries(libraries, rValue=rValue)) + rValue.update(self.listProvidersForReachableBinaries(libraries, \ + rValue=rValue)) return rValue @@ -437,7 +442,8 @@ class LinkageMap(object): if x not in self._libs or arch not in self._libs[x]: continue for y in self._libs[x][arch]["providers"]: - if x[0] == os.sep and os.path.realpath(x) == os.path.realpath(y): + if x[0] == os.sep and \ + os.path.realpath(x) == os.path.realpath(y): rValue[x].add(y) self.findDeepProviders(obj=y, rValue=rValue) elif os.path.realpath(os.path.dirname(y)) in path: diff --git a/vartree.py.2.2_rc6.patch b/vartree.py.2.2_rc6.patch index 4f38675..bb70987 100644 --- a/vartree.py.2.2_rc6.patch +++ b/vartree.py.2.2_rc6.patch @@ -1,5 +1,5 @@ --- vartree.py.2.2_rc6 2008-08-01 15:41:03.000000000 -0500 -+++ pym/portage/dbapi/vartree.py 2008-08-02 18:45:21.000000000 -0500 ++++ pym/portage/dbapi/vartree.py 2008-08-02 20:02:32.000000000 -0500 @@ -173,8 +173,18 @@ arch = fields[0] obj = os.path.realpath(fields[1]) @@ -21,7 +21,7 @@ if soname: libs.setdefault(soname, {arch: {"providers": [], "consumers": []}}) libs[soname].setdefault(arch, {"providers": [], "consumers": []}) -@@ -188,6 +198,253 @@ +@@ -188,6 +198,259 @@ self._libs = libs self._obj_properties = obj_properties @@ -71,14 +71,18 @@ + # Get the soname from LinkageMap._obj_properties if it + # exists. Otherwise, None. + soname = self._obj_properties.get(realpath, (None,)*3)[3] -+ # Both path and realpath are cached and the result is returned. -+ cache_self.cache.setdefault(realpath, (soname, realpath, True)) -+ return cache_self.cache.setdefault(path, (soname, realpath, True)) ++ # Both path and realpath are cached and the result is ++ # returned. ++ cache_self.cache.setdefault(realpath, \ ++ (soname, realpath, True)) ++ return cache_self.cache.setdefault(path, \ ++ (soname, realpath, True)) + else: + # realpath is not cached here, because the majority of cases + # where realpath is not a file, path is the same as realpath. + # Thus storing twice slows down the cache performance. -+ return cache_self.cache.setdefault(path, (None, realpath, False)) ++ return cache_self.cache.setdefault(path, \ ++ (None, realpath, False)) + + debug = False + rValue = {} @@ -232,7 +236,8 @@ + libraries = set() + for libs in rValue[binary].values(): + libraries.update(set(libs)) -+ rValue.update(self.listProvidersForReachableBinaries(libraries, rValue=rValue)) ++ rValue.update(self.listProvidersForReachableBinaries(libraries, \ ++ rValue=rValue)) + + return rValue + @@ -264,7 +269,8 @@ + if x not in self._libs or arch not in self._libs[x]: + continue + for y in self._libs[x][arch]["providers"]: -+ if x[0] == os.sep and os.path.realpath(x) == os.path.realpath(y): ++ if x[0] == os.sep and \ ++ os.path.realpath(x) == os.path.realpath(y): + rValue[x].add(y) + self.findDeepProviders(obj=y, rValue=rValue) + elif os.path.realpath(os.path.dirname(y)) in path: -- 2.11.4.GIT