From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id B88B22C07 for ; Mon, 18 Jul 2016 15:25:55 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id f126so103506366wma.1 for ; Mon, 18 Jul 2016 06:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=pXMDI28jT+amkhBEv7fTExIP81kI4GYuUyKWS1CZHHA=; b=iwM8hc+XpRT9Xt6xJUYyg+WJWpOfAse73d1Jx1d4DkXWfIDQS0k2wgZqD78ivSfe9x yHlSQ7n7WhOOMX3ZpziNe0zGg4K1YsXd1zJoum4+6ForiMJVaEhTBMrnbhnDEcc8h7Ye 0cIQGO/AVJMvbcO+yhXDE/pzZzjdeq8oeCzcZesQOmLoeWCEmfzpRcwZrp5qUnJQkF5R AceEQ5or2GrHagEiAWNdiiBNje1w47bpEbdvOOvn25j6iYZ3yH0yYf0HSmQLtO/u9VYq rTHA/O8vf7xEHvlN3IgFai6ig8G+zmoL5tNX67DYvkavLImMqUixnlA7MzxSczvFT1+J AuHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=pXMDI28jT+amkhBEv7fTExIP81kI4GYuUyKWS1CZHHA=; b=eoXU9OAtGJIDZ4Wn7u1NVkHlT1vTqcSm+pX1o4YB+apyoF1F79r6CXGpLYi31i8f2l 4CV+zlfaxCzccX3QH9B9+JuDCHHHoV5ychP5uXMu+ceylPQWKlgBhIy1RTCJCzttI0F7 +glkWIO7fGoAIWBWUIM++fZJkKLEUvDzG+pvmwo8vcPrTi1PO+yCgo5gkTmZYFl+Tm/L mSFFJ4NuuNtRciEmbvY+B7hUMHF9gLksmGyb+93cJPjPHDuGZmGRGZnJAgTkgbOwvH/n J4PKBCqHedAqNv0yFNztIzc8oudKix7aEs7KJAVNlx2wv48vuDYTKPrrHFsS1HAUD3OR 1Udg== X-Gm-Message-State: ALyK8tKVjXGTJOUXUywDLI3wDuKrrEPwEQERpEfxDOTGvs6ygclQBIpSqxVq8EddcoUjjV/O X-Received: by 10.28.216.75 with SMTP id p72mr57880946wmg.67.1468848355511; Mon, 18 Jul 2016 06:25:55 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id bc1sm1299143wjc.35.2016.07.18.06.25.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 06:25:54 -0700 (PDT) From: Thomas Monjalon To: Sergio Gonzalez Monroy , christian.ehrhardt@canonical.com Cc: dev@dpdk.org Date: Mon, 18 Jul 2016 15:25:54 +0200 Message-ID: <2323240.uRAlvIC4g0@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1468847463-107132-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1468847463-107132-1-git-send-email-sergio.gonzalez.monroy@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] mk: fix FreeBSD build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2016 13:25:55 -0000 2016-07-18 14:11, Sergio Gonzalez Monroy: > 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. Christian, an opinion please? > Fixes: b2063f104db7 ("mk: filter duplicate configuration entries") > > Signed-off-by: Sergio Gonzalez Monroy [...] > - 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 ; \ You can avoid creating/deleting the file .config_tmp2 by using a variable: config=$(grep -v '^#' $(RTE_OUTPUT)/.config_tmp) echo "$config" | awk ... > $(RTE_OUTPUT)/.config_tmp