From e93752ed1b6385a4a8d0ec318f6bec6810f9c04f Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Thu, 15 Feb 2024 12:47:31 +0000 Subject: [PATCH 1/2] Check for Alpine linux in prepareWorkspace.sh not assuming running in build farm Signed-off-by: Andrew Leonard --- sbin/prepareWorkspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 6a8aa79d7..2d02fd4c0 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -320,7 +320,7 @@ checkingAndDownloadingAlsa() { curl -o "alsa-lib.tar.bz2.sig" "https://www.alsa-project.org/files/pub/lib/alsa-lib-${ALSA_LIB_VERSION}.tar.bz2.sig" ## This affects Alpine docker images and also evaluation pipelines - if [ "$OPERATING_SYSTEM" == "alpine-linux" ] && [ "$(pwd | wc -c)" -gt 83 ]; then + if [ -r /etc/alpine-release ] && [ "$(pwd | wc -c)" -gt 83 ]; then # Use /tmp for alpine in preference to $HOME as Alpine fails gpg operation if PWD > 83 characters # Alpine also cannot create ~/.gpg-temp within a docker context GNUPGHOME="$(mktemp -d /tmp/.gpg-temp.XXXXXX)" From b8d2bef1e606851e2d121d29c60510aa35c0f498 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Thu, 15 Feb 2024 12:57:03 +0000 Subject: [PATCH 2/2] Check for Alpine linux in prepareWorkspace.sh not assuming running in build farm Signed-off-by: Andrew Leonard --- sbin/prepareWorkspace.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 2d02fd4c0..0f7e736cb 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -324,10 +324,15 @@ checkingAndDownloadingAlsa() { # Use /tmp for alpine in preference to $HOME as Alpine fails gpg operation if PWD > 83 characters # Alpine also cannot create ~/.gpg-temp within a docker context GNUPGHOME="$(mktemp -d /tmp/.gpg-temp.XXXXXX)" + else + GNUPGHOME="${BUILD_CONFIG[WORKSPACE_DIR]:-$PWD}/.gpg-temp" + fi + if [ ! -d "$GNUPGHOME" ]; then + mkdir -m 700 "$GNUPGHOME" fi + export GNUPGHOME echo "GNUPGHOME=$GNUPGHOME" - mkdir -p "$GNUPGHOME" && chmod og-rwx "$GNUPGHOME" # Should we clear this directory up after checking? # Would this risk removing anyone's existing dir with that name? # Erring on the side of caution for now