numam-dpdk/buildtools/list-dir-globs.py
Dmitry Kozlyuk 74299cc759 buildtools: fix all drivers disabled on Windows
buildtools/list-dir-globs.py printed paths with OS directory separator,
which is "/" on Unices and "\" on Windows, while Meson code always
expected "/". This resulted in all drivers being disabled on Windows.

Replace "\" with "/" in script output. Forward slash is a valid,
although non-default, separator on Windows, so no paths can be broken
by this substitution.

Fixes: ab9407c3ad ("build: allow using wildcards to disable drivers")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-04-17 12:49:23 +02:00

21 lines
567 B
Python
Executable File

#! /usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2020 Intel Corporation
import sys
import os
from glob import iglob
if len(sys.argv) != 2:
print("Usage: {0} <path-glob>[,<path-glob>[,...]]".format(sys.argv[0]))
sys.exit(1)
root = os.path.join(os.getenv('MESON_SOURCE_ROOT', '.'),
os.getenv('MESON_SUBDIR', '.'))
for path in sys.argv[1].split(','):
if path:
for p in iglob(os.path.join(root, path)):
if os.path.isdir(p):
print(os.path.relpath(p).replace('\\', '/'))