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")