2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright (c) 2020 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
10 _, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
11 with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
13 for name in subprocess.run([ar, "t", archive], stdout=subprocess.PIPE,
14 check=True).stdout.decode().splitlines():
15 if os.path.exists(name):
18 subprocess.run([ar, "x", os.path.abspath(archive), name],
20 paths.append(os.path.join(temp, name))
21 subprocess.run(pmdinfogen + paths + [output], check=True)