mirror of https://github.com/dynup/kpatch
allow for unchanged objects
There are situations in which an object may be rebuilt but have no functional changes, such as a change to an included header file. This commit changes kpatch-build to tolerate individual unchanged objects so long as there is, in the end, at least one changed object. Signed-off-by: Seth Jennings <sjenning@redhat.com>
This commit is contained in:
parent
ad407d992e
commit
fb5dbc2fc5
|
@ -417,11 +417,11 @@ FILES="$(find * -type f)"
|
||||||
cd "$TEMPDIR"
|
cd "$TEMPDIR"
|
||||||
mkdir output
|
mkdir output
|
||||||
declare -A objnames
|
declare -A objnames
|
||||||
|
CHANGED=0
|
||||||
for i in $FILES; do
|
for i in $FILES; do
|
||||||
mkdir -p "output/$(dirname $i)"
|
mkdir -p "output/$(dirname $i)"
|
||||||
cd "$OBJDIR"
|
cd "$OBJDIR"
|
||||||
find_kobj $i
|
find_kobj $i
|
||||||
objnames[$KOBJFILE]=1
|
|
||||||
if [[ $KOBJFILE = vmlinux ]]; then
|
if [[ $KOBJFILE = vmlinux ]]; then
|
||||||
KOBJFILE=$VMLINUX
|
KOBJFILE=$VMLINUX
|
||||||
else
|
else
|
||||||
|
@ -442,9 +442,18 @@ for i in $FILES; do
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
[[ $rc -eq 0 ]] || die
|
# create-diff-object returns 3 if no functional change is found
|
||||||
|
[[ $rc -eq 0 ]] || [[ $rc -eq 3 ]] || die
|
||||||
|
if [[ $rc -eq 0 ]]; then
|
||||||
|
CHANGED=1
|
||||||
|
objnames[$KOBJFILE]=1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $CHANGED -eq 0 ]]; then
|
||||||
|
die "no functional changes found"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n "Patched objects:"
|
echo -n "Patched objects:"
|
||||||
for i in "${!objnames[@]}"; do echo -n " $(basename $i)"; done
|
for i in "${!objnames[@]}"; do echo -n " $(basename $i)"; done
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue