summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:16 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:26 +0100
commitc68c0a270832ca340429878ce6a0ab606d435b06 (patch)
tree8f9a4286b138ca2768a724594ad4219bf30f6167 /functions
parentf314791fa2fa3e6a557ca50ecb4a0cf7798fee79 (diff)
downloadlive-build-c68c0a270832ca340429878ce6a0ab606d435b06.zip
live-build-c68c0a270832ca340429878ce6a0ab606d435b06.tar.gz
Adding live-helper 1.0~a21-1.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/chroot.sh2
-rwxr-xr-xfunctions/common.sh2
-rwxr-xr-xfunctions/packages.sh (renamed from functions/package.sh)34
-rwxr-xr-xfunctions/packageslists.sh (renamed from functions/packagelist.sh)0
-rwxr-xr-xfunctions/stagefile.sh7
5 files changed, 30 insertions, 15 deletions
diff --git a/functions/chroot.sh b/functions/chroot.sh
index 4b9e850..12c49b6 100755
--- a/functions/chroot.sh
+++ b/functions/chroot.sh
@@ -15,7 +15,7 @@ Chroot ()
# Executing commands in chroot
Echo_debug "Executing: ${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_FTPPROXY}" http_proxy="${LH_APT_HTTPPROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" ${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_FTPPROXY}" http_proxy="${LH_APT_HTTPPROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" XORG_CONFIG="custom" ${COMMANDS}
return "${?}"
}
diff --git a/functions/common.sh b/functions/common.sh
index d9d63a7..19abcbb 100755
--- a/functions/common.sh
+++ b/functions/common.sh
@@ -10,4 +10,4 @@
set -e
PROGRAM="`basename ${0}`"
-VERSION="1.0~a20"
+VERSION="1.0~a21"
diff --git a/functions/package.sh b/functions/packages.sh
index 96316dc..049c89b 100755
--- a/functions/package.sh
+++ b/functions/packages.sh
@@ -11,24 +11,38 @@ set -e
Check_package ()
{
- ITEM="${1}"
+ FILE="${1}"
PACKAGE="${2}"
case "${LIVE_CHROOT_BUILD}" in
enabled)
- if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
- then
- PACKAGES="${PACKAGES} ${PACKAGE}"
- fi
+ for ITEM in ${PACKAGE}
+ do
+ if ! `Chroot "dpkg-query -s ${ITEM}"`
+ then
+ PACKAGES="${PACKAGES} ${ITEM}"
+ fi
+ done
;;
disabled)
- ITEM="`echo ${ITEM} | sed -e 's/chroot//'`"
-
- if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
+ if `which dpkg-query`
then
- Echo_error "You need to install ${PACKAGE} on your host system."
- exit 1
+ for ITEM in ${PACKAGE}
+ do
+ if ! `dpkg-query -s ${ITEM}`
+ then
+ PACKAGES="${PACKAGES} ${ITEM}"
+ fi
+ done
+ else
+ FILE="`echo ${FILE} | sed -e 's/chroot//'`"
+
+ if [ ! -f "${FILE}" ] && [ ! -d "${FILE}" ]
+ then
+ Echo_error "You need to install ${PACKAGE} on your host system."
+ exit 1
+ fi
fi
;;
esac
diff --git a/functions/packagelist.sh b/functions/packageslists.sh
index f25b5fb..f25b5fb 100755
--- a/functions/packagelist.sh
+++ b/functions/packageslists.sh
diff --git a/functions/stagefile.sh b/functions/stagefile.sh
index 2606983..647b181 100755
--- a/functions/stagefile.sh
+++ b/functions/stagefile.sh
@@ -44,6 +44,7 @@ Create_stagefile ()
Require_stagefile ()
{
+ NAME="`basename ${0}`"
FILES="${@}"
NUMBER="`echo ${@} | wc -w`"
@@ -59,11 +60,11 @@ Require_stagefile ()
if [ "${CONTINUE}" != "true" ]
then
- if [ "${NUMBER}" -gt 1 ]
+ if [ "${NUMBER}" -eq 1 ]
then
- Echo_error "one of ${NAME} is missing"
- else
Echo_error "${NAME} missing"
+ else
+ Echo_error "one of ${NAME} is missing"
fi
exit 1