Wait for apt instead of failing...

This commit is contained in:
Maniack Crudelis 2020-04-17 23:56:19 +02:00
parent ec9221d47c
commit 5ecb78e4e7

View file

@ -295,6 +295,18 @@ $(cat "$script_dir/sub_scripts/Build_lxc.log")"
# Count the number of lines of the current yunohost log file.
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.
rsync -rq --delete "$package_path" "$lxc_name": >> "$test_result" 2>&1