From 5e310e0fcaa0f41fd079b9ef8c35daffb92801ef Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Fri, 20 Jun 2008 01:31:21 +0100 Subject: Migrate a few uses of grep to In_list. --- helpers/lh_binary_iso | 13 ++++++------- helpers/lh_binary_net | 2 +- helpers/lh_binary_tar | 2 +- helpers/lh_binary_usb-hdd | 2 +- helpers/lh_bootstrap_debootstrap | 9 ++++----- helpers/lh_source_iso | 2 +- helpers/lh_source_net | 2 +- helpers/lh_source_tar | 2 +- helpers/lh_source_usb-hdd | 2 +- 9 files changed, 17 insertions(+), 19 deletions(-) diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso index 32d4148..0fc09e2 100755 --- a/helpers/lh_binary_iso +++ b/helpers/lh_binary_iso @@ -28,7 +28,7 @@ Arguments "${@}" Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -if ! echo "${LH_BINARY_IMAGES}" | grep -qs iso +if ! In_list iso "${LH_BINARY_IMAGES}" then exit 0 fi @@ -124,13 +124,12 @@ case "${LH_BOOTLOADER}" in ;; esac -if [ "${LH_DEBIAN_INSTALLER}" != "live" ] +if In_list "stripped minimal" "${LH_PACKAGES_LISTS}" then - case "${LH_PACKAGES_LISTS}" in - stripped|minimal) - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m ${GENISOIMAGE_EXCLUDE}" - ;; - esac + if [ "${LH_DEBIAN_INSTALLER}" != "live" ] + then + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m ${GENISOIMAGE_EXCLUDE}" + fi fi cat > binary.sh << EOF diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 9dae63f..9e9c91b 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -28,7 +28,7 @@ Arguments "${@}" Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -if ! echo "${LH_BINARY_IMAGES}" | grep -qs net +if ! In_list net "${LH_BINARY_IMAGES}" then exit 0 fi diff --git a/helpers/lh_binary_tar b/helpers/lh_binary_tar index 2b3df64..8fb5a3a 100755 --- a/helpers/lh_binary_tar +++ b/helpers/lh_binary_tar @@ -28,7 +28,7 @@ Arguments "${@}" Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -if ! echo "${LH_BINARY_IMAGES}" | grep -qs tar +if ! In_list tar "${LH_BINARY_IMAGES}" then exit 0 fi diff --git a/helpers/lh_binary_usb-hdd b/helpers/lh_binary_usb-hdd index 033717a..4f5e616 100755 --- a/helpers/lh_binary_usb-hdd +++ b/helpers/lh_binary_usb-hdd @@ -28,7 +28,7 @@ Arguments "${@}" Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -if ! echo "${LH_BINARY_IMAGES}" | grep -qs usb-hdd +if ! In_list usb-hdd "${LH_BINARY_IMAGES}" then exit 0 fi diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index dcf1052..12b9743 100755 --- a/helpers/lh_bootstrap_debootstrap +++ b/helpers/lh_bootstrap_debootstrap @@ -86,11 +86,10 @@ if [ "${LH_USE_FAKEROOT}" != "enabled" ] then if [ -z "${LH_BOOTSTRAP_FLAVOUR}" ] then - case "${LH_PACKAGES_LISTS}" in - stripped|minimal) - DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --variant=minbase" - ;; - esac + if In_list "stripped minimal" "${LH_PACKAGES_LISTS}" + then + DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --variant=minbase" + fi else case "${LH_BOOTSTRAP_FLAVOUR}" in stripped|minimal) diff --git a/helpers/lh_source_iso b/helpers/lh_source_iso index 31a4a85..1538727 100755 --- a/helpers/lh_source_iso +++ b/helpers/lh_source_iso @@ -33,7 +33,7 @@ then exit 0 fi -if ! echo "${LH_SOURCE_IMAGES}" | grep -qs iso +if ! In_list iso "${LH_SOURCE_IMAGES}" then exit 0 fi diff --git a/helpers/lh_source_net b/helpers/lh_source_net index bd79792..f7b6e71 100755 --- a/helpers/lh_source_net +++ b/helpers/lh_source_net @@ -33,7 +33,7 @@ then exit 0 fi -if ! echo "${LH_SOURCE_IMAGES}" | grep -qs net +if ! In_list net "${LH_SOURCE_IMAGES}" then exit 0 fi diff --git a/helpers/lh_source_tar b/helpers/lh_source_tar index c13e9a9..386db67 100755 --- a/helpers/lh_source_tar +++ b/helpers/lh_source_tar @@ -33,7 +33,7 @@ then exit 0 fi -if ! echo "${LH_SOURCE_IMAGES}" | grep -qs tar +if ! In_list tar "${LH_SOURCE_IMAGES}" then exit 0 fi diff --git a/helpers/lh_source_usb-hdd b/helpers/lh_source_usb-hdd index 82d1913..8df36dd 100755 --- a/helpers/lh_source_usb-hdd +++ b/helpers/lh_source_usb-hdd @@ -33,7 +33,7 @@ then exit 0 fi -if ! echo "${LH_SOURCE_IMAGES}" | grep -qs usb-hdd +if ! In_list usb-hdd "${LH_SOURCE_IMAGES}" then exit 0 fi -- cgit v1.0