mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Wait for apt instead of failing...
This commit is contained in:
parent
ec9221d47c
commit
5ecb78e4e7
1 changed files with 12 additions and 0 deletions
|
@ -295,6 +295,18 @@ $(cat "$script_dir/sub_scripts/Build_lxc.log")"
|
||||||
# Count the number of lines of the current yunohost log file.
|
# Count the number of lines of the current yunohost log file.
|
||||||
COPY_LOG 1
|
COPY_LOG 1
|
||||||
|
|
||||||
|
# Wait for apt to be available before the test.
|
||||||
|
for try in `seq 1 17`
|
||||||
|
do
|
||||||
|
# Check if /var/lib/dpkg/lock is used by another process
|
||||||
|
if sudo lxc-attach -n $lxc_name -- lsof /var/lib/dpkg/lock > /dev/null
|
||||||
|
then
|
||||||
|
echo "apt is already in use..."
|
||||||
|
# Sleep an exponential time at each round
|
||||||
|
sleep $(( try * try ))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Copy the package into the container.
|
# Copy the package into the container.
|
||||||
rsync -rq --delete "$package_path" "$lxc_name": >> "$test_result" 2>&1
|
rsync -rq --delete "$package_path" "$lxc_name": >> "$test_result" 2>&1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue