Workarounds: remove --reverse from patch options
The --reverse option causes patch to fail even if the diff is
just few lines off. The reverse option to check if patch was
applied is not a good idea with yaml. It's fairly easy to create
reverse patch for patch that wasn't applied.
Change-Id: I4a1459344794f5d602dc1b781d15a591ea2ac135
(cherry picked from commit a4fa67c1f9
)
This commit is contained in:
parent
55a5830f09
commit
8fbe67d95b
|
@ -18,11 +18,11 @@ function apply_patch {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if sudo patch --dry-run --reverse --force -d ${patch_dir} -p1 < ${temp_dir}/patch.txt >/dev/null 2>&1
|
||||
if sudo patch --dry-run --force -d ${patch_dir} -p1 < ${temp_dir}/patch.txt >/dev/null 2>&1
|
||||
then
|
||||
sudo patch -Ns -d ${patch_dir} -p1 < ${temp_dir}/patch.txt
|
||||
else
|
||||
echo "Patch ${patch_id} already applied, skipping"
|
||||
echo "Patch ${patch_id} fails to apply - either already applied or you need to fix it."
|
||||
fi
|
||||
|
||||
sudo rm -Rf ${temp_dir}/
|
||||
|
|
Loading…
Reference in New Issue