summaryrefslogtreecommitdiff
path: root/scripts/build/fixautomakedepsmagic
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-12-02 09:01:21 +0000
committer <>2014-12-04 16:11:25 +0000
commitbdab5265fcbf3f472545073a23f8999749a9f2b9 (patch)
treec6018dd03dea906f8f1fb5f105f05b71a7dc250a /scripts/build/fixautomakedepsmagic
downloadntp-d4b7cd9723cce9561fa15f74b90b85a3a61b5ef8.tar.gz
Imported from /home/lorry/working-area/delta_ntp/ntp-dev-4.2.7p482.tar.gz.ntp-dev-4.2.7p482
Diffstat (limited to 'scripts/build/fixautomakedepsmagic')
-rwxr-xr-xscripts/build/fixautomakedepsmagic28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/build/fixautomakedepsmagic b/scripts/build/fixautomakedepsmagic
new file mode 100755
index 0000000..ec82bba
--- /dev/null
+++ b/scripts/build/fixautomakedepsmagic
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+prog=`basename $0`
+
+
+t=/tmp/$prog.$$
+
+trap 'rm -f ${t} ; exit 1' 1 3 15
+
+while [ $# -gt 0 ]; do
+ f=$1
+ shift
+ sed -e '/^DEPS_MAGIC :=/,/^-include \$/s/^/#/' $f > $t
+ c="diff $f $t"
+ echo $c
+ $c
+ tstatus=$?
+ if [ $tstatus = 0 ]; then
+ echo "$prog":" $f not modified"
+ elif [ ! -w $f ]; then
+ echo "$prog":" $f not not writable"
+ else
+ c="cp $t $f"
+ echo $c
+ $c
+ fi
+ rm -f $t
+done