From 5a56e2339bc77c7bc812e1c8d3c61348efe9f772 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Fri, 21 Aug 2026 13:05:27 +0300 Subject: [PATCH] dpkg: Fix package metadata defaults Keep user-provided maintainer identity values and only install the defaults when these variables are empty. Generate debian/compat only after dpkg-query succeeds so a failed query cannot leave an empty file. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d5c482938..d5a11c45a 100644 --- a/Makefile +++ b/Makefile @@ -433,8 +433,8 @@ debian/changelog: debian/changelog.in debian/changelog debian/compat: - dpkg-query -W --showformat='$${Version}\n' debhelper 2>/dev/null | \ - sed 's/\..*//' >$@ + version=$$(dpkg-query -W --showformat='$${Version}\n' debhelper) && \ + printf '%s\n' "$${version%%.*}" >$@ ../scst_$(VERSION).orig.tar.gz: debian/changelog debian/compat Makefile \ $(SCST_SOURCE_FILES) @@ -447,8 +447,8 @@ debian/compat: mv "scst-$(VERSION).tar.xz" "$@" dpkg: ../scst_$(VERSION).orig.tar.gz - @[ -z "$$DEBEMAIL" ] || export DEBEMAIL=bvanassche@acm.org && \ - [ -z "$$DEBFULLNAME" ] || export DEBFULLNAME="Bart Van Assche" &&\ + @[ -n "$$DEBEMAIL" ] || export DEBEMAIL=bvanassche@acm.org && \ + [ -n "$$DEBFULLNAME" ] || export DEBFULLNAME="Bart Van Assche" &&\ echo "KDIR=$(KDIR)" && \ echo "KVER=$(KVER)" && \ sed 's/%{scst_version}/$(VERSION)/' \