[intel/repo] fix bashish in shell scripts, bug #3022
This commit is contained in:
parent
4fed05abcb
commit
5bdc28c7fa
@ -20,15 +20,15 @@
|
|||||||
# PLEASE NOTE: this script is called automatically by entropy and, unless
|
# PLEASE NOTE: this script is called automatically by entropy and, unless
|
||||||
# requested otherwise, it should be NEVER EVER called by user.
|
# 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
|
REPO_ID=$1
|
||||||
ROOT=$2
|
ROOT=$2
|
||||||
BRANCH=$3
|
BRANCH=$3
|
||||||
|
|
||||||
function configure_correct_binutils() {
|
configure_correct_binutils() {
|
||||||
# configure correct binutils
|
# configure correct binutils
|
||||||
# new profile needs to be configured
|
# new profile needs to be configured
|
||||||
echo
|
echo
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[[ -z "$4" ]] && echo "not enough parameters" && exit 1
|
[ -z "$4" ] && echo "not enough parameters" && exit 1
|
||||||
|
|
||||||
REPO_ID=$1
|
REPO_ID=$1
|
||||||
ROOT=$2
|
ROOT=$2
|
||||||
@ -64,7 +64,7 @@ three_four_to_five() {
|
|||||||
|
|
||||||
# switch Python to latest available, 2.7
|
# 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
|
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
|
# configure correct binutils
|
||||||
# new profile needs to be configured
|
# new profile needs to be configured
|
||||||
@ -93,17 +93,17 @@ three_four_to_five() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# move alsa conf to new location
|
# 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"
|
mv "${ROOT}/etc/modprobe.d/alsa" "${ROOT}/etc/modprobe.d/alsa.conf"
|
||||||
|
|
||||||
# try to mount /boot, ignore all the possible bullshit
|
# try to mount /boot, ignore all the possible bullshit
|
||||||
# [[ "${ROOT}" = "/" ]] && mount /boot &> /dev/null
|
# [ "${ROOT}" = "/" ] && mount /boot &> /dev/null
|
||||||
# setup grub.conf, if found
|
# 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"
|
sed -i 's/CONSOLE=\/dev\/tty1/console=tty1/g' "${ROOT}/boot/grub/grub.conf"
|
||||||
|
|
||||||
# setup grub.conf, if found, change nox into gentoo=nox
|
# 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"
|
sed -i 's/ nox / gentoo=nox /g' "${ROOT}/boot/grub/grub.conf"
|
||||||
|
|
||||||
# setup /etc/localtime correctly
|
# setup /etc/localtime correctly
|
||||||
@ -123,12 +123,11 @@ if [ "$(uname -m)" = "x86_64" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# migration script from branch 4 to 5
|
# 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
|
# 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"
|
echo "migration switch not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,15 +20,15 @@
|
|||||||
# PLEASE NOTE: this script is called automatically by entropy and, unless
|
# PLEASE NOTE: this script is called automatically by entropy and, unless
|
||||||
# requested otherwise, it should be NEVER EVER called by user.
|
# 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
|
REPO_ID=$1
|
||||||
ROOT=$2
|
ROOT=$2
|
||||||
BRANCH=$3
|
BRANCH=$3
|
||||||
|
|
||||||
function configure_correct_binutils() {
|
configure_correct_binutils() {
|
||||||
# configure correct binutils
|
# configure correct binutils
|
||||||
# new profile needs to be configured
|
# new profile needs to be configured
|
||||||
echo
|
echo
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[[ -z "$4" ]] && echo "not enough parameters" && exit 1
|
[ -z "$4" ] && echo "not enough parameters" && exit 1
|
||||||
|
|
||||||
REPO_ID=$1
|
REPO_ID=$1
|
||||||
ROOT=$2
|
ROOT=$2
|
||||||
@ -64,7 +64,7 @@ three_four_to_five() {
|
|||||||
|
|
||||||
# switch Python to latest available, 2.7
|
# 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
|
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
|
# configure correct binutils
|
||||||
# new profile needs to be configured
|
# new profile needs to be configured
|
||||||
@ -93,17 +93,17 @@ three_four_to_five() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# move alsa conf to new location
|
# 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"
|
mv "${ROOT}/etc/modprobe.d/alsa" "${ROOT}/etc/modprobe.d/alsa.conf"
|
||||||
|
|
||||||
# try to mount /boot, ignore all the possible bullshit
|
# try to mount /boot, ignore all the possible bullshit
|
||||||
# [[ "${ROOT}" = "/" ]] && mount /boot &> /dev/null
|
# [ "${ROOT}" = "/" ] && mount /boot &> /dev/null
|
||||||
# setup grub.conf, if found
|
# 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"
|
sed -i 's/CONSOLE=\/dev\/tty1/console=tty1/g' "${ROOT}/boot/grub/grub.conf"
|
||||||
|
|
||||||
# setup grub.conf, if found, change nox into gentoo=nox
|
# 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"
|
sed -i 's/ nox / gentoo=nox /g' "${ROOT}/boot/grub/grub.conf"
|
||||||
|
|
||||||
# setup /etc/localtime correctly
|
# setup /etc/localtime correctly
|
||||||
@ -123,12 +123,11 @@ if [ "$(uname -m)" = "x86_64" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# migration script from branch 4 to 5
|
# 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
|
# 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"
|
echo "migration switch not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user