From a50ce4cbc65f99a047fd9b0b42b9df7f25c56c7b Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 9 Sep 2024 12:56:06 +0100 Subject: [PATCH] Rename some URI variables for clarity --- rpi-update | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpi-update b/rpi-update index 83564fa..f28eb7e 100755 --- a/rpi-update +++ b/rpi-update @@ -671,8 +671,8 @@ function noobs_fix { } function get_hash_date { - local COMMITS_URI=${1}/commits/$2 - eval curl ${CURL_OPTIONS_API} -s ${CURL_OPTIONS} "${COMMITS_URI}" | grep "date" | head -1 | awk -F\" '{print $4}' + local COMMITS_API_URI=${1}/commits/$2 + eval curl ${CURL_OPTIONS_API} -s ${CURL_OPTIONS} "${COMMITS_API_URI}" | grep "date" | head -1 | awk -F\" '{print $4}' } function compare_hashes { @@ -687,14 +687,14 @@ function compare_hashes { function get_long_hash { # ask github for long version hash - local COMMITS_URI=${1}/commits/$2 - eval curl ${CURL_OPTIONS_API} -s ${CURL_OPTIONS} "${COMMITS_URI}" | awk 'BEGIN {hash=""} { if (hash == "" && $1 == "\"sha\":") {hash=substr($2, 2, 40);} } END {print hash}' + local COMMITS_API_URI=${1}/commits/$2 + eval curl ${CURL_OPTIONS_API} -s ${CURL_OPTIONS} "${COMMITS_API_URI}" | awk 'BEGIN {hash=""} { if (hash == "" && $1 == "\"sha\":") {hash=substr($2, 2, 40);} } END {print hash}' } function print_diffs { - local diff_uri="$1" + local DIFF_API_URI="$1" SEPARATOR="======================================================" - eval curl ${CURL_OPTIONS_API} -s ${CURL_OPTIONS} "${diff_uri}" | awk -v SEPARATOR="${SEPARATOR}" -F\" ' { if ($2 == "commits") {commits=1} if (commits && $2 == "message") {print SEPARATOR "\nCommit: " $4} }' | sed 's/\\n\\n/\nCommit:\ /g' + eval curl ${CURL_OPTIONS_API} -s ${CURL_OPTIONS} "${DIFF_API_URI}" | awk -v SEPARATOR="${SEPARATOR}" -F\" ' { if ($2 == "commits") {commits=1} if (commits && $2 == "message") {print SEPARATOR "\nCommit: " $4} }' | sed 's/\\n\\n/\nCommit:\ /g' }