kpatch-build: process the patch name correctly

Process the patch name correctly that only concern the fuffix with
.patch or .diff. Otherwise if the patch name is not end with .patch
or .diff but has it as substring, the fuffix will be removed
unreasonably.

Signed-off-by: Li Bin <huawei.libin@huawei.com>
This commit is contained in:
Li Bin 2016-02-27 11:22:03 +08:00
parent b60d3acddb
commit 441ab87643

View File

@ -308,7 +308,7 @@ fi
[[ -z $TARGETS ]] && TARGETS="vmlinux modules"
PATCHNAME=$(basename "$PATCHFILE")
if [[ "$PATCHNAME" =~ \.patch ]] || [[ "$PATCHNAME" =~ \.diff ]]; then
if [[ "$PATCHNAME" =~ \.patch$ ]] || [[ "$PATCHNAME" =~ \.diff$ ]]; then
PATCHNAME="${PATCHNAME%.*}"
fi