aboutsummaryrefslogtreecommitdiff
path: root/Tools/scripts/sed_checked.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/scripts/sed_checked.sh')
-rwxr-xr-xTools/scripts/sed_checked.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tools/scripts/sed_checked.sh b/Tools/scripts/sed_checked.sh
new file mode 100755
index 000000000000..1592062c4bf3
--- /dev/null
+++ b/Tools/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 sed failed: backup file same as original: ${x#${WRKSRC}/} >> ${REWARNFILE}
+ fi
+ fi
+ fi
+done