net/mlx5: fix Rx queue reference count for indirect RSS
[dpdk.git] / buildtools / gen-pmdinfo-cfile.py
1 #!/usr/bin/env python3
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright (c) 2020 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
4
5 import os
6 import subprocess
7 import sys
8 import tempfile
9
10 _, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
11 with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
12     paths = []
13     for name in subprocess.run([ar, "t", archive], stdout=subprocess.PIPE,
14                                check=True).stdout.decode().splitlines():
15         if os.path.exists(name):
16             paths.append(name)
17         else:
18             subprocess.run([ar, "x", os.path.abspath(archive), name],
19                            check=True, cwd=temp)
20             paths.append(os.path.join(temp, name))
21     subprocess.run(pmdinfogen + paths + [output], check=True)