DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: fix FreeBSD build
@ 2016-07-18 13:11 Sergio Gonzalez Monroy
  2016-07-18 13:25 ` Thomas Monjalon
  2016-07-18 16:06 ` [dpdk-dev] [PATCH v2] " Sergio Gonzalez Monroy
  0 siblings, 2 replies; 15+ messages in thread
From: Sergio Gonzalez Monroy @ 2016-07-18 13:11 UTC (permalink / raw)
  To: dev

The sed syntax of '0,/regexp/' is GNU specific and fails with
non GNU sed in FreeBSD.

To solve the issue we can use awk instead to remove duplicates.

Fixes: b2063f104db7 ("mk: filter duplicate configuration entries")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 mk/rte.sdkconfig.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index e93237f..5c28b7b 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -88,11 +88,9 @@ $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE | $(RTE_OUTPUT)
 		$(CPP) -undef -P -x assembler-with-cpp \
 		-ffreestanding \
 		-o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \
-		for config in $$(grep -v "^#" $(RTE_OUTPUT)/.config_tmp | cut -d"=" -f1 | sort | uniq -d); do \
-			while [ $$(grep "^$${config}=" $(RTE_OUTPUT)/.config_tmp -c ) -gt 1 ]; do \
-				sed -i "0,/^$${config}=/{//d}" $(RTE_OUTPUT)/.config_tmp; \
-			done; \
-		done; \
+		grep -v "^#" $(RTE_OUTPUT)/.config_tmp | awk -F'=' '{a[$$1]=$$0} END {for (i in a) print a[i]}' > $(RTE_OUTPUT)/.config_tmp2 ; \
+		mv $(RTE_OUTPUT)/.config_tmp2 $(RTE_OUTPUT)/.config_tmp ; \
+		rm -f $(RTE_OUTPUT)/.config_tmp2 ; \
 		if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \
 			cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \
 			cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config.orig ; \
-- 
2.4.11

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

end of thread, other threads:[~2016-07-21  8:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18 13:11 [dpdk-dev] [PATCH] mk: fix FreeBSD build Sergio Gonzalez Monroy
2016-07-18 13:25 ` Thomas Monjalon
2016-07-18 13:39   ` Sergio Gonzalez Monroy
2016-07-18 13:54     ` Christian Ehrhardt
2016-07-18 14:06       ` Sergio Gonzalez Monroy
2016-07-18 14:07       ` Thomas Monjalon
2016-07-18 14:51         ` Sergio Gonzalez Monroy
2016-07-18 16:06 ` [dpdk-dev] [PATCH v2] " Sergio Gonzalez Monroy
2016-07-19 10:32   ` Ferruh Yigit
2016-07-19 11:01     ` Christian Ehrhardt
2016-07-19 11:40       ` Sergio Gonzalez Monroy
2016-07-19 13:40   ` [dpdk-dev] [PATCH v3] " Sergio Gonzalez Monroy
2016-07-19 14:30     ` Christian Ehrhardt
2016-07-19 15:04       ` Ferruh Yigit
2016-07-21  8:27       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).