diff --git a/helpers/create-abi-bump.py b/helpers/create-abi-bump.py --- a/helpers/create-abi-bump.py +++ b/helpers/create-abi-bump.py @@ -51,7 +51,8 @@ """ _args = args.split() if len(_args) == 2: - variables[_args[0]] = _args[1] + name, value = _args + variables[name] = value def parse_set_target_properties(args: str) -> None: """process set_target_properties cmake lines and update the targets directory @@ -62,9 +63,9 @@ args[0] is the target we want to update args[1] must be PROPERTIES """ - _args = args.split() - target = targets[_args[0]] - if not _args[1] == "PROPERTIES": + name, properties, values = args.split() + target = targets[name] + if not properties == "PROPERTIES": logging.warning("unknown line: %s"%(args)) # Known set_target_properties keywords @@ -78,7 +79,7 @@ ] tmpKeyword = None - for arg in _args[2:]: + for arg in values: if arg in keywords: tmpKeyword = target[arg] continue @@ -124,11 +125,10 @@ with tempfile.TemporaryDirectory() as d: # Create a CMakeLists.txt that depends on the requested library - with (pathlib.Path(d)/"CMakeLists.txt").open("w") as f: - f.write("find_package({self.name} CONFIG REQUIRED)\n".format(self=self)) # replace with f-String in python 3.6 - - proc = subprocess.Popen(['cmake', '.', '--trace-expand'], cwd=d, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + cmakeFile = (pathlib.Path(d)/"CMakeLists.txt") + cmakeFile.write_text("find_package({self.name} CONFIG REQUIRED)\n".format(self=self)) # replace with f-String in python 3.6 + proc = subprocess.Popen(['cmake', '.', '--trace-expand'], cwd=d, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, check=True) # search only for lines that are the output of the specifc cmake files self.__mlines = [] # type: List[str] @@ -204,7 +204,7 @@ f.write(xml) # acc is compatible for C/C++ as Qt using C++11 and -fPic we need to set the gcc settings explitly - subprocess.call(["abi-compliance-checker", "-gcc-options", "-std=c++11 -fPIC", "-l", self.name, "--dump",f.name]) + subprocess.check_call(["abi-compliance-checker", "-gcc-options", "-std=c++11 -fPIC", "-l", self.name, "--dump",f.name]) # search in buildlog for the Installing/Up-to-date lines where we installnig the Config.cmake files.