diff mbox series

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

Message ID 20231230135200.1058873-2-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/5] kbuild: deb-pkg: move 'make headers' to build-arch | expand

Commit Message

Masahiro Yamada Dec. 30, 2023, 1:51 p.m. UTC
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@kernel.org>
---

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

Comments

Nicolas Schier Jan. 9, 2024, 2:14 p.m. UTC | #1
On Sat, Dec 30, 2023 at 10:51:57PM +0900, Masahiro Yamada wrote:
> 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.

Reading Debian Policy §4.9 [1] I'd expected some fiddling with V=1 or
'make -s', but I am ok with the simple '@' silencing (which matches my
personal preference).

Reviewed-by: Nicolas Schier <n.schier@avm.de>
Masahiro Yamada Jan. 9, 2024, 2:46 p.m. UTC | #2
On Tue, Jan 9, 2024 at 11:14 PM Nicolas Schier <nicolas@fjasle.eu> wrote:
>
> On Sat, Dec 30, 2023 at 10:51:57PM +0900, Masahiro Yamada wrote:
> > 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.
>
> Reading Debian Policy §4.9 [1] I'd expected some fiddling with V=1 or
> 'make -s', but I am ok with the simple '@' silencing (which matches my
> personal preference).


Hmm, you are right.


Maybe, we should follow what the Debian kernel does.

Debian kernel sets KBUILD_VERBOSE=1 unless
'terse' is given.


https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.7-1_exp1/debian/rules.real#L36




>
> Reviewed-by: Nicolas Schier <n.schier@avm.de>
Nicolas Schier Jan. 10, 2024, 1:37 p.m. UTC | #3
On Tue, Jan 09, 2024 at 11:46:49PM +0900, Masahiro Yamada wrote:
> On Tue, Jan 9, 2024 at 11:14 PM Nicolas Schier <nicolas@fjasle.eu> wrote:
> >
> > On Sat, Dec 30, 2023 at 10:51:57PM +0900, Masahiro Yamada wrote:
> > > 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.
> >
> > Reading Debian Policy §4.9 [1] I'd expected some fiddling with V=1 or
> > 'make -s', but I am ok with the simple '@' silencing (which matches my
> > personal preference).
> 
> 
> Hmm, you are right.
> 
> 
> Maybe, we should follow what the Debian kernel does.
> 
> Debian kernel sets KBUILD_VERBOSE=1 unless
> 'terse' is given.
> 
> 
> https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.7-1_exp1/debian/rules.real#L36

yes, I think it makes sense to do the Debian way.

Kind regards,
Nicolas
diff mbox series

Patch

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