diff options
author | Daniel Baumann <daniel@debian.org> | 2008-10-28 16:44:06 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:03:43 +0100 |
commit | 1c1e7db6c44d639fd51ee23061087c7d14b6ef6b (patch) | |
tree | e20b0cfa3a45140a39be0cadf45410eab5cc22e7 /functions | |
parent | 6696b019fe03a371d69c50a1ef82223e4bb364a7 (diff) | |
download | live-build-1c1e7db6c44d639fd51ee23061087c7d14b6ef6b.zip live-build-1c1e7db6c44d639fd51ee23061087c7d14b6ef6b.tar.gz |
Generalizing internal Chroot(); by requiring its first argument to be the chroot directory.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/cache.sh | 2 | ||||
-rwxr-xr-x | functions/chroot.sh | 5 | ||||
-rwxr-xr-x | functions/packages.sh | 12 | ||||
-rwxr-xr-x | functions/wrapper.sh | 4 |
4 files changed, 12 insertions, 11 deletions
diff --git a/functions/cache.sh b/functions/cache.sh index 9e70f2c..9e92a94 100755 --- a/functions/cache.sh +++ b/functions/cache.sh @@ -37,7 +37,7 @@ Save_cache () if [ "${LH_CACHE}" = "enabled" ] && [ "${LH_CACHE_PACKAGES}" = "enabled" ] then # Cleaning current cache - Chroot "apt-get autoclean" + Chroot chroot "apt-get autoclean" if ls chroot/var/cache/apt/archives/*.deb > /dev/null 2>&1 then diff --git a/functions/chroot.sh b/functions/chroot.sh index 227f792..d665787 100755 --- a/functions/chroot.sh +++ b/functions/chroot.sh @@ -11,6 +11,7 @@ set -e Chroot () { + CHROOT="${1}"; shift COMMANDS="${@}" # Executing commands in chroot @@ -18,10 +19,10 @@ Chroot () if [ "${LH_USE_FAKEROOT}" != "enabled" ] then - ${LH_ROOT_COMMAND} chroot chroot /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTP_PROXY}" http_proxy="${LH_APT_HTTP_PROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" XORG_CONFIG="custom" ${COMMANDS} + ${LH_ROOT_COMMAND} chroot "${CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTP_PROXY}" http_proxy="${LH_APT_HTTP_PROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" XORG_CONFIG="custom" ${COMMANDS} else # Building with fakeroot/fakechroot - ${LH_ROOT_COMMAND} chroot chroot ${COMMANDS} + ${LH_ROOT_COMMAND} chroot "${CHROOT}" ${COMMANDS} fi return "${?}" diff --git a/functions/packages.sh b/functions/packages.sh index ed1bdc4..f1796ca 100755 --- a/functions/packages.sh +++ b/functions/packages.sh @@ -34,11 +34,11 @@ Install_package () then case "${LH_APT}" in apt|apt-get) - Chroot "apt-get install -o APT::Install-Recommends=false --yes ${_LH_PACKAGES}" + Chroot chroot "apt-get install -o APT::Install-Recommends=false --yes ${_LH_PACKAGES}" ;; aptitude) - Chroot "aptitude install --without-recommends --assume-yes ${_LH_PACKAGES}" + Chroot chroot "aptitude install --without-recommends --assume-yes ${_LH_PACKAGES}" ;; esac fi @@ -50,11 +50,11 @@ Remove_package () then case "${LH_APT}" in apt|apt-get) - Chroot "apt-get remove --purge --yes ${_LH_PACKAGES}" + Chroot chroot "apt-get remove --purge --yes ${_LH_PACKAGES}" ;; aptitude) - Chroot "aptitude purge --assume-yes ${_LH_PACKAGES}" + Chroot chroot "aptitude purge --assume-yes ${_LH_PACKAGES}" ;; esac fi @@ -72,7 +72,7 @@ Check_installed () case "${LH_CHROOT_BUILD}" in enabled) - if Chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install" + if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install" then INSTALL_STATUS=0 else @@ -82,7 +82,7 @@ Check_installed () disabled) if which dpkg-query > /dev/null 2>&1 then - if Chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install" + if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install" then INSTALL_STATUS=0 else diff --git a/functions/wrapper.sh b/functions/wrapper.sh index 6a71e81..ee013dd 100755 --- a/functions/wrapper.sh +++ b/functions/wrapper.sh @@ -13,11 +13,11 @@ Apt () { case "${LH_APT}" in apt|apt-get) - Chroot apt-get ${APT_OPTIONS} ${@} + Chroot chroot apt-get ${APT_OPTIONS} ${@} ;; aptitude) - Chroot aptitude ${APTITUDE_OPTIONS} ${@} + Chroot chroot aptitude ${APTITUDE_OPTIONS} ${@} ;; esac } |