Update apt package lists during bootstrap

This commit is contained in:
2021-10-02 12:28:37 +02:00
parent c737c3a0f4
commit 4f0f775a5d

View File

@@ -47,9 +47,14 @@ sudowrap() {
fi
}
cache_updated=0
_install() {
_package="$1" ; shift
if [[ $NAME == "Ubuntu" ]] ; then
if ! (( cache_updated )) ; then
apt-get update
cache_updated=1
fi
sudowrap apt-get install --assume-yes "${_package}"
elif [[ $NAME == "Arch Linux" ]] ; then
sudowrap pacman -S --noconfirm "${_package}"