Skip to content

Commit

Permalink
api: revert use of apt-get on lock check
Browse files Browse the repository at this point in the history
modern `apt` has integrated lock waiting and this improves the `apt_lock_wait` function. `apt-get` does not implement that functionality and immediately returns similar to how old `apt` worked.

continue using `apt` and monitor apt 3.0 for any string output changes
  • Loading branch information
theofficialgman committed Aug 15, 2024
1 parent 680491c commit 957bb03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ apt_lock_wait() { #Wait until other apt processes are finished before proceeding
done

#Try to install a non-existent package to see if apt fails due to a lock-file. Repeat until no errors mention 'Could not get lock'
while sudo -E apt-get install lkqecjhxwqekc 2>&1 | grep -q 'Could not get lock' ;do
#NOTE: after apt 3.0 this output may change. Refer to git blame for this line for more info.
while sudo -E apt install lkqecjhxwqekc 2>&1 | grep -q 'Could not get lock' ;do
sleep 1
done

Expand Down

0 comments on commit 957bb03

Please sign in to comment.