Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/pkg-meson.mk: fix multiple _MESON_EXTRA_BINARIES
@ 2020-03-10 12:15 John Keeping
  2020-03-10 14:01 ` Peter Seiderer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Keeping @ 2020-03-10 12:15 UTC (permalink / raw)
  To: buildroot

If multiple entries are specified for _MESON_EXTRA_BINARIES, the current
sed expression will only replace the first one.

Specifically, from GNU sed 4.8 the manual says:

    /regexp/
        Match  lines matching the regular expression regexp.  Matching
        is performed on the current pattern space, which can be modified
        with commands such as ``s///''.

so after the first binary has been added, the next entry no longer
matches since the pattern space has been modifed.

Instead of adding a script for each value, apply the match once and add
a subsitution for each entry.

Signed-off-by: John Keeping <john@metanate.com>
---
 package/pkg-meson.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 642b715938..6ac3f79fe9 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -76,9 +76,10 @@ define $(2)_CONFIGURE_CMDS
 	    -e 's%@TARGET_CXXFLAGS@%$$(call make-comma-list,$$($(2)_CXXFLAGS))%g' \
 	    -e 's%@HOST_DIR@%$$(HOST_DIR)%g' \
 	    -e 's%@STAGING_DIR@%$$(STAGING_DIR)%g' \
-	    $$(foreach x,$$($(2)_MESON_EXTRA_BINARIES), \
-	        -e "/^\[binaries\]$$$$/s:$$$$:\n$$(x):" \
-	    ) \
+	    -e "/^\[binaries\]$$$$/ { \
+		$$(foreach x,$$($(2)_MESON_EXTRA_BINARIES), \
+	            s:$$$$:\n$$(x): ; \
+		) }" \
 	    package/meson/cross-compilation.conf.in \
 	    > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
 	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-21 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-10 12:15 [Buildroot] [PATCH] package/pkg-meson.mk: fix multiple _MESON_EXTRA_BINARIES John Keeping
2020-03-10 14:01 ` Peter Seiderer
2020-03-11 22:31 ` Yann E. MORIN
2020-03-21 19:45 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox