From 0f644654426cc0f8c989796a3e0ee649c315f7c9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 7 Nov 2008 22:18:33 +0000 Subject: In LinkageMap.rebuild(), immediately raise a CommandNotFound exception if scanelf is missing since otherwise it will lead to a KeyError later on from findConsumers or findProviders. This will allow the caller to handle the CommandNotFound exception if necessary, and skip any findConsumers or findProviders since they won't be able to return valid results. svn path=/main/trunk/; revision=11826 --- pym/portage/dbapi/vartree.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5d6e8f578..110bcff4c 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -13,7 +13,8 @@ from portage.data import portage_gid, portage_uid, secpass from portage.dbapi import dbapi from portage.dep import use_reduce, paren_reduce, isvalidatom, \ isjustname, dep_getkey, match_from_list -from portage.exception import InvalidData, InvalidPackageName, \ +from portage.exception import CommandNotFound, \ + InvalidData, InvalidPackageName, \ FileNotFound, PermissionDenied, UnsupportedAPIException from portage.locks import lockdir, unlockdir from portage.output import bold, red, green @@ -281,9 +282,9 @@ class LinkageMap(object): try: proc = subprocess.Popen(args, stdout=subprocess.PIPE) except EnvironmentError, e: - writemsg_level("\nUnable to execute %s: %s\n\n" % (args[0], e), - level=logging.ERROR, noiselevel=-1) - del e + if e.errno != errno.ENOENT: + raise + raise CommandNotFound(args[0]) else: for l in proc.stdout: l = l[3:].rstrip("\n") -- cgit v1.2.3-1-g7c22