aboutsummaryrefslogtreecommitdiff
path: root/scripts/llvm.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/llvm.py')
-rw-r--r--scripts/llvm.py28
1 files changed, 10 insertions, 18 deletions
diff --git a/scripts/llvm.py b/scripts/llvm.py
index 13e5de6..829c720 100644
--- a/scripts/llvm.py
+++ b/scripts/llvm.py
@@ -20,24 +20,9 @@ def die(message, config_to_dump=None):
exit(1)
-def get_llvm_root():
- """Get the path to the LLVM root, which contains the repos as well as all
- the work environments."""
- return os.environ["LLVM_ROOT"]
-
-
def get_worktree_root(env):
- """
- Get the path to the LLVM worktree corresponding to env. The value will be
- based on the LLVM root.
- """
- return os.path.join(get_llvm_root(), env, "llvm")
-
-# Figure out the path to the LLVM repos
-if "LLVM_ROOT" not in os.environ:
- die("Please, define $LLVM_ROOT to point to the root\n"
- "path where the worktree setup should be performed")
-llvm_repos_root = os.path.join(get_llvm_root(), "repos")
+ """Get the path to the LLVM worktree corresponding to env."""
+ return os.path.join(env, "llvm")
def dump_config(config):
@@ -58,6 +43,7 @@ def projects(args):
proj = Proj()
llvm_worktree_root = get_worktree_root(args.env)
+ llvm_repos_root = args.repos
config = LLVMSourceConfig(proj, llvm_worktree_root)
if not args.add and not args.remove:
@@ -87,7 +73,13 @@ def projects(args):
valid_subprojects = list(LLVMSubproject.get_all_subprojects().keys())
options = ArgumentParser(formatter_class=RawTextHelpFormatter)
-options.add_argument('env', help="The environment to update.")
+options.add_argument(
+ '--env',
+ required=True,
+ help="Path to the environment to update.")
+options.add_argument(
+ '--repos', required=True,
+ help="Path to the directory containing the repositories for all LLVM subprojects.")
subcommands = options.add_subparsers()