From: fuzzyray Date: Fri, 22 Aug 2008 21:14:36 +0000 (-0000) Subject: Fix gentoolkit.split_package_name to work when portage.catpkgsplit returns None X-Git-Tag: gentoolkit-0.2.4.3~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f2d3b09b3287f52c1e9cd8ffa6c39585a9315dae;p=gentoolkit.git Fix gentoolkit.split_package_name to work when portage.catpkgsplit returns None svn path=/; revision=506 --- diff --git a/trunk/src/gentoolkit/helpers.py b/trunk/src/gentoolkit/helpers.py index 595bee3..6dba7db 100644 --- a/trunk/src/gentoolkit/helpers.py +++ b/trunk/src/gentoolkit/helpers.py @@ -130,13 +130,15 @@ def split_package_name(name): """Returns a list on the form [category, name, version, revision]. Revision will be 'r0' if none can be inferred. Category and version will be empty, if none can be inferred.""" - r = list(portage.catpkgsplit(name)) + r = portage.catpkgsplit(name) if not r: r = name.split("/") if len(r) == 1: return ["", name, "", "r0"] else: return r + ["", "r0"] + else: + r = list(r) if r[0] == 'null': r[0] = '' return r