Replace a few unweildy "if" statements with their "case" equivalents
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
0d1122d0ab
commit
250529183f
|
@ -173,8 +173,8 @@ DESTDIR_GI="${DESTDIR}/gtk"
|
||||||
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
|
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
|
||||||
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
||||||
then
|
then
|
||||||
if [ "${LH_BINARY_IMAGES}" = "tar" ] || [ "${LH_BINARY_IMAGES}" = "usb-hdd" ]
|
case "${LH_BINARY_IMAGES}" in
|
||||||
then
|
usb-hdd|tar)
|
||||||
VMLINUZ_DI="vmlinuz.di"
|
VMLINUZ_DI="vmlinuz.di"
|
||||||
INITRD_DI="initrddi.gz"
|
INITRD_DI="initrddi.gz"
|
||||||
DESTDIR_DI="${DESTDIR}"
|
DESTDIR_DI="${DESTDIR}"
|
||||||
|
@ -182,7 +182,8 @@ then
|
||||||
VMLINUZ_GI="vmlinuz.gi"
|
VMLINUZ_GI="vmlinuz.gi"
|
||||||
INITRD_GI="initrdgi.gz"
|
INITRD_GI="initrdgi.gz"
|
||||||
DESTDIR_GI="${DESTDIR}"
|
DESTDIR_GI="${DESTDIR}"
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${LH_DEBIAN_INSTALLER_DAILY}" = "enabled" ]
|
if [ "${LH_DEBIAN_INSTALLER_DAILY}" = "enabled" ]
|
||||||
|
@ -252,12 +253,13 @@ wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${VMLINUZ_DI}" ${URL}/${DI_REMOTE_BASE}/${
|
||||||
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${INITRD_DI}" ${URL}/${DI_REMOTE_BASE}/initrd.gz
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${INITRD_DI}" ${URL}/${DI_REMOTE_BASE}/initrd.gz
|
||||||
|
|
||||||
# Downloading graphical-installer
|
# Downloading graphical-installer
|
||||||
if [ "${LH_ARCHITECTURE}" = "amd64" ] || [ "${LH_ARCHITECTURE}" = "i386" ] || [ "${LH_ARCHITECTURE}" = "powerpc" ]
|
case "${LH_ARCHITECTURE}" in
|
||||||
then
|
amd64|i386|powerpc)
|
||||||
mkdir -p "${DESTDIR_GI}"
|
mkdir -p "${DESTDIR_GI}"
|
||||||
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${VMLINUZ_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/${DI_REMOTE_KERNEL}
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${VMLINUZ_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/${DI_REMOTE_KERNEL}
|
||||||
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${INITRD_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/initrd.gz
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${INITRD_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/initrd.gz
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Only download additional packages if appropriate
|
# Only download additional packages if appropriate
|
||||||
if [ "${DI_IMAGE_TYPE}" != "netboot" ]
|
if [ "${DI_IMAGE_TYPE}" != "netboot" ]
|
||||||
|
|
|
@ -94,8 +94,8 @@ Syslinux_live_entry ()
|
||||||
INITRD="${4}"
|
INITRD="${4}"
|
||||||
APPEND="${5}"
|
APPEND="${5}"
|
||||||
|
|
||||||
if [ ${LH_BINARY_IMAGES} = "iso" ] || [ ${LH_BINARY_IMAGES} = "usb-hdd" ]
|
case "${LH_BINARY_IMAGES}" in
|
||||||
then
|
iso|usb-hdd)
|
||||||
NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz[0-9]\+$' | wc -l)"
|
NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz[0-9]\+$' | wc -l)"
|
||||||
NUMBER="$((${NUMBER} +1))"
|
NUMBER="$((${NUMBER} +1))"
|
||||||
|
|
||||||
|
@ -105,7 +105,8 @@ Syslinux_live_entry ()
|
||||||
|
|
||||||
KERNEL=vmlinuz${NUMBER}
|
KERNEL=vmlinuz${NUMBER}
|
||||||
INITRD=initrd${NUMBER}.img
|
INITRD=initrd${NUMBER}.img
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Regular kernel
|
# Regular kernel
|
||||||
LINUX_LIVE="${LINUX_LIVE}\nLABEL ${LABEL}\n"
|
LINUX_LIVE="${LINUX_LIVE}\nLABEL ${LABEL}\n"
|
||||||
|
@ -209,15 +210,18 @@ Copy_syslinux_templates ()
|
||||||
mv ${FILE} $(dirname ${FILE})/$(basename ${FILE} .install)
|
mv ${FILE} $(dirname ${FILE})/$(basename ${FILE} .install)
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "${LH_ARCHITECTURE}" = "amd64" ] || [ "${LH_ARCHITECTURE}" = "i386" ] || [ "${LH_ARCHITECTURE}" = "powerpc" ]
|
case "${LH_ARCHITECTURE}" in
|
||||||
then
|
amd64|i386|powerpc)
|
||||||
for FILE in ${SCREEN_PATH}/*.install.g-i
|
for FILE in ${SCREEN_PATH}/*.install.g-i
|
||||||
do
|
do
|
||||||
mv ${FILE} $(dirname ${FILE})/$(basename ${FILE} .install.g-i)
|
mv ${FILE} $(dirname ${FILE})/$(basename ${FILE} .install.g-i)
|
||||||
done
|
done
|
||||||
else
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
rm -f ${SCREEN_PATH}/*.install.g-i
|
rm -f ${SCREEN_PATH}/*.install.g-i
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
rm -f ${SCREEN_PATH}/*.install*
|
rm -f ${SCREEN_PATH}/*.install*
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue