[Unstable/Lunar][PATCH 1/3] UBUNTU: [Packaging] debian/rules: Fix PPA debug package builds

Juerg Haefliger juerg.haefliger at canonical.com
Fri Jan 13 08:40:31 UTC 2023


Build PPAs have a configuration option 'Build debug symbols'. Currently,
if we build in a PPA that has this option disabled, we still build
the debug packages but we remove them from debian/files so they don't
get published. That seems wrong, we shouldn't even build the packages.

The LP build system adds the option 'noautodgbsym' to the env variable
DEB_BUILD_OPTIONS in such a case [1]. Use that to disable debug package
builds.

While at it, clean up the mangling of debian/files and remove logic
that was added in 2010 to support future LP buildd features that never
materialized [2].

[1] https://bugs.launchpage.net/bugs/1623256
[2] https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/lucid/commit/?id=b56658a9b08b5114d973403fda3cb6216123ace6

Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
 debian/rules.d/0-common-vars.mk |  5 +++++
 debian/rules.d/2-binary-arch.mk | 11 +----------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 76bdf889d1b5..6901b7e4de1e 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -51,6 +51,11 @@ do_dbgsym_package = true
 ifeq ($(do_full_build),false)
 	do_dbgsym_package = false
 endif
+ifeq ($(filter $(DEB_BUILD_OPTIONS),noautodbgsym),noautodbgsym)
+	# Disable debug package builds if we're building in a PPA that has the
+	# 'Build debug symbols' option disabled
+	do_dbgsym_package = false
+endif
 
 abinum		:= $(firstword $(subst .,$(space),$(revision)))
 prev_abinum	:= $(firstword $(subst .,$(space),$(prev_revision)))
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 82419f0b9912..6f9e808eb2e7 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -666,16 +666,7 @@ ifeq ($(do_dbgsym_package),true)
 	#
 	mv ../$(dbgpkg)_$(release)-$(revision)_$(arch).deb \
 		../$(dbgpkg)_$(release)-$(revision)_$(arch).ddeb
-	set -e; \
-	( \
-		$(lockme_cmd) 9 || exit 1; \
-		if grep -qs '^Build-Debug-Symbols: yes$$' /CurrentlyBuilding; then \
-			sed -i '/^$(dbgpkg)_/s/\.deb /.ddeb /' debian/files; \
-		else \
-			grep -v '^$(dbgpkg)_.*$$' debian/files > debian/files.new; \
-			mv debian/files.new debian/files; \
-		fi; \
-	) 9>$(lockme_file)
+	$(lockme) sed -i '/^$(dbgpkg)_/s/\.deb /.ddeb /' debian/files
 	# Now, the package wont get into the archive, but it will get put
 	# into the debug system.
 endif
-- 
2.34.1




More information about the kernel-team mailing list