kbuild: use proper prefix for tarballs to fix rpm-pkg build error
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 19 Apr 2023 17:04:24 +0000 (02:04 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 23 Apr 2023 12:23:10 +0000 (21:23 +0900)
commit9cedc5e89a59da72bfecdb76bfaa5a28a273029d
tree05c7d363b74a85615651ca80c324edef1549c080
parent8b824220bd6641976676ae7a1e925db63eb89c4b
kbuild: use proper prefix for tarballs to fix rpm-pkg build error

Since commit f8d94c4e403c ("kbuild: do not create intermediate *.tar
for source tarballs"), 'make rpm-pkg' fails because the prefix of the
source tarball is 'linux.tar/' instead of 'linux/'. $(basename $@)
strips only '.gz' from the filename linux.tar.gz.

You need to strip two suffixes from compressed tarballs and one suffix
from uncompressed tarballs (for example 'perf-6.3.0.tar' generated by
'make perf-tar-src-pkg').

One tricky fix might be --prefix=$(firstword $(subst .tar, ,$@))/
but I think it is better to hard-code the prefix.

Fixes: f8d94c4e403c ("kbuild: do not create intermediate *.tar for source tarballs")
Reported-by: Jiwei Sun <sunjw10@lenovo.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
scripts/Makefile.package