diff options
Diffstat (limited to 'contrib/ntp/scripts/fixautomakedepsmagic')
-rw-r--r-- | contrib/ntp/scripts/fixautomakedepsmagic | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/ntp/scripts/fixautomakedepsmagic b/contrib/ntp/scripts/fixautomakedepsmagic new file mode 100644 index 000000000000..ec82bba548ca --- /dev/null +++ b/contrib/ntp/scripts/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 |