From 5bdc28c7facb7db6c2cdffa8d33aca69cb158448 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Fri, 10 Feb 2012 14:05:44 +0100 Subject: [PATCH] [intel/repo] fix bashish in shell scripts, bug #3022 --- .../sabayon-limbo/packages.db.post_update.sh | 6 +++--- .../sabayon-limbo/packages.db.post_upgrade.sh | 17 ++++++++--------- .../sabayonlinux.org/packages.db.post_update.sh | 6 +++--- .../packages.db.post_upgrade.sh | 17 ++++++++--------- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/conf/intel/repo/sabayon-limbo/packages.db.post_update.sh b/conf/intel/repo/sabayon-limbo/packages.db.post_update.sh index 0db1c6a..0f6301b 100644 --- a/conf/intel/repo/sabayon-limbo/packages.db.post_update.sh +++ b/conf/intel/repo/sabayon-limbo/packages.db.post_update.sh @@ -20,15 +20,15 @@ # PLEASE NOTE: this script is called automatically by entropy and, unless # requested otherwise, it should be NEVER EVER called by user. -[[ "$UID" != "0" ]] && echo && echo "Skipping update script, you are not root" && exit 0 +[ "$UID" != "0" ] && echo && echo "Skipping update script, you are not root" && exit 0 -[[ -z "$3" ]] && echo "not enough parameters" && exit 1 +[ -z "$3" ] && echo "not enough parameters" && exit 1 REPO_ID=$1 ROOT=$2 BRANCH=$3 -function configure_correct_binutils() { +configure_correct_binutils() { # configure correct binutils # new profile needs to be configured echo diff --git a/conf/intel/repo/sabayon-limbo/packages.db.post_upgrade.sh b/conf/intel/repo/sabayon-limbo/packages.db.post_upgrade.sh index 334fbfb..b655687 100644 --- a/conf/intel/repo/sabayon-limbo/packages.db.post_upgrade.sh +++ b/conf/intel/repo/sabayon-limbo/packages.db.post_upgrade.sh @@ -1,6 +1,6 @@ #!/bin/sh -[[ -z "$4" ]] && echo "not enough parameters" && exit 1 +[ -z "$4" ] && echo "not enough parameters" && exit 1 REPO_ID=$1 ROOT=$2 @@ -64,7 +64,7 @@ three_four_to_five() { # switch Python to latest available, 2.7 eselect python update --ignore 3.0 --ignore 3.1 --ignore 3.2 --ignore 3.3 --ignore 3.4 - [[ "${?}" != "0" ]] && echo "eselect-python not available" && rc=1 + [ "${?}" != "0" ] && echo "eselect-python not available" && rc=1 # configure correct binutils # new profile needs to be configured @@ -93,17 +93,17 @@ three_four_to_five() { fi # move alsa conf to new location - [[ -f "${ROOT}/etc/modprobe.d/alsa" ]] && \ + [ -f "${ROOT}/etc/modprobe.d/alsa" ] && \ mv "${ROOT}/etc/modprobe.d/alsa" "${ROOT}/etc/modprobe.d/alsa.conf" # try to mount /boot, ignore all the possible bullshit - # [[ "${ROOT}" = "/" ]] && mount /boot &> /dev/null + # [ "${ROOT}" = "/" ] && mount /boot &> /dev/null # setup grub.conf, if found - [[ -f "${ROOT}boot/grub/grub.conf" ]] && \ + [ -f "${ROOT}boot/grub/grub.conf" ] && \ sed -i 's/CONSOLE=\/dev\/tty1/console=tty1/g' "${ROOT}/boot/grub/grub.conf" # setup grub.conf, if found, change nox into gentoo=nox - [[ -f "${ROOT}boot/grub/grub.conf" ]] && \ + [ -f "${ROOT}boot/grub/grub.conf" ] && \ sed -i 's/ nox / gentoo=nox /g' "${ROOT}/boot/grub/grub.conf" # setup /etc/localtime correctly @@ -123,12 +123,11 @@ if [ "$(uname -m)" = "x86_64" ]; then fi # migration script from branch 4 to 5 -[[ "${OLD_BRANCH}" = "4" ]] && [[ "${NEW_BRANCH}" = "5" ]] && three_four_to_five +[ "${OLD_BRANCH}" = "4" ] && [ "${NEW_BRANCH}" = "5" ] && three_four_to_five # migration script from branch 3.5 to 5 -[[ "${OLD_BRANCH}" = "3.5" ]] && [[ "${NEW_BRANCH}" = "5" ]] && three_four_to_five +[ "${OLD_BRANCH}" = "3.5" ] && [ "${NEW_BRANCH}" = "5" ] && three_four_to_five echo "migration switch not found" exit 1 - diff --git a/conf/intel/repo/sabayonlinux.org/packages.db.post_update.sh b/conf/intel/repo/sabayonlinux.org/packages.db.post_update.sh index 0db1c6a..0f6301b 100644 --- a/conf/intel/repo/sabayonlinux.org/packages.db.post_update.sh +++ b/conf/intel/repo/sabayonlinux.org/packages.db.post_update.sh @@ -20,15 +20,15 @@ # PLEASE NOTE: this script is called automatically by entropy and, unless # requested otherwise, it should be NEVER EVER called by user. -[[ "$UID" != "0" ]] && echo && echo "Skipping update script, you are not root" && exit 0 +[ "$UID" != "0" ] && echo && echo "Skipping update script, you are not root" && exit 0 -[[ -z "$3" ]] && echo "not enough parameters" && exit 1 +[ -z "$3" ] && echo "not enough parameters" && exit 1 REPO_ID=$1 ROOT=$2 BRANCH=$3 -function configure_correct_binutils() { +configure_correct_binutils() { # configure correct binutils # new profile needs to be configured echo diff --git a/conf/intel/repo/sabayonlinux.org/packages.db.post_upgrade.sh b/conf/intel/repo/sabayonlinux.org/packages.db.post_upgrade.sh index 334fbfb..b655687 100644 --- a/conf/intel/repo/sabayonlinux.org/packages.db.post_upgrade.sh +++ b/conf/intel/repo/sabayonlinux.org/packages.db.post_upgrade.sh @@ -1,6 +1,6 @@ #!/bin/sh -[[ -z "$4" ]] && echo "not enough parameters" && exit 1 +[ -z "$4" ] && echo "not enough parameters" && exit 1 REPO_ID=$1 ROOT=$2 @@ -64,7 +64,7 @@ three_four_to_five() { # switch Python to latest available, 2.7 eselect python update --ignore 3.0 --ignore 3.1 --ignore 3.2 --ignore 3.3 --ignore 3.4 - [[ "${?}" != "0" ]] && echo "eselect-python not available" && rc=1 + [ "${?}" != "0" ] && echo "eselect-python not available" && rc=1 # configure correct binutils # new profile needs to be configured @@ -93,17 +93,17 @@ three_four_to_five() { fi # move alsa conf to new location - [[ -f "${ROOT}/etc/modprobe.d/alsa" ]] && \ + [ -f "${ROOT}/etc/modprobe.d/alsa" ] && \ mv "${ROOT}/etc/modprobe.d/alsa" "${ROOT}/etc/modprobe.d/alsa.conf" # try to mount /boot, ignore all the possible bullshit - # [[ "${ROOT}" = "/" ]] && mount /boot &> /dev/null + # [ "${ROOT}" = "/" ] && mount /boot &> /dev/null # setup grub.conf, if found - [[ -f "${ROOT}boot/grub/grub.conf" ]] && \ + [ -f "${ROOT}boot/grub/grub.conf" ] && \ sed -i 's/CONSOLE=\/dev\/tty1/console=tty1/g' "${ROOT}/boot/grub/grub.conf" # setup grub.conf, if found, change nox into gentoo=nox - [[ -f "${ROOT}boot/grub/grub.conf" ]] && \ + [ -f "${ROOT}boot/grub/grub.conf" ] && \ sed -i 's/ nox / gentoo=nox /g' "${ROOT}/boot/grub/grub.conf" # setup /etc/localtime correctly @@ -123,12 +123,11 @@ if [ "$(uname -m)" = "x86_64" ]; then fi # migration script from branch 4 to 5 -[[ "${OLD_BRANCH}" = "4" ]] && [[ "${NEW_BRANCH}" = "5" ]] && three_four_to_five +[ "${OLD_BRANCH}" = "4" ] && [ "${NEW_BRANCH}" = "5" ] && three_four_to_five # migration script from branch 3.5 to 5 -[[ "${OLD_BRANCH}" = "3.5" ]] && [[ "${NEW_BRANCH}" = "5" ]] && three_four_to_five +[ "${OLD_BRANCH}" = "3.5" ] && [ "${NEW_BRANCH}" = "5" ] && three_four_to_five echo "migration switch not found" exit 1 -