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.
This commit is contained in:
Doan Tran Cong Danh 2019-05-12 10:17:13 +07:00 committed by Enno Boland
parent 35242fdff2
commit c384f85d2b

View File

@ -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