Changeset 408

Show
Ignore:
Timestamp:
07/25/06 15:19:50 (2 years ago)
Author:
tg
Message:

allow patchpattern to be a braceexpand expression

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/scripts/patch-kernel.sh

    r1 r408  
    1919    exit 1 
    2020fi 
    21      
    22 for i in ${patchdir}/${patchpattern} ; do  
     21 
     22wd=$(pwd) 
     23cd $patchdir 
     24for i in ${patchpattern} ; do 
     25    test -e "$i" || continue 
     26    i=$patchdir/$i 
     27    cd $wd 
    2328    case "$i" in 
    2429        *.gz) 
    25         type="gzip"; uncomp="gunzip -dc"; ;;  
     30        type="gzip"; uncomp="gunzip -dc"; ;; 
    2631        *.bz) 
    27         type="bzip"; uncomp="bunzip -dc"; ;;  
     32        type="bzip"; uncomp="bunzip -dc"; ;; 
    2833        *.bz2) 
    29         type="bzip2"; uncomp="bunzip2 -dc"; ;;  
     34        type="bzip2"; uncomp="bunzip2 -dc"; ;; 
    3035        *.zip) 
    31         type="zip"; uncomp="unzip -d"; ;;  
     36        type="zip"; uncomp="unzip -d"; ;; 
    3237        *.Z) 
    33         type="compress"; uncomp="uncompress -c"; ;;  
     38        type="compress"; uncomp="uncompress -c"; ;; 
    3439        *) 
    35         type="plaintext"; uncomp="cat"; ;;  
     40        type="plaintext"; uncomp="cat"; ;; 
    3641    esac 
    37     [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue      
     42    [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue 
    3843    echo "" 
    39     echo "Applying ${i} using ${type}: "  
    40     ${uncomp} ${i} | patch -p1 -E -d ${targetdir}  
     44    echo "Applying ${i} using ${type}: " 
     45    ${uncomp} ${i} | patch -p1 -E -d ${targetdir} 
    4146    if [ $? != 0 ] ; then 
    4247        echo "Patch failed!  Please fix $i!" 
    4348        exit 1 
    4449    fi 
     50    cd $patchdir 
    4551done 
    4652