numam-dpdk/buildtools/list-dir-globs.py
Bruce Richardson ab9407c3ad build: allow using wildcards to disable drivers
Rather than having to explicitly list each and every driver to disable in a
build, we can use a small python script and the python glob library to
expand out the wildcards. This means that we can configure meson using e.g.

    meson -Ddisable_drivers=crypto/*,event/* build

to do a build omitting all the crypto and event drivers. Explicitly
specified drivers e.g. net/i40e, work as before, and can be mixed with
wildcarded drivers as required.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2020-02-06 09:17:24 +01:00

20 lines
523 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(','):
for p in iglob(os.path.join(root, path)):
if os.path.isdir(p):
print(os.path.relpath(p))