diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2010-09-22 21:28:48 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2010-09-22 21:28:48 +0000 |
| commit | 414ce83f077cac1140122e5569f21a861b514ecf (patch) | |
| tree | 9af3fb603329e53f4c1c7d4dc959b24a58950677 | |
| parent | ede9ba7fae12b8f5c849300836157ba249243adf (diff) | |
| download | gentoolkit-414ce83f077cac1140122e5569f21a861b514ecf.tar.gz | |
Merge from genscripts r461: brian.dolbec
replace the inaccurate reg expression method of obtaining the filename from the
SRC_URI with code from portage.portdbapi._parse_uri_map() so that it works
correctly for all instances and it's just as fast.
svn path=/trunk/gentoolkit/; revision=809
| -rw-r--r-- | pym/gentoolkit/eclean/search.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py index 9cc5923..e29bbfc 100644 --- a/pym/gentoolkit/eclean/search.py +++ b/pym/gentoolkit/eclean/search.py @@ -246,11 +246,16 @@ class DistfilesSearch(object): @returns packages to clean @rtype: dictionary """ - # this regexp extracts files names from SRC_URI. It is not very precise, - # but we don't care (may return empty strings, etc.), since it is fast. - file_regexp = re.compile(r'([a-zA-Z0-9_,\.\-\+\~]*)[\s\)]') for cpv in pkgs: - for file in file_regexp.findall(pkgs[cpv]+"\n"): + uris = pkgs[cpv].split() + uris.reverse() + while uris: + uri = uris.pop() + if uris and uris[-1] == "->": + operator = uris.pop() + file = uris.pop() + else: + file = os.path.basename(uri) if file in clean_me: del clean_me[file] # no need to waste IO time if there is nothing left to clean |
