mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
Allow multiple patch file patterns.
This commit is contained in:
parent
3a92983f7e
commit
c590916328
@ -8,7 +8,8 @@
|
|||||||
# Set directories from arguments, or use defaults.
|
# Set directories from arguments, or use defaults.
|
||||||
targetdir=${1-.}
|
targetdir=${1-.}
|
||||||
patchdir=${2-../kernel-patches}
|
patchdir=${2-../kernel-patches}
|
||||||
patchpattern=${3-*}
|
shift 2
|
||||||
|
patchpattern=${@-*}
|
||||||
|
|
||||||
if [ ! -d "${targetdir}" ] ; then
|
if [ ! -d "${targetdir}" ] ; then
|
||||||
echo "Aborting. '${targetdir}' is not a directory."
|
echo "Aborting. '${targetdir}' is not a directory."
|
||||||
@ -19,7 +20,7 @@ if [ ! -d "${patchdir}" ] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in ${patchdir}/${patchpattern} ; do
|
for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
*.gz)
|
*.gz)
|
||||||
type="gzip"; uncomp="gunzip -dc"; ;;
|
type="gzip"; uncomp="gunzip -dc"; ;;
|
||||||
@ -36,7 +37,7 @@ for i in ${patchdir}/${patchpattern} ; do
|
|||||||
esac
|
esac
|
||||||
echo ""
|
echo ""
|
||||||
echo "Applying ${i} using ${type}: "
|
echo "Applying ${i} using ${type}: "
|
||||||
${uncomp} ${i} | patch -p1 -E -d ${targetdir}
|
${uncomp} ${patchdir}/${i} | patch -p1 -E -d ${targetdir}
|
||||||
if [ $? != 0 ] ; then
|
if [ $? != 0 ] ; then
|
||||||
echo "Patch failed! Please fix $i!"
|
echo "Patch failed! Please fix $i!"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user