Просмотр исходного кода

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
Guillem Jover лет назад: 11
Родитель
Сommit
dc505ca07a
3 измененных файлов с 8 добавлено и 5 удалено
  1. 3 0
      debian/changelog
  2. 2 2
      scripts/mk/architecture.mk
  3. 3 3
      scripts/mk/buildflags.mk

+ 3 - 0
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@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.

+ 2 - 2
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,\

+ 3 - 3
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))))