diff --git a/common/environment/setup/vsed.sh b/common/environment/setup/vsed.sh index ff59bdacb3..092253696c 100644 --- a/common/environment/setup/vsed.sh +++ b/common/environment/setup/vsed.sh @@ -44,11 +44,11 @@ vsed() { return 1 fi - for rx in "${regexes[@]}"; do - for f in "${files[@]}"; do - olddigest="$($XBPS_DIGEST_CMD "$f")" - olddigest="${olddigest%% *}" + for f in "${files[@]}"; do + olddigest="$($XBPS_DIGEST_CMD "$f")" + olddigest="${olddigest%% *}" + for rx in "${regexes[@]}"; do sed -i "$f" -e "$rx" || { msg_red "$pkgver: vsed: sed call failed with regex \"$rx\" on file \"$f\"\n" return 1 @@ -60,6 +60,7 @@ vsed() { if [ "$olddigest" = "$newdigest" ]; then msg_warn "$pkgver: vsed: regex \"$rx\" didn't change file \"$f\"\n" fi + olddigest="${newdigest}" done done }