Skip to content
Snippets Groups Projects
Commit 2c1c0d7f authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

setup-poulpe-den: add the ability to select suites you want to install

parent 204b5dab
No related branches found
No related tags found
No related merge requests found
......@@ -6,5 +6,5 @@
import subprocess
import glob
from pathlib import Path
from typing import List
......@@ -10,5 +10,6 @@
USAGE = "USAGE: %s ROOTPATH" % os.path.basename(sys.argv[0])
import click
POULPE_DIR = Path(__file__).resolve().parent.parent
......@@ -164,7 +165,16 @@
subprocess.run(command, check=True, env=environ)
def setup_base_dir(path):
@click.command(no_args_is_help=True)
@click.argument("path")
@click.option(
"--suite",
"-s",
"suites",
multiple=True,
help="Suites to set up, defaults to all",
)
def setup_base_dir(path: str, suites: List[str]):
base_path = Path(path).resolve()
print("Creating folders")
base_path.mkdir(parents=True, exist_ok=True)
......@@ -197,7 +207,10 @@
print("Cloning repositories to benchmark")
repos = base_path / REPOSITORIES_DIR
for listing in glob.glob(str(base_path / 'suites' / '*' / 'repositories')):
suite_name = Path(listing).parent.parent.name
suite_name = Path(listing).parent.name
if suites and suite_name not in suites:
print(f"Skipping suite {suite_name} as requested")
continue
with open(listing) as f:
for line in f:
line = line.strip()
......@@ -224,9 +237,4 @@
if __name__ == "__main__":
if len(sys.argv) != 2 or sys.argv[1].startswith('-'):
print(USAGE, file=sys.stderr)
sys.exit(128)
else:
ret = setup_base_dir(sys.argv[1])
sys.exit(ret)
setup_base_dir()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment