[packages/rpm-build-tools] builder: add mechanism for whitelisting git env vars passed to rpmbuild
atler
atler at pld-linux.org
Sat Jul 6 15:21:56 CEST 2024
commit 88ae8315eb37d7695f65456c9091bdc3fd6faa69
Author: Jan Palus <atler at pld-linux.org>
Date: Sat Jul 6 14:32:59 2024 +0200
builder: add mechanism for whitelisting git env vars passed to rpmbuild
GIT_ENV_WHITELIST contains list of git env var names not triggering
error condition. introduced primarily for passing through
GIT_CEILING_DIRECTORIES
builder.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/builder.sh b/builder.sh
index c83990c..5134c13 100755
--- a/builder.sh
+++ b/builder.sh
@@ -1706,7 +1706,7 @@ build_package() {
# may be set by user
unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_TESTING_PORCELAIN_COMMAND_LIST GIT_EDITOR
# fail if something still set
- env | grep ^GIT_ && Exit_error err_build_fail "One of GIT_* env variables is still set. The builder script needs to be updated to unset that variable. In the meantime, unset it manually."
+ env | grep -vE "^($(echo GIT_ENV_WHITELIST $GIT_ENV_WHITELIST | tr ' ' '|'))=" | grep ^GIT_ && Exit_error err_build_fail "One of GIT_* env variables is still set. The builder script needs to be updated to unset that variable. In the meantime, unset it manually."
local specdir=$(insert_gitlog $SPECFILE)
ulimit -c unlimited
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/88ae8315eb37d7695f65456c9091bdc3fd6faa69
More information about the pld-cvs-commit
mailing list