summaryrefslogtreecommitdiff
path: root/toolchain/patch-kernel.sh
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-09-30 21:01:44 +0000
committerEric Andersen <andersen@codepoet.org>2005-09-30 21:01:44 +0000
commitc590916328a0ea96c1aabab3642ddb43b2010816 (patch)
treef8f2aae6127b7e6501959ef54e3c7076b652535c /toolchain/patch-kernel.sh
parent3a92983f7e7d1ee7365edf3099a82b5b06b1904e (diff)
Allow multiple patch file patterns.
Diffstat (limited to 'toolchain/patch-kernel.sh')
-rwxr-xr-xtoolchain/patch-kernel.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/toolchain/patch-kernel.sh b/toolchain/patch-kernel.sh
index 79401c2a7..b6722cecd 100755
--- a/toolchain/patch-kernel.sh
+++ b/toolchain/patch-kernel.sh
@@ -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