From dd8b2fef09dbb5a07f0b1243ee2e3dd7811307ac Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 20 Aug 2008 20:48:37 +0000 Subject: [PATCH] try not to crash when otool isn't there, as that can happen svn path=/main/branches/prefix/; revision=11444 --- pym/portage/dbapi/vartree.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 9a5d6d4f3..50e73c355 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -478,12 +478,19 @@ class LinkageMapMachO(object): otool = EPREFIX+"/usr/bin/otool" for items in self._dbapi.plib_registry.getPreservedLibs().values(): for x in items: - proc = subprocess.Popen([otool, "-DX", x.lstrip(".")], - stdout=subprocess.PIPE) - install_name = proc.communicate()[0].split("\n")[0] - proc = subprocess.Popen([otool, "-LX", x.lstrip(".")], - stdout=subprocess.PIPE) - output = [l.lstrip() for l in proc.communicate()[0].split("\n")] + try: + proc = subprocess.Popen([otool, "-DX", x.lstrip(".")], + stdout=subprocess.PIPE) + install_name = proc.communicate()[0].split("\n")[0] + proc = subprocess.Popen([otool, "-LX", x.lstrip(".")], + stdout=subprocess.PIPE) + output = [l.lstrip() for l in proc.communicate()[0].split("\n")] + except OSError: + # if otool can't be found (like in an odcctools + # upgrade -> binutils-config needs to update + # symlinks) just ignore it, don't crash + continue + n = "" for l in output: if l == '': -- 2.26.2