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

Author: zmedico
Date: 2008-11-07 21:52:48 +0000 (Fri, 07 Nov 2008)
New Revision: 11825

Modified:
   main/trunk/pym/portage/dbapi/vartree.py
Log:
Handle a potential OSError that occurs if the scanelf binary is missing
when LinkageMap.rebuild() is called.


Modified: main/trunk/pym/portage/dbapi/vartree.py
===================================================================
--- main/trunk/pym/portage/dbapi/vartree.py	2008-11-07 21:40:21 UTC (rev 11824)
+++ main/trunk/pym/portage/dbapi/vartree.py	2008-11-07 21:52:48 UTC (rev 11825)
@@ -278,20 +278,26 @@
 			for items in self._dbapi.plib_registry.getPreservedLibs().values():
 				args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
 					for x in items)
-			proc = subprocess.Popen(args, stdout=subprocess.PIPE)
-			for l in proc.stdout:
-				l = l[3:].rstrip("\n")
-				if not l:
-					continue
-				fields = l.split(";")
-				if len(fields) < 5:
-					writemsg_level("\nWrong number of fields " + \
-						"returned from scanelf: %s\n\n" % (l,),
-						level=logging.ERROR, noiselevel=-1)
-					continue
-				fields[1] = fields[1][root_len:]
-				lines.append(";".join(fields))
-			proc.wait()
+			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
+			else:
+				for l in proc.stdout:
+					l = l[3:].rstrip("\n")
+					if not l:
+						continue
+					fields = l.split(";")
+					if len(fields) < 5:
+						writemsg_level("\nWrong number of fields " + \
+							"returned from scanelf: %s\n\n" % (l,),
+							level=logging.ERROR, noiselevel=-1)
+						continue
+					fields[1] = fields[1][root_len:]
+					lines.append(";".join(fields))
+				proc.wait()
 
 		for l in lines:
 			l = l.rstrip("\n")




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

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

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 21:52 [gentoo-commits] portage r11825 - 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