summaryrefslogtreecommitdiff
path: root/Mk/Scripts/sed_checked.sh
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2020-08-03 13:53:06 +0000
committerMathieu Arnold <mat@FreeBSD.org>2020-08-03 13:53:06 +0000
commit466a092fb2fb619f5348dc105ce09d6a9326bdaf (patch)
treeac492d10afa79226f4a419cc09751d177105e340 /Mk/Scripts/sed_checked.sh
parent- Update wording/style on REINPLACE_CMD checks (diff)
Move script to a more appropriate location.
Diffstat (limited to 'Mk/Scripts/sed_checked.sh')
-rwxr-xr-xMk/Scripts/sed_checked.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/Mk/Scripts/sed_checked.sh b/Mk/Scripts/sed_checked.sh
new file mode 100755
index 000000000000..9c8c270f6099
--- /dev/null
+++ b/Mk/Scripts/sed_checked.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+/usr/bin/sed -i.bak "$@"
+for x in "${@}" ; do
+ if [ -f "${x}" ]; then
+ if cmp -s "${x}" "${x}".bak ; then
+ if [ ! -z "${REWARNFILE}" ]; then
+ echo - - REINPLACE_CMD ran, but did not modify file contents: ${x#${WRKSRC}/} >> ${REWARNFILE}
+ fi
+ fi
+ fi
+done