[PATCH 2/5] kbuild: deb-pkg: make debian/rules quiet by default

From: Masahiro Yamada
Date: Sat Dec 30 2023 - 08:52:22 EST


Add $(Q) to commands in debian/rules to make them quiet when the package
built is initiated by 'make deb-pkg'.

While the commands in debian/rules are not hidden when you directly work
with the debianized tree, you can set 'terse' to DEB_BUILD_OPTIONS to
silence them.

Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
---

scripts/package/debian/rules | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index a686c37d0d02..b3f80f62236c 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -11,6 +11,10 @@ ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
MAKEFLAGS += -j$(NUMJOBS)
endif

+ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
+ Q ?= @
+endif
+
revision = $(lastword $(subst -, ,$(shell dpkg-parsechangelog -S Version)))
CROSS_COMPILE ?= $(filter-out $(DEB_BUILD_GNU_TYPE)-, $(DEB_HOST_GNU_TYPE)-)
make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) KBUILD_BUILD_VERSION=$(revision) $(addprefix CROSS_COMPILE=,$(CROSS_COMPILE))
@@ -19,20 +23,20 @@ make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) KBUILD_BUILD_VERSION=$(r
binary: binary-arch binary-indep
binary-indep: build-indep
binary-arch: build-arch
- $(MAKE) $(make-opts) \
+ $(Q)$(MAKE) $(make-opts) \
run-command KBUILD_RUN_COMMAND='+$$(srctree)/scripts/package/builddeb'

.PHONY: build build-indep build-arch
build: build-arch build-indep
build-indep:
build-arch:
- $(MAKE) $(make-opts) olddefconfig
- $(MAKE) $(make-opts) headers all
+ $(Q)$(MAKE) $(make-opts) olddefconfig
+ $(Q)$(MAKE) $(make-opts) headers all

.PHONY: clean
clean:
- rm -rf debian/files debian/linux-* debian/deb-env.vars*
- $(MAKE) ARCH=$(ARCH) clean
+ $(Q)rm -rf debian/files debian/linux-* debian/deb-env.vars*
+ $(Q)$(MAKE) ARCH=$(ARCH) clean

# If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed
# directly. Run 'dpkg-architecture --print-set --print-format=make' to
@@ -41,6 +45,6 @@ ifndef DEB_HOST_ARCH
-include debian/deb-env.vars

debian/deb-env.vars:
- dpkg-architecture -a$$(cat debian/arch) --print-set --print-format=make > $@.tmp
- mv $@.tmp $@
+ $(Q)dpkg-architecture -a$$(cat debian/arch) --print-set --print-format=make > $@.tmp
+ $(Q)mv $@.tmp $@
endif
--
2.40.1