Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct check for alpine when setting up GNUPGHOME #3651

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,19 @@ 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)"
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
Expand Down
Loading