From 5764e60f0ec793393593f3a99387631da3f2c3d0 Mon Sep 17 00:00:00 2001 From: layman Date: Tue, 24 Jan 2023 17:05:35 +0100 Subject: [PATCH] add locking to gentooup.sh --- gentooup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gentooup.sh b/gentooup.sh index 2f56f69..8a05709 100755 --- a/gentooup.sh +++ b/gentooup.sh @@ -1,7 +1,13 @@ #!/bin/bash +LOCKFILE=/usr/portage/gentooup.lock +exec {FD_LOCK}<>"$LOCKFILE" +if ! flock -x -w 60 "$FD_LOCK" ; then + echo "Could not acquire lock for $LOCKFILE" + exit 1 +fi -PORTAGE_OPTIONS=("--keep-going" "--autounmask-write" "--binpkg-respect-use=y" "--binpkg-changed-deps=y" "--autounmask-continue") +PORTAGE_OPTIONS=("--keep-going" "--autounmask-write" "--binpkg-changed-deps=y" "--autounmask-continue") PORTAGE_UPGRADE_OPTIONS=("-vuNDk")