#!/bin/sh KERNELDIR=/usr/src/linux DOCP=docpd PREPARSER="./preparser" UNIQUE=false VERBOSE=false docpd() { if ! cmp -s $1 $2 ; then echo Copying $1 ... mkdir -p `dirname $2` cp $1 $2 else if $VERBOSE ; then echo $2 is up to date, NOT converted fi fi } docp() { if [ $1 -nt $2 -o ! -f $2 ] ; then echo Copying $1 ... mkdir -p `dirname $2` cp $1 $2 else if $VERBOSE ; then echo $2 is up to date, NOT converted fi fi } docpuni() { if $VERBOSE ; then echo -n "Processing $1 ... " fi TMPNAME=/tmp/`basename $1`.$$ $PREPARSER -c $CTRLNAME $1 $TMPNAME RES=$? if [ "$RES" -eq "0" ] ; then if ! cmp -s $1 $2 ; then if $VERBOSE ; then echo copying original else echo "Processing $1 ... copying original" fi mkdir -p `dirname $2` cp $1 $2 else if $VERBOSE ; then echo original file is up to date fi fi rm $TMPNAME return 0 fi if [ "$RES" -eq "2" ] ; then if ! cmp -s $TMPNAME $2 ; then if $VERBOSE ; then echo copying modified else echo "Processing $1 ... copying modified" fi mkdir -p `dirname $2` cp $TMPNAME $2 else if $VERBOSE ; then echo modified file is up to date fi fi rm $TMPNAME return 0 fi echo echo "problem with $PREPARSER retcode $RES" exit 1 } # # Print usage and exit # usage() { cat<