From aa8d48bdb8954179519f5b0ce5cafe2b5400e163 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 16 Jun 2013 19:27:11 +0300 Subject: [PATCH] Added hack to clear out text seeping in from the surrounding Make when building a Debian package. --- dependencies.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dependencies.py b/dependencies.py index 9ed8dee67..c5c755f52 100644 --- a/dependencies.py +++ b/dependencies.py @@ -428,9 +428,16 @@ class GnuStepDependency(Dependency): liberr = liberr.decode() if fp.returncode != 0: raise DependencyException('Error getting objc-lib flags: %s %s' % (libtxt, liberr)) - self.libs = libtxt.split() + self.libs = self.weird_filter(libtxt.split()) print('Dependency GnuStep found: YES') + def weird_filter(self, elems): + """When building packages, the output of the enclosing Make +is sometimes mixed among the subprocess output. I have no idea +why. As a hack filter out everything that is not a flag.""" + return [e for e in elems if e.startswith('-')] + + def filter_flags(self, flags): """gnustep-config returns a bunch of garbage flags such as -O2 and so on. Drop everything that is not needed."""