summaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
authorliquidx <liquidx@gentoo.org>2003-04-24 10:02:43 +0000
committerliquidx <liquidx@gentoo.org>2003-04-24 10:02:43 +0000
commita91feb32d3a9fede9504adfa06a9f6cf70b90dd8 (patch)
tree7427f7817b89fb4aac176cb324a414a07a80e501 /trunk
parentfa1882c5c6ab4f502bd1ccc67001afae4b341220 (diff)
downloadgentoolkit-a91feb32d3a9fede9504adfa06a9f6cf70b90dd8.tar.gz
Fixed bug if ebuild is not found
svn path=/; revision=16
Diffstat (limited to 'trunk')
-rwxr-xr-xtrunk/src/etcat/etcat20
1 files changed, 13 insertions, 7 deletions
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. <liquidx@gentoo.org>
+# 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]) + ")"