Skip to content
Snippets Groups Projects
Commit 1051f7d3 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

chore: add update-build-cache as a (non-default) stage

(Keep old option for now…)

Change-Id: I65725572f3171f28e29673e26d22f45909a6e001
parent 34a5db69
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import argparse
import copy
import os
import pathlib
import subprocess
......@@ -51,7 +52,9 @@ parser = argparse.ArgumentParser(
to OUTPUT.
"""))
all_stages=set(["fetch", "build-base-image", "build-base", "build-spack", "image"])
all_stages=["fetch", "build-base-image", "build-base", "build-spack", "image", "update-build-cache"]
default_stages = copy.copy(all_stages)
default_stages.remove("update-build-cache")
all_styles = list(os.listdir(os.path.dirname(os.path.realpath(__file__)) + "/../share/yashchiki/styles/"))
......@@ -72,7 +75,7 @@ parser.add_argument(
"--update-build-cache", action="store_true",
help="Update build cache.")
parser.add_argument(
"--stages", type=str, nargs="+", choices=all_stages, default=all_stages,
"--stages", type=str, nargs="+", choices=all_stages, default=default_stages,
help="Stages of build to perform.")
# optional with persistent default
parser.add_argument(
......@@ -351,7 +354,8 @@ run(str(pathlib.Path("share", "yashchiki", "styles", args.style,
env)
run("lib/yashchiki/build_sandbox.sh", env)
run("lib/yashchiki/build_image.sh", env)
if args.update_build_cache:
if args.update_build_cache or "update-build-cache" in args.stages:
run("lib/yashchiki/update_build_cache.sh", env, ["-c", args.output])
if args.tmpdir is None:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment