#!/bin/sh KERNELDIR=/lib/modules/$(uname -r)/build PREPARSER="./preparser" UNIQUE=false VERBOSE=false NOTEST=true DODIFF=false DIFFREV=false ALLOW_ANY_DIR=true docp() { SRCNAME=$1; if $VERBOSE; then echo -n "$SRCNAME... " fi # special cases TMPNAME=/tmp/`basename $1`.$$ # Makefiles BASENAME=`basename $2`; if [ "$BASENAME" = "Makefile" ]; then if [ $VERSION -gt 3 -o \( $VERSION -eq 2 -a $PATCHLEVEL -gt 3 \) ]; then sed -e "s/drivers\/isdn\/Rules\.make/Rules\.make/" < $SRCNAME > $TMPNAME if $VERBOSE ; then echo -n "processing... modified..." fi SRCNAME=$TMPNAME fi fi # Rules.make if [ "$BASENAME" = "Rules.make" ]; then if ! [ $VERSION -gt 3 -o \( $VERSION -eq 2 -a $PATCHLEVEL -gt 3 \) ]; then if $VERBOSE; then echo "skipped" fi return fi fi # *.[hc] : preparse if selected if $UNIQUE ; then if echo $SRCNAME | egrep -q '.[hc]$'; then # only copy isdn_compat.h if we don't have a # delete #include in the ctrlfile if [ "$1" = "include/linux/isdn_compat.h" ]; then if grep -q isdn_compat.h $CTRLNAME; then if $VERBOSE; then echo "skipped" fi return fi; fi if $VERBOSE; then echo -n "processing... " fi $PREPARSER -c $CTRLNAME $SRCNAME $TMPNAME RETVAL=$? if [ $RETVAL -ne 2 -a $RETVAL -ne 0 ] ; then echo "Problem with preparser retval $RETVAL" exit 1 fi if [ $RETVAL -eq 2 ] ; then if $VERBOSE; then echo -n "modified... " fi SRCNAME=$TMPNAME fi fi fi if $DODIFF; then if $VERBOSE; then echo fi if $DIFFREV; then diff -u $2 $SRCNAME else diff -u $SRCNAME $2 fi else # do the actual copy, if necessary if ! cmp -s $SRCNAME $2 ; then if $VERBOSE; then echo "copying" else echo "$1... copying" fi if $NOTEST ; then mkdir -p `dirname $2` rm -f $2 # unlink first cp $SRCNAME $2 fi else if $VERBOSE; then echo "up to date" fi fi fi if [ -f $TMPNAME ]; then rm -f $TMPNAME fi } # # Print usage and exit # usage() { cat<