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