From 4d8c222f9cf16a77db1e28cc88a0b963db9ce213 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sat, 7 Feb 2015 04:52:53 -0800 Subject: [PATCH] Protect more where needed, less where not. --- iKarith-libretro-fetch.sh | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/iKarith-libretro-fetch.sh b/iKarith-libretro-fetch.sh index 262b58d9..80500e08 100755 --- a/iKarith-libretro-fetch.sh +++ b/iKarith-libretro-fetch.sh @@ -4,36 +4,27 @@ # BSDs don't have readlink -f read_link() { - TARGET_FILE="${1}" - cd "`dirname "${TARGET_FILE}"`" - TARGET_FILE="`basename "${TARGET_FILE}"`" + TARGET_FILE="$1" + cd "`dirname "$TARGET_FILE"`" + TARGET_FILE="`basename "$TARGET_FILE"`" - while [ -L "${TARGET_FILE}" ]; do - TARGET_FILE="`readlink "${TARGET_FILE}"`" - cd "`dirname "${TARGET_FILE}"`" - TARGET_FILE="`basename "${TARGET_FILE}"`" + while [ -L "$TARGET_FILE" ]; do + TARGET_FILE="`readlink "$TARGET_FILE"`" + cd "`dirname "$TARGET_FILE"`" + TARGET_FILE="`basename "$TARGET_FILE"`" done PHYS_DIR="`pwd -P`" - RESULT="${PHYS_DIR}/${TARGET_FILE}" - echo ${RESULT} + RESULT="$PHYS_DIR/$TARGET_FILE" + echo "$RESULT" } SCRIPT="`read_link "$0"`" -BASE_DIR="`dirname "${SCRIPT}"`" +BASE_DIR="`dirname "$SCRIPT"`" -. ${BASE_DIR}/iKarith-libretro-config.sh +. $BASE_DIR/iKarith-libretro-config.sh WORKDIR=$(pwd) -DATESTAMP_FMT="%Y-%m-%d %H:%M:%S" - - -log_verbose() { - if [ -n "${VERBOSE}" ]; then - echo "$(date -u +${DATESTAMP_FMT}):${@}" - fi -} - echo_cmd() { echo "$@" "$@" @@ -65,6 +56,8 @@ fetch_git() { # Keep three copies so we don't have to rebuild stuff all the time. +# FIXME: If you need 3 copies of source to compile 3 sets of objects, you're +# doing it wrong. We should fix this. fetch_project_bsnes() { fetch_git "${1}" "${2}"