X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=buildtools%2Fgen-pmdinfo-cfile.py;h=58fe3ad152132300e251f480af1b258f94244d00;hb=7f2ae5ddb1b3567655555a34fb014fdef9caabc2;hp=a4e080199151a0d97df1b77a5c1d081b854f77e4;hpb=3feefc80ac3a24e0aba9d3730dd1fa4ea1bf121a;p=dpdk.git diff --git a/buildtools/gen-pmdinfo-cfile.py b/buildtools/gen-pmdinfo-cfile.py index a4e0801991..58fe3ad152 100644 --- a/buildtools/gen-pmdinfo-cfile.py +++ b/buildtools/gen-pmdinfo-cfile.py @@ -9,11 +9,12 @@ import tempfile _, tmp_root, ar, archive, output, *pmdinfogen = sys.argv with tempfile.TemporaryDirectory(dir=tmp_root) as temp: - proc = subprocess.run( - # Don't use "ar p", because its output is corrupted on Windows. - [ar, "xv", os.path.abspath(archive)], stdout=subprocess.PIPE, check=True, cwd=temp + run_ar = lambda command: subprocess.run( + [ar, command, os.path.abspath(archive)], + stdout=subprocess.PIPE, check=True, cwd=temp ) - lines = proc.stdout.decode().splitlines() - names = [line[len("x - ") :] for line in lines] + # Don't use "ar p", because its output is corrupted on Windows. + run_ar("x") + names = run_ar("t").stdout.decode().splitlines() paths = [os.path.join(temp, name) for name in names] subprocess.run(pmdinfogen + paths + [output], check=True)