[Reproducible-commits] [dpkg] 59/90: scripts/mk: Add an extra level of escaping for double evals

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:16 UTC 2015


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

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit dc505ca07a9037079299aca4aeabe513d514a32e
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Jul 30 05:38:28 2015 +0200

    scripts/mk: Add an extra level of escaping for double evals
    
    Regression introduced in commit 486241a9d3521ed093be9a02b00f4d404dc39b35.
    
    Otherwise the values are not computed lazily, many of which are quite
    expensive. Rename dpkg_late_eval to dpkg_lazy_eval so that the other
    makefiles can be intermixed with the ones needing the extra level of
    escaping.
    
    Closes: #793330
---
 debian/changelog           | 3 +++
 scripts/mk/architecture.mk | 4 ++--
 scripts/mk/buildflags.mk   | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 689a068..a4da0c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,9 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     --no-recursion option is now positional, and needs to be passed before
     the -T option, otherwise the tarball will end up with duplicated entries.
     Thanks to Richard Purdie <richard.purdie at linuxfoundation.org>.
+  * Add an extra level of escaping for double $(evals) in architecture.mk
+    and buildflags.mk, so that the variables are computed lazily again.
+    Regression introduced in dpkg 1.16.2. Closes: #793330
   * Perl modules:
     - Remove non-functional timezone name support from
       Dpkg::Changelog::Entry::Debian.
diff --git a/scripts/mk/architecture.mk b/scripts/mk/architecture.mk
index 26c0936..f6e6893 100644
--- a/scripts/mk/architecture.mk
+++ b/scripts/mk/architecture.mk
@@ -2,9 +2,9 @@
 # that dpkg-architecture can return. Existing values of those variables
 # are preserved as per policy.
 
-dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
+dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1)))
 
-dpkg_architecture_setvar = $(1) ?= $(call dpkg_late_eval,$(1),dpkg-architecture -q$(1))
+dpkg_architecture_setvar = $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -q$(1))
 
 $(foreach machine,BUILD HOST TARGET,\
   $(foreach var,ARCH ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\
diff --git a/scripts/mk/buildflags.mk b/scripts/mk/buildflags.mk
index 0cce17e..bb496e1 100644
--- a/scripts/mk/buildflags.mk
+++ b/scripts/mk/buildflags.mk
@@ -16,14 +16,14 @@
 # This list is kept in sync with the default set of flags returned
 # by dpkg-buildflags.
 
-dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
+dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1)))
 
 DPKG_BUILDFLAGS_LIST = CFLAGS CPPFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS \
                        GCJFLAGS FFLAGS FCFLAGS LDFLAGS
 
 define dpkg_buildflags_export_envvar
 ifdef $(1)
-DPKG_BUILDFLAGS_EXPORT_ENVVAR += $(1)="$(value $(1))"
+DPKG_BUILDFLAGS_EXPORT_ENVVAR += $(1)="$$(value $(1))"
 endif
 endef
 
@@ -33,7 +33,7 @@ $(foreach flag,$(DPKG_BUILDFLAGS_LIST),\
   $(foreach operation,SET STRIP APPEND PREPEND,\
     $(eval $(call dpkg_buildflags_export_envvar,DEB_$(flag)_MAINT_$(operation)))))
 
-dpkg_buildflags_setvar = $(1) = $(call dpkg_late_eval,$(1),$(DPKG_BUILDFLAGS_EXPORT_ENVVAR) dpkg-buildflags --get $(1))
+dpkg_buildflags_setvar = $(1) = $(call dpkg_lazy_eval,$(1),$(DPKG_BUILDFLAGS_EXPORT_ENVVAR) dpkg-buildflags --get $(1))
 
 $(foreach flag,$(DPKG_BUILDFLAGS_LIST),\
   $(eval $(call dpkg_buildflags_setvar,$(flag))))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list