diff --git a/helpers/config b/helpers/config index 5493526152cb3668640eb25a046372da6ba351dc..22cea19e49841d015838ca89de009c28481a394c 100755 --- a/helpers/config +++ b/helpers/config @@ -146,7 +146,7 @@ rm /CurrentlyBuilding umount /proc } -sedhelper(){ +sedhelper2(){ FILE="$1" EXPR="$2"";" @@ -164,6 +164,19 @@ sedhelper(){ done } +sedhelper(){ + FILE="$1" + EXPR="$2" + + MD5=$(md5sum "$FILE") + echo Running modification-aware sed: sed "$EXPR" -i "$FILE" + /bin/sed "$EXPR" -i "$FILE" + if [ "$MD5" = "$(md5sum "$FILE")" ]; then + echo File "$FILE" was not modified, stopping. + exit 1 + fi +} + sed (){ if ! echo $@ | grep -qw '\-i'; then echo Running fallback sed: /bin/sed "$@"