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=1c6f75795f1f6cda3f6069d3426efd99f7029a77

commit 1c6f75795f1f6cda3f6069d3426efd99f7029a77
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Sep 13 23:41:55 2022 +0200

    scripts/mk: On dpkg-build-api >= 1 default to dpkg_vendor_derives_from_v1
---
 man/dpkg-build-api.pod |  7 +++++++
 scripts/mk/Makefile.am |  5 +++++
 scripts/mk/vendor.mk   | 12 ++++++++++--
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/man/dpkg-build-api.pod b/man/dpkg-build-api.pod
index 78d5d386e..d8eb0c1d5 100644
--- a/man/dpkg-build-api.pod
+++ b/man/dpkg-build-api.pod
@@ -68,6 +68,13 @@ B<dpkg-buildpackage> requires all required F<debian/rules> 
targets.
 That is B<clean>, B<build>, B<build-indep>, B<build-arch>,
 B<binary-indep> and B<binary-arch>.
 
+=item *
+
+B<vendor.mk> defaults to using B<dpkg_vendor_derives_from_v1> for the
+B<dpkg_vendor_derives_from> macro.
+To restore the B<v0> behavior set B<dpkg_vendor_derives_from> to
+B<dpkg_vendor_derives_from_v0>.
+
 =back
 
 =item v0
diff --git a/scripts/mk/Makefile.am b/scripts/mk/Makefile.am
index 6fa328717..257ba5252 100644
--- a/scripts/mk/Makefile.am
+++ b/scripts/mk/Makefile.am
@@ -26,3 +26,8 @@ install-data-hook:
                         >$(DESTDIR)$(pkgdatadir)/buildtools.mk.new
        mv $(DESTDIR)$(pkgdatadir)/buildtools.mk.new \
           $(DESTDIR)$(pkgdatadir)/buildtools.mk
+
+       $(do_make_subst) <$(DESTDIR)$(pkgdatadir)/vendor.mk \
+                        >$(DESTDIR)$(pkgdatadir)/vendor.mk.new
+       mv $(DESTDIR)$(pkgdatadir)/vendor.mk.new \
+          $(DESTDIR)$(pkgdatadir)/vendor.mk
diff --git a/scripts/mk/vendor.mk b/scripts/mk/vendor.mk
index f7c61bf6f..f3241a57b 100644
--- a/scripts/mk/vendor.mk
+++ b/scripts/mk/vendor.mk
@@ -7,8 +7,9 @@
 # This Makefile fragment also defines a set of "dpkg_vendor_derives_from"
 # macros that can be used to verify if the current vendor derives from
 # another vendor. The unversioned variant defaults to the v0 version if
-# undefined, which can be defined explicitly to one of the versions or the
-# versioned macros can be used directly. The following are example usages:
+# undefined or to the v1 version when on build API 1, otherwise it can be
+# defined explicitly to one of the versions or the versioned macros can be
+# used directly. The following are example usages:
 #
 # - dpkg_vendor_derives_from (since dpkg 1.16.1)
 #
@@ -32,6 +33,9 @@
 #     ...
 #   endif
 
+dpkg_datadir = $(srcdir)/mk
+include $(dpkg_datadir)/buildapi.mk
+
 dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := 
$(shell $(2)))$(value DPKG_CACHE_$(1)))
 
 DEB_VENDOR = $(call dpkg_late_eval,DEB_VENDOR,dpkg-vendor --query Vendor)
@@ -40,4 +44,8 @@ DEB_PARENT_VENDOR = $(call 
dpkg_late_eval,DEB_PARENT_VENDOR,dpkg-vendor --query
 dpkg_vendor_derives_from_v0 = dpkg-vendor --derives-from $(1) && echo yes || 
echo no
 dpkg_vendor_derives_from_v1 = $(shell $(dpkg_vendor_derives_from_v0))
 
+ifeq ($(call dpkg_build_api_ge,1),yes)
+dpkg_vendor_derives_from ?= $(dpkg_vendor_derives_from_v1)
+else
 dpkg_vendor_derives_from ?= $(dpkg_vendor_derives_from_v0)
+endif

-- 
Dpkg.Org's dpkg

Reply via email to