kpatch-build: create applied-patch only after verifying patch

Create the applied-patch file only after the patch has been verified.

Otherwise if you accidentally supply a patch which had already been
applied to the source, the cleanup trap won't reverse apply it when
exiting the script.
This commit is contained in:
Josh Poimboeuf 2014-04-01 07:51:21 -05:00
parent 7fe5c3fef4
commit 5a999ef68c
1 changed files with 1 additions and 1 deletions

View File

@ -184,8 +184,8 @@ fi
echo "Testing patch file"
cd "$SRCDIR" || die
patch -N -p1 < "$PATCHFILE" || die "source patch file failed to apply"
cp "$PATCHFILE" "$APPLIEDPATCHFILE" || die
patch -N -p1 < "$APPLIEDPATCHFILE" || die "source patch file failed to apply"
patch -p1 -R < "$APPLIEDPATCHFILE" &> /dev/null || die "reverse patch apply failed"
echo "Building original kernel"