From c384f85d2bc217a41ec210b705122f36cb80b2c7 Mon Sep 17 00:00:00 2001 From: Doan Tran Cong Danh Date: Sun, 12 May 2019 10:17:13 +0700 Subject: [PATCH] vsed: refactor digest variables' name We don't specify any specific digest function in this function, and the old variables' name doesn't reflect the fact that they're a pair of old and new digest built by the same hash function. --- common/environment/setup/vsed.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/environment/setup/vsed.sh b/common/environment/setup/vsed.sh index 3ad579783e3..0f249c4280b 100644 --- a/common/environment/setup/vsed.sh +++ b/common/environment/setup/vsed.sh @@ -46,16 +46,16 @@ vsed() { for rx in "${regexes[@]}"; do for f in "${files[@]}"; do - shasums="$($XBPS_DIGEST_CMD "$f")" + olddigest="$($XBPS_DIGEST_CMD "$f")" sed -i "$f" -e "$rx" || { msg_red "$pkgver: vsed: sed call failed with regex \"$rx\" on file \"$f\"\n" return 1 } - sha256sum="$($XBPS_DIGEST_CMD "$f")" + newdigest="$($XBPS_DIGEST_CMD "$f")" - if [ "$shasums" = "${sha256sum%% *}" ]; then + if [ "$olddigest" = "${newdigest%% *}" ]; then msg_warn "$pkgver: vsed: regex \"$rx\" didn't change file \"$f\"\n" fi done