This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=ba13bb4418e93e7f5bf92b2981f50c1797fea99c

commit ba13bb4418e93e7f5bf92b2981f50c1797fea99c
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Dec 6 02:28:38 2025 +0100

    scripts/mk: Switch to use GNU make intcmp instead of relying on shell
    
    The intcmp function was added in GNU make 4.4, which was not present
    in Debian at the time this code was written. Switch to it to simplify
    the code and to avoid spawning multiple processes.
    
    Prompted-by: Sean Whitton <[email protected]>
    Ref: https://lists.debian.org/debian-devel/2025/12/msg00039.html
---
 debian/control         | 3 ++-
 scripts/mk/buildapi.mk | 5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/debian/control b/debian/control
index e77b0d977..eae8eb9bd 100644
--- a/debian/control
+++ b/debian/control
@@ -125,7 +125,8 @@ Depends:
  xz-utils (>= 5.4.0),
 # Version needed for git-style diff support.
  patch (>= 2.7),
- make,
+# Version needed for GNU make intcmp function usage.
+ make (>= 4.4),
  binutils,
 Recommends:
  build-essential,
diff --git a/scripts/mk/buildapi.mk b/scripts/mk/buildapi.mk
index f118177e2..bb7361375 100644
--- a/scripts/mk/buildapi.mk
+++ b/scripts/mk/buildapi.mk
@@ -11,9 +11,6 @@ dpkg_buildapi_mk_included = yes
 # Default API level when not set.
 DPKG_BUILD_API ?= $(shell dpkg-buildapi)
 
-# We could use only built-in GNU make functions, but that seems too much
-# complexity given no integer operators, given that we currently have to
-# fetch the build API level anyway.
-dpkg_build_api_ge = $(shell test "$(DPKG_BUILD_API)" -ge "$(1)" && echo yes)
+dpkg_build_api_ge = $(intcmp $(DPKG_BUILD_API),$(1),no,yes,yes)
 
 endif # dpkg_buildapi_mk_included

-- 
Dpkg.Org's dpkg

Reply via email to