File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / scripts / fixautomakedepsmagic
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 7 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

    1: #!/bin/sh
    2: 
    3: prog=`basename $0`
    4: 
    5: 
    6: t=/tmp/$prog.$$
    7: 
    8: trap 'rm -f ${t} ; exit 1' 1 3 15
    9: 
   10: while [ $# -gt 0 ]; do
   11:         f=$1
   12: 	shift
   13: 	sed -e '/^DEPS_MAGIC :=/,/^-include \$/s/^/#/' $f > $t
   14: 	c="diff $f $t"
   15: 	echo $c
   16: 	$c
   17: 	tstatus=$?
   18: 	if [ $tstatus = 0 ]; then
   19: 		echo "$prog":" $f not modified"
   20: 	elif [ ! -w $f ]; then
   21: 		echo "$prog":" $f not not writable"
   22: 	else
   23: 		c="cp $t $f"
   24: 		echo $c
   25: 		$c
   26: 	fi
   27: 	rm -f $t
   28: done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>