From 95883d357b9205094ea285ffb64b508e6317a823 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Thu, 2 Sep 2010 12:21:38 -0300 Subject: [PATCH] [scannermain] Create a new option parser Create a new option parser when parsing pkg-config output --- giscanner/scannermain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index bf2af396..d2bd8766 100644 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -183,7 +183,7 @@ def process_options(output, allowed_flags): yield option break -def process_packages(parser, options, packages): +def process_packages(options, packages): args = ['pkg-config', '--cflags'] args.extend(packages) output = subprocess.Popen(args, @@ -196,6 +196,7 @@ def process_packages(parser, options, packages): # so we explicitly filter to only the ones we need. options_whitelist = ['-I', '-D', '-U', '-l', '-L'] filtered_output = list(process_options(output, options_whitelist)) + parser = _get_option_parser() pkg_options, unused = parser.parse_args(filtered_output) options.cpp_includes.extend(pkg_options.cpp_includes) options.cpp_defines.extend(pkg_options.cpp_defines) @@ -283,7 +284,7 @@ def scanner_main(args): packages = set(options.packages) packages.update(transformer.get_pkgconfig_packages()) - exit_code = process_packages(parser, options, packages) + exit_code = process_packages(options, packages) if exit_code: return exit_code -- 2.34.1