--- ../deblob-2.6.31 2010-03-12 13:25:21.122384843 +0000 +++ DATA/linux/deblob/deblob-2.6.31 2010-03-12 13:37:47.862989651 +0000 @@ -47,6 +47,8 @@ # from 1 if changes are needed that require rebuilding the tarball. kver=2.6.31 extra=2 +filelist="filelist" + case $1 in --force) echo "WARNING: Using the force, ignored errors will be" >&2 @@ -80,9 +82,29 @@ fi filetest () { - if [ ! -f $1 ]; then - die $1 does not exist, something is wrong && return 1 - fi + export FILE=$1 + if ! [ -f $1 ] + then + if [ $( basename $1) = Makefile ] || [ $( basename $1) = Kconfig ] + then + die File not found: $1 + return 1 + fi + + file=$( basename $1) + [ -f $filelist ] || find > $filelist + if alternatives=$(egrep /$file$ $filelist) + then + die File not found: $1 + echo WARNING: alternative\(s\) to $1 found: $alternatives + export FILE=$(echo $alternatives | cut -d ' ' -f 1) + echo WARNING: Deblobbing the first alternative: $FILE + return 0 + else + die File not found: $1, no alternatives found + fi + return 1 + fi } announce () { @@ -110,13 +132,13 @@ #$1 = filename filetest $1 || return if $have_check; then - name=$1 + name=$FILE set fnord "$@" -d shift 2 $check "$@" -i linux-$kver $name > $name.deblob check_changed $name && echo $name: removed blobs else - clean_file $1 + clean_file $FILE fi }