X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=mk-deb-chroot;fp=mk-deb-chroot;h=bc54c98c41258cc0ca666562230aaf80b4737b78;hb=11b5a088785d5fa4dbd0a80dfc890124d300ea82;hp=d1347e790dd7c2eb84ea8fe0780ccd9cd235b82f;hpb=bae2009ffc5a3aa630990943abc825585f6927ae;p=dev-env-setup.git diff --git a/mk-deb-chroot b/mk-deb-chroot index d1347e7..bc54c98 100755 --- a/mk-deb-chroot +++ b/mk-deb-chroot @@ -42,7 +42,21 @@ fi # Install debootstrap and schroot if [ -e /etc/debian_version ]; then # Debian detected: use apt - apt install -y debootstrap schroot + REQUIRED_PKG="debootstrap" + PKG_OK=$(dpkg-query -W --showformat='${Status}\n'\ + $REQUIRED_PKG|grep "install ok installed") + echo Checking for $REQUIRED_PKG: $PKG_OK + if [ "" = "$PKG_OK" ]; then + apt install -y debootstrap + fi + + REQUIRED_PKG="schroot" + PKG_OK=$(dpkg-query -W --showformat='${Status}\n'\ + $REQUIRED_PKG|grep "install ok installed") + echo Checking for $REQUIRED_PKG: $PKG_OK + if [ "" = "$PKG_OK" ]; then + apt install -y schroot + fi elif [ -e /etc/arch-release ]; then # Arch Linux detected: use pacman pacman -S --needed debootstrap schroot