mirror of
https://github.com/dynup/kpatch
synced 2025-02-18 02:37:01 +00:00
Fix resulting module vermagic when source dir is a git tree
Sometimes git doesn't see that the patches have been reverted, if that happens during ./scripts/setlocalversion call the resulting patch module is built with a wrong vermagic because the tree is still considered dirty. Fix by moving git update-index call into remove_patches function so that it is called every time the patches are reverted, not only on cleanup. Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
parent
07c7200cc9
commit
5782a977a8
@ -104,15 +104,16 @@ remove_patches() {
|
|||||||
patch="${PATCH_LIST[$idx]}"
|
patch="${PATCH_LIST[$idx]}"
|
||||||
patch -p1 -R -d "$SRCDIR" < "$patch" &> /dev/null
|
patch -p1 -R -d "$SRCDIR" < "$patch" &> /dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# If $SRCDIR was a git repo, make sure git actually sees that
|
||||||
|
# we've reverted our patch(es).
|
||||||
|
[[ -d "$SRCDIR/.git" ]] && (cd "$SRCDIR" && git update-index -q --refresh)
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm -f "$SRCDIR/.scmversion"
|
rm -f "$SRCDIR/.scmversion"
|
||||||
|
|
||||||
remove_patches
|
remove_patches
|
||||||
# If $SRCDIR was a git repo, make sure git actually sees that
|
|
||||||
# we've reverted our patch(es).
|
|
||||||
[[ -d "$SRCDIR/.git" ]] && (cd "$SRCDIR" && git update-index -q --refresh)
|
|
||||||
|
|
||||||
# restore original .config and vmlinux if they were removed with mrproper
|
# restore original .config and vmlinux if they were removed with mrproper
|
||||||
[[ -e "$TEMPDIR/.config" ]] && mv -f "$TEMPDIR/.config" "$SRCDIR/"
|
[[ -e "$TEMPDIR/.config" ]] && mv -f "$TEMPDIR/.config" "$SRCDIR/"
|
||||||
|
Loading…
Reference in New Issue
Block a user