implement applyPatch()
This commit is contained in:
förälder
126676c91b
incheckning
88d7083944
|
@ -3,6 +3,22 @@
|
|||
# Distributed under the terms of the GNU General Public License v3
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Applies a diff file to an original
|
||||
# Parameters: %original_dir% %patch%
|
||||
#-------------------------------------------------------------------------------
|
||||
function applyPatch() {
|
||||
local DESTDIR="${1}"
|
||||
local PATCH="${2}"
|
||||
local PREFIX
|
||||
for PREFIX in {0..4}; do
|
||||
if run "patch -d ${DESTDIR} --dry-run -p ${PREFIX} -i ${PATCH} -s"; then
|
||||
run "patch -d ${DESTDIR} -p ${PREFIX} -i ${PATCH}" && return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Completely removes log file
|
||||
#-------------------------------------------------------------------------------
|
||||
|
|
Laddar…
Referens i nytt ärende