On 30/01/2021 00.18, Eli Schwartz wrote:
On 1/7/20 2:51 AM, Matti Niemenmaa wrote:
diff --git a/scripts/libmakepkg/buildenv/compiler.sh.in 
b/scripts/libmakepkg/buildenv/compiler.sh.in
index 69f58a29..c93c77b4 100644
--- a/scripts/libmakepkg/buildenv/compiler.sh.in
+++ b/scripts/libmakepkg/buildenv/compiler.sh.in
@@ -44,7 +44,9 @@ buildenv_ccache() {
  buildenv_distcc() {
        if check_buildoption "distcc" "y"; then
                if (( using_ccache )); then
-                       export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX 
}distcc"
+                       if ! [[ "$CCACHE_PREFIX" =~ (^| )distcc($| ) ]]; then

Regex here feels a bit overkill, I'm wondering if maybe it would be a
better idea to do:

[[ " $CCACHE_PREFIX " = *' distcc '* ]]

(Spaces assume that we think there is a valid use case for idk,
CCACHE_PREFIX=/usr/bin/notdistcc-foo and therefore want to match a word,
specifically.)

Yeah, that works equally well. At the moment the regex solution still feels clearer to me but I'm not attached to it — posted a v2.

Reply via email to