On Wed, Sep 03, 2014 at 03:37:01PM -0400, Felipe Sateler wrote:
> The change proposed by Simon prepends every variable known to make
> that starts with DEB_ , along with its value, to the invocation of
> dpkg-buildflags. The problem is that some make variable names are
> illegal as shell variable names. Like for example
> DEB_DBG_PACKAGE_pulseaudio-module-zeroconf, which is not a valid shell
> variable name. So the invocation expands to something like:

Hello Felipe,

The attached patch should fix this issue. I haven't used a
whitelist of variables (which might get out of date) but instead
filtered out all variables containing "-" in their names.

I'm not sure how to create a Makefile variable with a "-" in it,
I failed to do so, but the patch should work. Please test it, as
I haven't tried to build pulseaudio with the patch.

Regards
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
diff -Nru cdbs-0.4.126/1/class/langcore.mk.in cdbs-0.4.126simon1/1/class/langcore.mk.in
--- cdbs-0.4.126/1/class/langcore.mk.in	2014-08-21 20:44:42.000000000 +0200
+++ cdbs-0.4.126simon1/1/class/langcore.mk.in	2014-09-04 00:00:55.000000000 +0200
@@ -24,12 +24,14 @@
 
 # Resolve our defaults
 ifneq (,$(wildcard /usr/bin/dpkg-buildflags))
+# $(filter-out %x%,...) doesn't work ...
+_filter_out = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))
 # GNU Make doesn't export current environment in $(shell ..) function.
 # We need at least some of the DEB_* flags for dpkg-buildflags, so
 # extract them from the defined variables.  Sadly there seems to be no
 # way to get just get all exported variables.
 _get_dpkg_buildflags = $(shell \
-	$(foreach flag,$(filter DEB_%,$(.VARIABLES)),\
+	$(foreach flag,$(call _filter_out,-,$(filter DEB_%,$(.VARIABLES))),\
 		$(flag)="$($(flag))") \
 	dpkg-buildflags --get $(1))
 deb_cflags := $(call _get_dpkg_buildflags,CFLAGS)

Attachment: signature.asc
Description: Digital signature

Reply via email to