public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r11826 - main/trunk/pym/portage/dbapi
@ 2008-11-07 22:18 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-11-07 22:18 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-11-07 22:18:33 +0000 (Fri, 07 Nov 2008)
New Revision: 11826

Modified:
   main/trunk/pym/portage/dbapi/vartree.py
Log:
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.


Modified: main/trunk/pym/portage/dbapi/vartree.py
===================================================================
--- main/trunk/pym/portage/dbapi/vartree.py	2008-11-07 21:52:48 UTC (rev 11825)
+++ main/trunk/pym/portage/dbapi/vartree.py	2008-11-07 22:18:33 UTC (rev 11826)
@@ -13,7 +13,8 @@
 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 @@
 			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")




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-07 22:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 22:18 [gentoo-commits] portage r11826 - main/trunk/pym/portage/dbapi Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox