mirror of
https://github.com/dynup/kpatch
synced 2024-12-14 17:34:34 +00:00
properly detect no changed objects
The current solution doesn't work because "$?" will always be 0, even if there were no "CC" lines in the build log. Instead, just make sure the changed_objs file isn't empty.
This commit is contained in:
parent
3acf30c0c8
commit
c4ea0ea4ef
@ -184,11 +184,8 @@ patch -p1 < "$APPLIEDPATCHFILE" >> "$LOGFILE" 2>&1 || die
|
||||
make "-j$CPUS" vmlinux "O=$OBJDIR" > "$TEMPDIR/patched_build.log" 2>&1 || die
|
||||
|
||||
echo "Detecting changed objects"
|
||||
grep CC "$TEMPDIR/patched_build.log" | grep -v init/version.o | awk '{print $2}' >> "$TEMPDIR/changed_objs"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "No changed objects"
|
||||
exit 1
|
||||
fi
|
||||
grep CC "$TEMPDIR/patched_build.log" | grep -v init/version.o | awk '{print $2}' > "$TEMPDIR/changed_objs"
|
||||
[[ ! -s "$TEMPDIR/changed_objs" ]] && die "no changed objects were detected"
|
||||
|
||||
echo "Rebuilding changed objects"
|
||||
rm -rf "$OBJDIR2"
|
||||
|
Loading…
Reference in New Issue
Block a user