From: liquidx Date: Thu, 24 Apr 2003 10:02:43 +0000 (-0000) Subject: Fixed bug if ebuild is not found X-Git-Tag: gentoolkit-0.2.4.3~486 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a91feb32d3a9fede9504adfa06a9f6cf70b90dd8;p=gentoolkit.git Fixed bug if ebuild is not found svn path=/; revision=16 --- diff --git a/trunk/src/etcat/etcat b/trunk/src/etcat/etcat index 281cee1..72b265a 100755 --- a/trunk/src/etcat/etcat +++ b/trunk/src/etcat/etcat @@ -19,7 +19,7 @@ # --| License |------------------------------------------------------ # # Distributed under the terms of the GNU General Public License v2 -# Copyright (c) 2002 Alastair Tse. +# Copyright (c) 2002 Alastair Tse. # # --| Usage |-------------------------------------------------------- # @@ -62,7 +62,7 @@ from output import * options = [ "changes", "versions", "uses", "size" ] __author__ = "Alastair Tse" -__version__ = "0.1.2" +__version__ = "0.1" __productname__ = "etcat" __description__ = "Portage Information Extractor" @@ -318,7 +318,10 @@ def versions(query): state.append(" ") # check if in unstable - ver_keywords = portage.db["/"]["porttree"].dbapi.aux_get(ver,["KEYWORDS"]) + try: + ver_keywords = portage.db["/"]["porttree"].dbapi.aux_get(ver,["KEYWORDS"]) + except KeyError: + ver_keywords = [""] keywords_list = ver_keywords[0].split() if "~" + portage.settings["ARCH"] in keywords_list: state.append(yellow("~")) @@ -334,11 +337,14 @@ def versions(query): color = turquoise else: state.append(" ") - + # print - slot = portage.db["/"]["porttree"].dbapi.aux_get(ver,["SLOT"]) - if not slot: - slot = ["0"] + try: + slot = portage.db["/"]["porttree"].dbapi.aux_get(ver,["SLOT"]) + if not slot: + slot = ["0"] + except KeyError: + slot = ["?"] print " "*8 + "[" + string.join(state,"") + "] " + color(ver) + " (" + color(slot[0]) + ")"