summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2009-12-13 21:17:45 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:17:03 +0100
commit701b5affd403d9a25df311fc422dd33eb4526c34 (patch)
tree7e7cc9f57ceb0d3700ee13541944efb044ae9d60 /functions
parent32930b4a6a14374d2895a4e9247fdc192a91124b (diff)
downloadvyos-live-build-701b5affd403d9a25df311fc422dd33eb4526c34.tar.gz
vyos-live-build-701b5affd403d9a25df311fc422dd33eb4526c34.zip
For consistency, using true|false instead of enabled|disabled in configuration options.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/arguments.sh10
-rwxr-xr-xfunctions/breakpoints.sh2
-rwxr-xr-xfunctions/cache.sh4
-rwxr-xr-xfunctions/chroot.sh2
-rwxr-xr-xfunctions/defaults.sh86
-rwxr-xr-xfunctions/echo.sh12
-rwxr-xr-xfunctions/exit.sh2
-rwxr-xr-xfunctions/packages.sh8
-rwxr-xr-xfunctions/stagefile.sh2
9 files changed, 64 insertions, 64 deletions
diff --git a/functions/arguments.sh b/functions/arguments.sh
index bbc439c84..e65983a85 100755
--- a/functions/arguments.sh
+++ b/functions/arguments.sh
@@ -23,7 +23,7 @@ Arguments ()
do
case "${1}" in
--breakpoints)
- _BREAKPOINTS="enabled"
+ _BREAKPOINTS="true"
shift
;;
@@ -33,12 +33,12 @@ Arguments ()
;;
--debug)
- _DEBUG="enabled"
+ _DEBUG="true"
shift
;;
--force)
- _FORCE="enabled"
+ _FORCE="true"
shift
;;
@@ -48,7 +48,7 @@ Arguments ()
;;
--quiet)
- _QUIET="enabled"
+ _QUIET="true"
shift
;;
@@ -58,7 +58,7 @@ Arguments ()
;;
--verbose)
- _VERBOSE="enabled"
+ _VERBOSE="true"
shift
;;
diff --git a/functions/breakpoints.sh b/functions/breakpoints.sh
index 2f078e15f..0b47a6d64 100755
--- a/functions/breakpoints.sh
+++ b/functions/breakpoints.sh
@@ -11,7 +11,7 @@ Breakpoint ()
{
NAME="${1}"
- if [ "${_BREAKPOINTS}" = "enabled" ]
+ if [ "${_BREAKPOINTS}" = "true" ]
then
Echo_message "Waiting at %s" "${NAME}"
read WAIT
diff --git a/functions/cache.sh b/functions/cache.sh
index ca5e5ed0e..69f05c916 100755
--- a/functions/cache.sh
+++ b/functions/cache.sh
@@ -11,7 +11,7 @@ Restore_cache ()
{
DIRECTORY="${1}"
- if [ "${LH_CACHE}" = "enabled" ] && [ "${LH_CACHE_PACKAGES}" = "enabled" ]
+ if [ "${LH_CACHE}" = "true" ] && [ "${LH_CACHE_PACKAGES}" = "true" ]
then
if [ -d "${DIRECTORY}" ]
then
@@ -32,7 +32,7 @@ Save_cache ()
{
DIRECTORY="${1}"
- if [ "${LH_CACHE}" = "enabled" ] && [ "${LH_CACHE_PACKAGES}" = "enabled" ]
+ if [ "${LH_CACHE}" = "true" ] && [ "${LH_CACHE_PACKAGES}" = "true" ]
then
# Cleaning current cache
Chroot chroot "apt-get autoclean"
diff --git a/functions/chroot.sh b/functions/chroot.sh
index 420abe18a..e3af0c225 100755
--- a/functions/chroot.sh
+++ b/functions/chroot.sh
@@ -15,7 +15,7 @@ Chroot ()
# Executing commands in chroot
Echo_debug "Executing: %s" "${COMMANDS}"
- if [ "${LH_USE_FAKEROOT}" != "enabled" ]
+ if [ "${LH_USE_FAKEROOT}" != "true" ]
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}
else
diff --git a/functions/defaults.sh b/functions/defaults.sh
index a2b3b7aef..7275293f9 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -63,7 +63,7 @@ Set_defaults ()
fi
# Setting apt pdiffs
- LH_APT_PDIFFS="${LH_APT_PDIFFS:-enabled}"
+ LH_APT_PDIFFS="${LH_APT_PDIFFS:-true}"
# Setting apt pipeline
# LH_APT_PIPELINE
@@ -84,16 +84,16 @@ Set_defaults ()
# Setting apt recommends
case "${LH_MODE}" in
debian|debian-release|ubuntu)
- LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS:-enabled}"
+ LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS:-true}"
;;
emdebian)
- LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS:-disabled}"
+ LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS:-false}"
;;
esac
# Setting apt secure
- LH_APT_SECURE="${LH_APT_SECURE:-enabled}"
+ LH_APT_SECURE="${LH_APT_SECURE:-true}"
# Setting bootstrap program
if [ -z "${LH_BOOTSTRAP}" ] || ( [ ! -x "$(which ${LH_BOOTSTRAP} 2>/dev/null)" ] && [ "${LH_BOOTSTRAP}" != "copy" ] )
@@ -111,9 +111,9 @@ Set_defaults ()
fi
# Setting cache option
- LH_CACHE="${LH_CACHE:-enabled}"
- LH_CACHE_INDICES="${LH_CACHE_INDICES:-disabled}"
- LH_CACHE_PACKAGES="${LH_CACHE_PACKAGES:-enabled}"
+ LH_CACHE="${LH_CACHE:-true}"
+ LH_CACHE_INDICES="${LH_CACHE_INDICES:-false}"
+ LH_CACHE_PACKAGES="${LH_CACHE_PACKAGES:-true}"
LH_CACHE_STAGES="${LH_CACHE_STAGES:-bootstrap}"
# Setting debconf frontend
@@ -122,11 +122,11 @@ Set_defaults ()
LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY:-critical}"
case "${LH_DEBCONF_NOWARNINGS}" in
- enabled)
+ true)
LH_DEBCONF_NOWARNINGS="yes"
;;
- disabled)
+ false)
LH_DEBCONF_NOWARNINGS="no"
;;
esac
@@ -189,7 +189,7 @@ Set_defaults ()
else
if [ -x /usr/bin/sudo ]
then
- # FIXME: this is disabled until considered safe
+ # FIXME: this is false until considered safe
#LH_ROOT_COMMAND="sudo"
LH_ROOT_COMMAND=""
fi
@@ -229,12 +229,12 @@ Set_defaults ()
fi
# Setting live helper options
- _BREAKPOINTS="${_BREAKPOINTS:-disabled}"
+ _BREAKPOINTS="${_BREAKPOINTS:-false}"
_COLOR="${_COLOR:-false}"
- _DEBUG="${_DEBUG:-disabled}"
- _FORCE="${_FORCE:-disabled}"
- _QUIET="${_QUIET:-disabled}"
- _VERBOSE="${_VERBOSE:-disabled}"
+ _DEBUG="${_DEBUG:-false}"
+ _FORCE="${_FORCE:-false}"
+ _QUIET="${_QUIET:-false}"
+ _VERBOSE="${_VERBOSE:-false}"
## config/bootstrap
@@ -416,7 +416,7 @@ Set_defaults ()
LH_VIRTUAL_ROOT_SIZE="${LH_VIRTUAL_ROOT_SIZE:-10000}"
# Setting whether to expose root filesystem as read only
- LH_EXPOSED_ROOT="${LH_EXPOSED_ROOT:-disabled}"
+ LH_EXPOSED_ROOT="${LH_EXPOSED_ROOT:-false}"
# Setting union filesystem
LH_UNION_FILESYSTEM="${LH_UNION_FILESYSTEM:-aufs}"
@@ -424,7 +424,7 @@ Set_defaults ()
# LH_HOOKS
# Setting interactive shell/X11/Xnest
- LH_INTERACTIVE="${LH_INTERACTIVE:-disabled}"
+ LH_INTERACTIVE="${LH_INTERACTIVE:-false}"
# Setting keyring packages
case "${LH_MODE}" in
@@ -575,7 +575,7 @@ Set_defaults ()
fi
case "${LH_ENCRYPTION}" in
- ""|disabled)
+ ""|false)
;;
@@ -603,7 +603,7 @@ Set_defaults ()
esac
case "${LH_ENCRYPTION}" in
- ""|disabled)
+ ""|false)
;;
@@ -651,16 +651,16 @@ Set_defaults ()
# Setting security updates option
if [ "${LH_MIRROR_CHROOT_SECURITY}" = "none" ] || [ "${LH_MIRROR_BINARY_SECURITY}" = "none" ]
then
- LH_SECURITY="disabled"
+ LH_SECURITY="false"
fi
- LH_SECURITY="${LH_SECURITY:-enabled}"
+ LH_SECURITY="${LH_SECURITY:-true}"
# Setting symlink convertion option
- LH_SYMLINKS="${LH_SYMLINKS:-disabled}"
+ LH_SYMLINKS="${LH_SYMLINKS:-false}"
# Setting sysvinit option
- LH_SYSVINIT="${LH_SYSVINIT:-disabled}"
+ LH_SYSVINIT="${LH_SYSVINIT:-false}"
## config/binary
@@ -683,7 +683,7 @@ Set_defaults ()
then
LH_BINARY_INDICES="${LH_BINARY_INDICES:-none}"
else
- LH_BINARY_INDICES="${LH_BINARY_INDICES:-enabled}"
+ LH_BINARY_INDICES="${LH_BINARY_INDICES:-true}"
fi
# Setting bootloader
@@ -705,13 +705,13 @@ Set_defaults ()
fi
# Setting checksums
- LH_CHECKSUMS="${LH_CHECKSUMS:-enabled}"
+ LH_CHECKSUMS="${LH_CHECKSUMS:-true}"
# Setting chroot option
- LH_CHROOT_BUILD="${LH_CHROOT_BUILD:-enabled}"
+ LH_CHROOT_BUILD="${LH_CHROOT_BUILD:-true}"
# Setting debian-installer option
- LH_DEBIAN_INSTALLER="${LH_DEBIAN_INSTALLER:-disabled}"
+ LH_DEBIAN_INSTALLER="${LH_DEBIAN_INSTALLER:-false}"
# Setting debian-installer distribution
LH_DEBIAN_INSTALLER_DISTRIBUTION="${LH_DEBIAN_INSTALLER_DISTRIBUTION:-${LH_DISTRIBUTION}}"
@@ -719,24 +719,24 @@ Set_defaults ()
# Setting debian-installer-gui
case "${LH_MODE}" in
debian)
- LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-enabled}"
+ LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-true}"
;;
ubuntu)
case "${LH_DEBIAN_INSTALLER_DISTRIBUTION}" in
karmic)
# Not available for Karmic currently.
- LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-disabled}"
+ LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-false}"
;;
*)
- LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-enabled}"
+ LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-true}"
;;
esac
;;
*)
- LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-disabled}"
+ LH_DEBIAN_INSTALLER_GUI="${LH_DEBIAN_INSTALLER_GUI:-false}"
;;
esac
@@ -803,7 +803,7 @@ Set_defaults ()
fi
# Setting encryption
- LH_ENCRYPTION="${LH_ENCRYPTION:-disabled}"
+ LH_ENCRYPTION="${LH_ENCRYPTION:-false}"
# Setting grub splash
# LH_GRUB_SPLASH
@@ -881,16 +881,16 @@ Set_defaults ()
then
case "${LH_ARCHITECTURE}" in
amd64|i386)
- if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ]
+ if [ "${LH_DEBIAN_INSTALLER}" != "false" ]
then
- LH_WIN32_LOADER="${LH_WIN32_LOADER:-enabled}"
+ LH_WIN32_LOADER="${LH_WIN32_LOADER:-true}"
else
- LH_WIN32_LOADER="${LH_WIN32_LOADER:-disabled}"
+ LH_WIN32_LOADER="${LH_WIN32_LOADER:-false}"
fi
;;
*)
- LH_WIN32_LOADER="${LH_WIN32_LOADER:-disabled}"
+ LH_WIN32_LOADER="${LH_WIN32_LOADER:-false}"
;;
esac
fi
@@ -934,7 +934,7 @@ Set_defaults ()
LH_SYSLINUX_TIMEOUT="${LH_SYSLINUX_TIMEOUT:-0}"
# Setting syslinux menu
- LH_SYSLINUX_MENU="${LH_SYSLINUX_MENU:-enabled}"
+ LH_SYSLINUX_MENU="${LH_SYSLINUX_MENU:-true}"
# Setting syslinux menu live entries
case "${LH_MODE}" in
@@ -966,13 +966,13 @@ Set_defaults ()
## config/source
# Setting source option
- LH_SOURCE="${LH_SOURCE:-disabled}"
+ LH_SOURCE="${LH_SOURCE:-false}"
# Setting image type
LH_SOURCE_IMAGES="${LH_SOURCE_IMAGES:-tar}"
# Setting fakeroot/fakechroot
- LH_USE_FAKEROOT="${LH_USE_FAKEROOT:-disabled}"
+ LH_USE_FAKEROOT="${LH_USE_FAKEROOT:-false}"
}
Check_defaults ()
@@ -1013,10 +1013,10 @@ Check_defaults ()
fi
fi
- if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ]
+ if [ "${LH_DEBIAN_INSTALLER}" != "false" ]
then
- # d-i enabled, no caching
- if ! echo ${LH_CACHE_STAGES} | grep -qs "bootstrap\b" || [ "${LH_CACHE}" != "enabled" ] || [ "${LH_CACHE_PACKAGES}" != "enabled" ]
+ # d-i true, no caching
+ if ! echo ${LH_CACHE_STAGES} | grep -qs "bootstrap\b" || [ "${LH_CACHE}" != "true" ] || [ "${LH_CACHE_PACKAGES}" != "true" ]
then
Echo_warning "You have selected values of LH_CACHE, LH_CACHE_PACKAGES, LH_CACHE_STAGES and LH_DEBIAN_INSTALLER which will result in 'bootstrap' packages not being cached. This configuration is potentially unsafe as the bootstrap packages are re-used when integrating the Debian Installer."
fi
@@ -1067,7 +1067,7 @@ Check_defaults ()
if echo ${LH_PACKAGES_LISTS} | grep -qs -E "(stripped|minimal)\b"
then
- if [ "${LH_BINARY_INDICES}" = "enabled" ]
+ if [ "${LH_BINARY_INDICES}" = "true" ]
then
Echo_warning "You have selected hook to minimise image size but you are still including package indices with your value of LH_BINARY_INDICES."
fi
diff --git a/functions/echo.sh b/functions/echo.sh
index 7af07a966..1a3b3a9b8 100755
--- a/functions/echo.sh
+++ b/functions/echo.sh
@@ -22,7 +22,7 @@ Echo ()
Echo_debug ()
{
- if [ "${_DEBUG}" = "enabled" ]
+ if [ "${_DEBUG}" = "true" ]
then
STRING="${1}"
shift
@@ -38,7 +38,7 @@ Echo_debug ()
Echo_debug_running ()
{
- if [ "${_DEBUG}" = "enabled" ]
+ if [ "${_DEBUG}" = "true" ]
then
STRING="${1}"
shift
@@ -81,7 +81,7 @@ Echo_error ()
Echo_message ()
{
- if [ "${_QUIET}" != "enabled" ]
+ if [ "${_QUIET}" != "true" ]
then
STRING="${1}"
shift
@@ -104,7 +104,7 @@ Echo_message ()
Echo_message_running ()
{
- if [ "${_QUIET}" != "enabled" ]
+ if [ "${_QUIET}" != "true" ]
then
STRING="${1}"
shift
@@ -134,7 +134,7 @@ Echo_message_running ()
Echo_verbose ()
{
- if [ "${_VERBOSE}" = "enabled" ]
+ if [ "${_VERBOSE}" = "true" ]
then
STRING="${1}"
shift
@@ -150,7 +150,7 @@ Echo_verbose ()
Echo_verbose_running ()
{
- if [ "${_VERBOSE}" != "enabled" ]
+ if [ "${_VERBOSE}" != "true" ]
then
STRING="${1}"
shift
diff --git a/functions/exit.sh b/functions/exit.sh
index bbfaf5837..928fd6e85 100755
--- a/functions/exit.sh
+++ b/functions/exit.sh
@@ -11,7 +11,7 @@ Exit ()
{
VALUE="${?}"
- if [ "${_DEBUG}" = "enabled" ]
+ if [ "${_DEBUG}" = "true" ]
then
# Dump variables
set | grep -e ^LH
diff --git a/functions/packages.sh b/functions/packages.sh
index 13c0bf4db..ce5c76afb 100755
--- a/functions/packages.sh
+++ b/functions/packages.sh
@@ -28,7 +28,7 @@ Check_package ()
Install_package ()
{
- if [ -n "${_LH_PACKAGES}" ] && [ "${LH_CHROOT_BUILD}" != "disabled" ]
+ if [ -n "${_LH_PACKAGES}" ] && [ "${LH_CHROOT_BUILD}" != "false" ]
then
case "${LH_APT}" in
apt|apt-get)
@@ -44,7 +44,7 @@ Install_package ()
Remove_package ()
{
- if [ -n "${_LH_PACKAGES}" ] && [ "${LH_CHROOT_BUILD}" != "disabled" ]
+ if [ -n "${_LH_PACKAGES}" ] && [ "${LH_CHROOT_BUILD}" != "false" ]
then
case "${LH_APT}" in
apt|apt-get)
@@ -69,7 +69,7 @@ Check_installed ()
PACKAGE="${2}"
case "${LH_CHROOT_BUILD}" in
- enabled)
+ true)
if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
then
INSTALL_STATUS=0
@@ -77,7 +77,7 @@ Check_installed ()
INSTALL_STATUS=1
fi
;;
- disabled)
+ false)
if which dpkg-query > /dev/null 2>&1
then
if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
diff --git a/functions/stagefile.sh b/functions/stagefile.sh
index 10f06fade..72e62ebb2 100755
--- a/functions/stagefile.sh
+++ b/functions/stagefile.sh
@@ -15,7 +15,7 @@ Check_stagefile ()
# Checking stage file
if [ -f "${FILE}" ]
then
- if [ "${_FORCE}" != "enabled" ]
+ if [ "${_FORCE}" != "true" ]
then
# Skipping execution
Echo_warning "skipping %s" "${NAME}"