Merge pull request #102 from jpoimboe/patch-no-reverse

kpatch-build: improve error handling for an already applied patch
This commit is contained in:
Seth Jennings 2014-04-01 10:30:11 -05:00
commit e87b37aafe
1 changed files with 2 additions and 2 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 -p1 < "$APPLIEDPATCHFILE" || die "source patch file failed to apply"
patch -p1 -R < "$APPLIEDPATCHFILE" &> /dev/null || die "reverse patch apply failed"
echo "Building original kernel"
@ -195,7 +195,7 @@ cp -LR "$DATADIR/patch" "$TEMPDIR" || die
cp "$OBJDIR/vmlinux" "$TEMPDIR" || die
echo "Building patched kernel"
patch -p1 < "$APPLIEDPATCHFILE" >> "$LOGFILE" 2>&1 || die
patch -N -p1 < "$APPLIEDPATCHFILE" >> "$LOGFILE" 2>&1 || die
make "-j$CPUS" vmlinux "O=$OBJDIR" 2>&1 | tee -a "$TEMPDIR/patched_build.log" >> "$LOGFILE"
[[ "${PIPESTATUS[0]}" -eq 0 ]] || die