From 742f9a3c48168410688276bdf75b3a63fe3884a6 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 26 Aug 2013 20:19:25 +0100 Subject: [PATCH 1/2] Remove $GITCMD variable After commit c5d159c $GITCMD is only used once, so 'inline it', which also allows us to get rid of the 'eval' call. --- rpi-update | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpi-update b/rpi-update index ff63005..4906db6 100755 --- a/rpi-update +++ b/rpi-update @@ -25,7 +25,6 @@ FW_PATH="${BOOT_PATH}" FW_MODPATH="${ROOT_PATH}/lib/modules" FW_REV=${1:-""} FW_REVFILE="${FW_PATH}/.firmware_revision" -GITCMD="git --git-dir=\"${FW_REPOLOCAL}/.git\" --work-tree=\"${FW_REPOLOCAL}\"" [ "${RPI_UPDATE_UNSUPPORTED}" -ne 0 ] && echo -e "You appear to be trying to update firmware on an incompatible distribution. To force update, run the following:\nsudo -E RPI_UPDATE_UNSUPPORTED=0 ./rpi-update" && exit 1 function update_self() { @@ -107,7 +106,7 @@ function finalise { ldconfig -r "${ROOT_PATH}" if [[ ${FW_REV} == "" ]]; then echo " *** Storing current firmware revision" - eval ${GITCMD} rev-parse ${BRANCH} > "${FW_REVFILE}" + git --git-dir="${FW_REPOLOCAL}/.git" --work-tree="${FW_REPOLOCAL}" rev-parse ${BRANCH} > "${FW_REVFILE}" else echo ${FW_REV} > "${FW_REVFILE}" fi From 6f8dc5f9bb434f559b237f6e13c19828af6c8f35 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 26 Aug 2013 23:38:10 +0100 Subject: [PATCH 2/2] rev-parse git command doesn't need the --work-tree argument small tidyup --- rpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpi-update b/rpi-update index 4906db6..aaea205 100755 --- a/rpi-update +++ b/rpi-update @@ -106,7 +106,7 @@ function finalise { ldconfig -r "${ROOT_PATH}" if [[ ${FW_REV} == "" ]]; then echo " *** Storing current firmware revision" - git --git-dir="${FW_REPOLOCAL}/.git" --work-tree="${FW_REPOLOCAL}" rev-parse ${BRANCH} > "${FW_REVFILE}" + git --git-dir="${FW_REPOLOCAL}/.git" rev-parse ${BRANCH} > "${FW_REVFILE}" else echo ${FW_REV} > "${FW_REVFILE}" fi