diff options
author | Diana Picus <diana.picus@linaro.org> | 2017-05-05 22:26:49 +0200 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2017-05-12 12:41:30 +0200 |
commit | 81089dbdf90268900305b3dd0cb5997879fd7c1f (patch) | |
tree | 61d9c9fd02880f844d80d0ea62c1aff9f5652015 /helpers | |
parent | 3d1a30130a581e68afdbc027c82c5b1cd662ea6e (diff) |
Separate the repos from the environments
Before this patch, we had an LLVM_ROOT directory which contained the
repos and a series of environments (worktrees + build dicretories).
However, there is no good reason to have such a rigid layout, and in
fact it prevents us from sharing the repos in any meaningful way.
This patch removes LLVM_ROOT and instead introduces two command line
parameters, repos and env, which represent the path to the directory
containing the LLVM repositories and respectively the path to the
environment that we intend to modify. The two paths may be completely
independent. A side effect of this is that we can now also have
different environments in different, unrelated locations (whereas
previously they had to be siblings in LLVM_ROOT).
For the time being, both parameters are compulsory (not only for
llvm-projects, but for all subcommands). There may be situations where
we can get away with only one of them (e.g. `llvm-projs <env>`, which
just lists the projects enabled in the given <env> - it does not need to
know where the repos are in order to do this). There may also be
situations where one of them doesn't make any sense at all (e.g.
`llvm-prepare`, which is not implemented yet in python, only needs the
path to the repos and it would not know what to do with an environment).
Making them optional would require some additional validation logic as
well as more tests, and it feels a bit early on to introduce all that.
It would be nice to have at least one or 2 more subcommands implemented
before we invest time in it.
Change-Id: Ibc1321d18476c2c4a65b5b05ca3fce3467d72fc3
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/llvm-projs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/helpers/llvm-projs b/helpers/llvm-projs index ae8ac22..bbcaf0a 100755 --- a/helpers/llvm-projs +++ b/helpers/llvm-projs @@ -46,13 +46,14 @@ llvmtool=$progdir/../scripts/llvm.py # Grab the environment name from $LLVM_SRC . llvm-common verify_env -env=$(basename $(dirname $LLVM_SRC)) +repos=$LLVM_ROOT/repos +env=$(dirname $LLVM_SRC) # No args, list if [ "$1" = "" ]; then echo "Use $prog -h for options" echo - safe_run python3 $llvmtool $env projects + safe_run python3 $llvmtool --repos $repos --env $env projects exit fi @@ -102,7 +103,7 @@ case $opt in shift ;; list) - python $llvmtool projects + safe_run python3 $llvmtool --repos $repos --env $env projects exit ;; -h) @@ -200,7 +201,6 @@ update "libcxxabi" $libcxxabi update "libcxx" $libcxx update "compiler-rt" $rt update "clang" $clang -update "clang-tools-extra" $clang_extra if [ "$add" != "" ]; then add="-a $add" @@ -210,4 +210,4 @@ if [ "$remove" != "" ]; then remove="-r $remove" fi -safe_run python3 $llvmtool $env projects $add $remove +safe_run python3 $llvmtool --repos $repos --env $env projects $add $remove |