summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/common.sh2
-rwxr-xr-xfunctions/defaults.sh3
-rwxr-xr-xfunctions/package.sh28
-rwxr-xr-xfunctions/templates.sh25
4 files changed, 39 insertions, 19 deletions
diff --git a/functions/common.sh b/functions/common.sh
index 8c1bca5..24212c4 100755
--- a/functions/common.sh
+++ b/functions/common.sh
@@ -10,4 +10,4 @@
set -e
PROGRAM="`basename ${0}`"
-VERSION="1.0~a18"
+VERSION="1.0~a19"
diff --git a/functions/defaults.sh b/functions/defaults.sh
index a5b9e73..098a87f 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -584,6 +584,9 @@ Set_defaults ()
esac
fi
+ # Setting chroot option
+ LIVE_CHROOT_BUILD="${LIVE_CHROOT_BUILD:-enabled}"
+
# Setting debian-installer option
LIVE_DEBIAN_INSTALLER="${LIVE_DEBIAN_INSTALLER:-disabled}"
diff --git a/functions/package.sh b/functions/package.sh
index 3d11873..96316dc 100755
--- a/functions/package.sh
+++ b/functions/package.sh
@@ -11,18 +11,32 @@ set -e
Check_package ()
{
- FILE="${1}"
+ ITEM="${1}"
PACKAGE="${2}"
- if [ ! -f "${FILE}" ]
- then
- PACKAGES="${PACKAGES} ${PACKAGE}"
- fi
+ case "${LIVE_CHROOT_BUILD}" in
+ enabled)
+ if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
+ then
+ PACKAGES="${PACKAGES} ${PACKAGE}"
+ fi
+ ;;
+
+ disabled)
+ ITEM="`echo ${ITEM} | sed -e 's/chroot//'`"
+
+ if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
+ then
+ Echo_error "You need to install ${PACKAGE} on your host system."
+ exit 1
+ fi
+ ;;
+ esac
}
Install_package ()
{
- if [ -n "${PACKAGES}" ]
+ if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
then
case "${LH_APT}" in
apt|apt-get)
@@ -38,7 +52,7 @@ Install_package ()
Remove_package ()
{
- if [ -n "${PACKAGES}" ]
+ if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
then
case "${LH_APT}" in
apt|apt-get)
diff --git a/functions/templates.sh b/functions/templates.sh
index 9fbc365..6b60c9e 100755
--- a/functions/templates.sh
+++ b/functions/templates.sh
@@ -11,22 +11,25 @@ set -e
Check_templates ()
{
- PROGRAM="${1}"
+ ITEM="${1}"
- # Check local templates
- if [ -d config/templates/"${PROGRAM}" ]
+ # Check user defined templates directory
+ if [ ! -d "${LIVE_TEMPLATES}" ]
then
- LIVE_TEMPLATES="config/templates"
+ if [ -d config/templates ]
+ then
+ LIVE_TEMPLATES=config/templates
+ else
+ Echo_error "templates not accessible in ${LIVE_TEMPLATES} nor config/templates"
+ exit 1
+ fi
fi
- # Checking user templates
- if [ ! -d "${LIVE_TEMPLATES}" ]
- then
- Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
- exit 1
- elif [ ! -d "${LIVE_TEMPLATES}/${PROGRAM}" ]
+ if [ -d "${LIVE_TEMPLATES}/${ITEM}" ]
then
- Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}"
+ TEMPLATES="${LIVE_TEMPLATES}/${ITEM}"
+ else
+ Echo_error "${ITEM} templates not accessible in ${LIVE_TEMPLATES}"
exit 1
fi
}