]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/uClibc/sources/patch-kernel.sh
uClibc haengt...
[people/pmueller/ipfire-2.x.git] / src / uClibc / sources / patch-kernel.sh
index 79401c2a74f21af93ddc91abd037df92bcb9f0de..b6722cecd91472039c4940c410b097efafd85178 100644 (file)
@@ -8,7 +8,8 @@
 # Set directories from arguments, or use defaults.
 targetdir=${1-.}
 patchdir=${2-../kernel-patches}
-patchpattern=${3-*}
+shift 2
+patchpattern=${@-*}
 
 if [ ! -d "${targetdir}" ] ; then
     echo "Aborting.  '${targetdir}' is not a directory."
@@ -19,7 +20,7 @@ if [ ! -d "${patchdir}" ] ; then
     exit 1
 fi
     
-for i in ${patchdir}/${patchpattern} ; do 
+for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
     case "$i" in
        *.gz)
        type="gzip"; uncomp="gunzip -dc"; ;; 
@@ -36,7 +37,7 @@ for i in ${patchdir}/${patchpattern} ; do
     esac
     echo ""
     echo "Applying ${i} using ${type}: " 
-    ${uncomp} ${i} | patch -p1 -E -d ${targetdir} 
+    ${uncomp} ${patchdir}/${i} | patch -p1 -E -d ${targetdir} 
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix $i!"
        exit 1