move LOCKFILE to local subdir as this one does not get synced

This commit is contained in:
layman 2023-01-26 07:38:28 +01:00
parent 9809bcf031
commit 4abac29b41

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
LOCKFILE=/usr/portage/gentooup.lock LOCKFILE=/usr/portage/local/gentooup.lock
PORTAGE_OPTIONS=("--keep-going" "--autounmask-write" "--binpkg-respect-use=y" "--autounmask-continue") PORTAGE_OPTIONS=("--keep-going" "--autounmask-write" "--binpkg-respect-use=y" "--autounmask-continue")
PORTAGE_UPGRADE_OPTIONS=("-vuNDk") PORTAGE_UPGRADE_OPTIONS=("-vuNDk")
@ -90,6 +91,7 @@ myemerge() {
} }
if [[ -z "$NO_LOCK" ]] ; then if [[ -z "$NO_LOCK" ]] ; then
mkdir -p $(dirname "$LOCKFILE")
exec {FD_LOCK}<>"$LOCKFILE" exec {FD_LOCK}<>"$LOCKFILE"
echo "Try to acquire lock for $LOCKFILE" echo "Try to acquire lock for $LOCKFILE"
if ! flock -x -w 60 "$FD_LOCK" ; then if ! flock -x -w 60 "$FD_LOCK" ; then