Changing package dependency checks within chroot to work outside as well.

This commit is contained in:
Daniel Baumann 2015-01-04 18:08:09 +01:00
parent 691305c11e
commit fdc9250bca
21 changed files with 57 additions and 59 deletions

View File

@ -10,10 +10,11 @@
Check_package ()
{
FILE="${1}"
PACKAGE="${2}"
CHROOT="${1}"
FILE="${2}"
PACKAGE="${3}"
Check_installed "${FILE}" "${PACKAGE}"
Check_installed "${CHROOT}" "${FILE}" "${PACKAGE}"
case "${INSTALL_STATUS}" in
1)
@ -66,19 +67,19 @@ Remove_package ()
# 2 if package isn't installed and we aren't in an apt managed system
Check_installed ()
{
FILE="${1}"
PACKAGE="${2}"
CHROOT="${1}"
FILE="${2}"
PACKAGE="${3}"
case "${LB_BUILD_WITH_CHROOT}" in
true)
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] && [ "${CHROOT}" = "chroot" ]
then
if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
then
INSTALL_STATUS=0
else
INSTALL_STATUS=1
fi
;;
false)
else
if which dpkg-query > /dev/null 2>&1
then
if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
@ -88,8 +89,6 @@ Check_installed ()
INSTALL_STATUS=1
fi
else
FILE="$(echo ${FILE} | sed -e 's|chroot||')"
if [ ! -e "${FILE}" ]
then
INSTALL_STATUS=2
@ -97,7 +96,6 @@ Check_installed ()
INSTALL_STATUS=0
fi
fi
;;
esac
fi
}

BIN
scripts/build/.grep.swp Normal file

Binary file not shown.

View File

@ -37,7 +37,7 @@ Check_crossarchitectures
Echo_message "Begin bootstrapping system..."
Check_package /usr/sbin/debootstrap debootstrap
Check_package chroot bin/debootstrap debootstrap
# Checking stage file
Check_stagefile .build/bootstrap