From 79222bab6c763d14936fcc7f6c1a22c0bc7fd39a Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Thu, 25 Feb 2010 17:59:49 +0100 Subject: [PATCH] Fix searching for ld_linux executable on 64 bit machines On some machines we can have more ld_linux executables specified in /usr/bin/ldd file. This patch fixes how we search for the file. --- src/pylorax/sysutils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pylorax/sysutils.py b/src/pylorax/sysutils.py index 6e207def..fd8377ee 100644 --- a/src/pylorax/sysutils.py +++ b/src/pylorax/sysutils.py @@ -356,11 +356,14 @@ class Linker(object): ld_linux = m.group("ld_linux") break - if ld_linux is None: + if ld_linux: + ld_linux = filter(os.path.isfile, ld_linux.split()) + + if not ld_linux: raise LinkerError("cannot find the ld_linux executable") self.lddcmd = "LD_LIBRARY_PATH={0} {1} --list" - self.lddcmd = self.lddcmd.format(libdirs, ld_linux) + self.lddcmd = self.lddcmd.format(libdirs, ld_linux[0]) self.pattern = re.compile(r"^[-._/a-zA-Z0-9]+\s=>\s" r"(?P[-._/a-zA-Z0-9]+)"