Skip to content

Commit

Permalink
xx-apk: fix problem with writing lock in latest alpine
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Dec 9, 2024
1 parent b0cde9e commit 1542147
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xx-apk
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
set -e

if [ -z "$XX_APK_NOLOCK" ]; then
# readlink -f in ash can not resolve symlinks from deep workdir
cd /
if [ -L /var/lock ] && [ ! -e "$(readlink -f /var/lock)" ]; then
mkdir -p "$(readlink -f /var/lock)"
elif [ ! -d /var/lock ]; then
mkdir -p /var/lock
fi
cd -
lock="/var/lock/xx-apk"
exec 9>$lock
flock -x 9
Expand Down

0 comments on commit 1542147

Please sign in to comment.