summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-12-14 12:40:12 +0100
committerThomas Haller <thaller@redhat.com>2017-12-14 15:18:48 +0100
commit9fc990e8a99bde7178e5c8076383b6e0ca7d7a45 (patch)
tree59f39cf716ae3919f5f813a643bb548ecbd91a02
parent7d074fa6df237240202ff2f6dae7fd79d7fa0fdd (diff)
downloadNetworkManager-9fc990e8a99bde7178e5c8076383b6e0ca7d7a45.tar.gz
build: library paths as parameters for generate-settings-docs.py
generate-settings-docs.py script uses the `LD_LIBRARY_PATH` to prepend directories to the library search path, which is useful to load a just built libnm shared library, when generating the `nm-settings-docs.xml` and `nm-property-docs.xml` files. However, this is a problem for meson, which is not able to set environment variables when executing the script. This patch adds a new optional parameter, `-l` or `--lib-path` that can be used to pass different paths to be prepended without using the `LD_LIBRARY_PATH` environment, which can still be used. [thaller@redhat.com: fix script to handle None lib_path argument] https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00044.html
-rwxr-xr-xlibnm/generate-setting-docs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py
index f888ff223e..225526151f 100755
--- a/libnm/generate-setting-docs.py
+++ b/libnm/generate-setting-docs.py
@@ -183,6 +183,7 @@ def usage():
exit()
parser = argparse.ArgumentParser()
+parser.add_argument('-l', '--lib-path', metavar='PATH', action='append', help='path to scan for shared libraries')
parser.add_argument('-g', '--gir', metavar='FILE', help='NM-1.0.gir file')
parser.add_argument('-x', '--overrides', metavar='FILE', help='documentation overrides file')
parser.add_argument('-o', '--output', metavar='FILE', help='output file')
@@ -191,6 +192,10 @@ args = parser.parse_args()
if args.gir is None or args.output is None:
usage()
+if args.lib_path:
+ for lib in args.lib_path:
+ GIRepository.Repository.prepend_library_path(lib)
+
girxml = ET.parse(args.gir).getroot()
outfile = open(args.output, mode='w')