From b8c896e3eeffab66d4d7f68bfb51124cec9abd4e Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Tue, 17 Feb 2015 23:17:47 -0800 Subject: [PATCH] May as well do the shell quoting changes to other scripts --- libretro-config.sh | 38 +++++++++++++++++--------------------- libretro-fetch.sh | 14 +++++++------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/libretro-config.sh b/libretro-config.sh index 2c8f0846..2791c035 100755 --- a/libretro-config.sh +++ b/libretro-config.sh @@ -2,9 +2,9 @@ # Architecture Assignment config_cpu() { - [ -n "${2}" ] && ARCH=${1} - [ -z "${ARCH}" ] && ARCH="`uname -m`" - case "${ARCH}" in + [ -n "$2" ] && ARCH="$1" + [ -z "$ARCH" ] && ARCH="$(uname -m)" + case "$ARCH" in x86_64) X86=true X86_64=true @@ -15,7 +15,7 @@ config_cpu() { armv*) ARM=true export FORMAT_COMPILER_TARGET=armv - export RARCHCFLAGS="${RARCHCFLAGS} -marm" + export RARCHCFLAGS="$RARCHCFLAGS -marm" case "${ARCH}" in armv5tel) ARMV5=true ;; armv6l) ARMV6=true ;; @@ -23,7 +23,7 @@ config_cpu() { esac ;; esac - if [ -n "${PROCESSOR_ARCHITEW6432}" -a "${PROCESSOR_ARCHITEW6432}" = "AMD64" ]; then + if [ -n "$PROCESSOR_ARCHITEW6432" -a "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then ARCH=x86_64 X86=true && X86_64=true fi @@ -31,9 +31,9 @@ config_cpu() { # Platform Assignment config_platform() { - [ -n "${1}" ] && platform="${1}" - [ -z "${platform}" ] && platform="`uname`" - case "${platform}" in + [ -n "$1" ] && platform="$1" + [ -z "$platform" ] && platform="$(uname)" + case "$platform" in *BSD*) FORMAT_EXT="so" FORMAT_COMPILER_TARGET="unix" @@ -84,27 +84,23 @@ config_platform() { } config_log_build_host() { - echo "PLATFORM: ${platform}" - echo "ARCHITECTURE: ${ARCH}" - echo "TARGET: ${FORMAT_COMPILER_TARGET}" + echo "PLATFORM: $platform" + echo "ARCHITECTURE: $ARCH" + echo "TARGET: $FORMAT_COMPILER_TARGET" } config_cpu config_platform config_log_build_host -if [ -z "${JOBS}" ]; then +if [ -z "$JOBS" ]; then if command -v nproc >/dev/null; then - JOBS=`nproc` + JOBS="$(nproc)" else JOBS=1 fi fi -#if uncommented, will fetch repos with read+write access. Useful for committers -#export WRITERIGHTS=1 - - #if uncommented, will build experimental cores as well which are not yet fit for release. #export BUILD_EXPERIMENTAL=1 @@ -178,16 +174,16 @@ export RA_ANDROID_MIN_API=android-9 # for Intel/PowerPC, but please don't. ;) Consider this a proof of concept # for now just to test a few cores. -if [[ "${FORMAT_COMPILER_TARGET}" = "osx" && -z "${NOUNIVERSAL}" ]]; then - case "${ARCH}" in - i385|x86_64) +if [[ "$FORMAT_COMPILER_TARGET" = "osx" && -z "$NOUNIVERSAL" ]]; then + case "$ARCH" in + i386|x86_64) export ARCHFLAGS="-arch i386 -arch x86_64" ;; ppc|ppc64) export ARCHFLAGS="-arch ppc -arch ppc64" ;; *) - echo "Universal build requested with unknown ARCH=\"${ARCH}\"" + echo "Universal build requested with unknown ARCH=\"$ARCH\"" esac fi diff --git a/libretro-fetch.sh b/libretro-fetch.sh index a44cee29..28ac58c8 100755 --- a/libretro-fetch.sh +++ b/libretro-fetch.sh @@ -23,10 +23,10 @@ fi # doing it wrong. We should fix this. fetch_project_bsnes() { - echo "=== Fetching ${3} ===" - fetch_git "${1}" "${2}" "" - fetch_git "${WORKDIR}/${2}" "${2}/perf" "" - fetch_git "${WORKDIR}/${2}" "${2}/balanced" "" + echo "=== Fetching $3 ===" + fetch_git "$1" "$2" "" + fetch_git "$WORKDIR/$2" "$2/perf" "" + fetch_git "$WORKDIR/$2" "$2/balanced" "" } @@ -297,9 +297,9 @@ fetch_libretro_sdk() { } -if [ -n "${1}" ]; then - while [ -n "${1}" ]; do - "${1}" +if [ -n "$1" ]; then + while [ -n "$1" ]; do + "$1" shift done else