@@ -94,6 +94,14 @@ set_debarch() {
# Create debian/source/ if it is a source package build
gen_source ()
{
+ # The Debian Policy requires -debian_revision portion in the version.
+ # Since the source format 3.0 (quilt) is used here, a hyphen is
+ # required in the version.
+ if [ "${KDEB_PKGVERSION:+set}" ] && ! echo "${KDEB_PKGVERSION}" | grep -- '-..*'; then
+ echo "error: KDEB_PKGVERSION must include a hyphen to create a source package" >&2
+ exit 1
+ fi
+
mkdir -p debian/source
echo "3.0 (quilt)" > debian/source/format
Debian Policy [1] specifies the version format as follows: [epoch:]upstream_version[-debian_revision] Here, the presence of the debian_revision part indicates a non-native package, while its absence indicates a native package. Kbuild adopts the source format 3.0 (quilt), meaning the kernel is a non-native package and therefore requires the revision portion. This commit prevents the creation of an invalid source package when KDEB_PKGVERSION contains no hyphen. [1]: https://www.debian.org/doc/debian-policy/ch-controlfields.html#version Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- scripts/package/mkdebian | 8 ++++++++ 1 file changed, 8 insertions(+)