install_pkg_deb: Not updated every time the function is called. (#3385)

This commit is contained in:
The-going 2022-01-08 11:59:06 +03:00 committed by GitHub
parent 117633687e
commit 3083038855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1223,11 +1223,10 @@ install_pkg_deb ()
log_file="${SRC}/output/${LOG_SUBPATH}/install.log"
fi
apt-get -q update
if [ "$?" != "0" ]; then echo "apt cannot update" >>$log_file; fi
# This is necessary first when there is no apt cache.
if $need_upgrade; then
apt-get -y upgrade
if [ "$?" != "0" ]; then echo "apt cannot upgrade" >>$log_file; fi
apt-get -q update || echo "apt cannot update" >>$tmp_file
apt-get -y upgrade || echo "apt cannot upgrade" >>$tmp_file
fi
# If the package is not installed, check the latest
@ -1254,7 +1253,10 @@ install_pkg_deb ()
fi
if [ -n "$for_install" ]; then
if ! $need_upgrade; then
apt-get -q update
apt-get -y upgrade
fi
apt-get install -qq -y --no-install-recommends $for_install
echo -e "\nPackages installed:" >>$log_file
dpkg-query -W \
@ -1463,7 +1465,7 @@ prepare_host()
sudo echo "apt-cacher-ng apt-cacher-ng/tunnelenable boolean false" | sudo debconf-set-selections
LOG_OUTPUT_FILE="${DEST}"/${LOG_SUBPATH}/hostdeps.log
install_pkg_deb "upgrade $hostdeps"
install_pkg_deb "$hostdeps"
unset LOG_OUTPUT_FILE
update-ccache-symlinks