diff options
author | Guido Günther <agx@sigxcpu.org> | 2022-08-03 19:31:10 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2022-08-03 19:36:43 +0200 |
commit | 37cd681d55e03c205b0ad173d15c15cead045d86 (patch) | |
tree | c13d9ce001c9c91016399c7ca9c1488785c53045 | |
parent | f76f2004bb6cfab3133925d7bf970e785f053572 (diff) |
git-pbuilder: export GBP_{DIST,ARCH,BUILDER} to the environment
This makes sure we don't export very generic vars while still being able
to make decisions based on what was passed to gbp.
-rwxr-xr-x | bin/git-pbuilder | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/git-pbuilder b/bin/git-pbuilder index 9161b4f2..545ed8d3 100755 --- a/bin/git-pbuilder +++ b/bin/git-pbuilder @@ -39,7 +39,12 @@ shell_quote () { # unset variables we inherited from the environment ourselfes # Names like DIST are very generic and can trip up other build systems -unset_env() { +# so unset these and set some prefixed ones instead so they can e.g. +# be used in .pbuilderrc. +update_env() { + [ -z "$DIST" -o -n "$GBP_DIST" ] || export GBP_DIST=$DIST + [ -z "$BUILDER" -o -n "$GBP_BUILDER" ] || export GBP_BUILDER=$BUILDER + [ -z "$ARCH" -o -n "$GBP_ARCH" ] || export GBP_ARCH=$ARCH export -n DIST BUILDER ARCH } @@ -351,7 +356,7 @@ done # Now we can finally run pdebuild. The quoting here is tricky, but this # seems to pass everything through properly. -unset_env +update_env if [ no = "$GIT_PBUILDER_AUTOCONF" ] ; then set -e [ ! "$GIT_PBUILDER_DEBUG" ] || set -x |