[gobject-introspection] giscanner: Fix shared library name finding on *BSD



commit f9788b2d1e56af14c81ce2e52aeacad931d87e2b
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Thu Dec 28 02:53:15 2017 +0800

    giscanner: Fix shared library name finding on *BSD
    
    ldd commands on *BSD always print the name of the input file regardless
    of the number of arguments, so we have to ignore this line to avoid
    matching it with _ldd_library_pattern.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791991

 giscanner/shlibs.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
index c93d20c..4e45957 100644
--- a/giscanner/shlibs.py
+++ b/giscanner/shlibs.py
@@ -117,6 +117,11 @@ def _resolve_non_libtool(options, binary, libraries):
         shlibs = []
         for line in proc.stdout:
             line = line.decode('ascii')
+            # ldd on *BSD show the argument passed on the first line even if
+            # there is only one argument. We have to ignore it because it is
+            # possible for the name of the binary to match _ldd_library_pattern.
+            if line == binary.args[0] + ':\n':
+                continue
             for library, pattern in patterns.items():
                 m = pattern.search(line)
                 if m:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]