From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by dpdk.org (Postfix) with ESMTP id C5EFCDE3 for ; Tue, 19 Jul 2016 13:01:35 +0200 (CEST) Received: by mail-qk0-f171.google.com with SMTP id p74so11982973qka.0 for ; Tue, 19 Jul 2016 04:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VqrPUcGbhsITYwfKVhde6vEHrVvmKRxFguds+Ijv8RM=; b=1i2HKy6XP0VQQmQsZSOGJAah9/pFjZAhM5tI5ZXACi5FNqfL92nWBoFtSDYIg2ObBZ 22BsFDCLNgeHKSKYXZBfTdXwzYvGpSpXs1Zf7Th5f2bmJQGVXrJ48D5/70XQwf82YN7D oPEoF4eQq4PBuVKOX7tcEUlvi1MI/qXbjs8VS+wb6obGPyKv/7fY4YjpzVBb4GYuFp79 gv5lF2Q0Wj1LpqB5ep1lPSs6IuJK5r1n45USpgwsUHq2V9k8vz7v34WfJPEcOgVF+Pt7 W5ZeWVoyZdO66iWz7iJiMw7ZA04SXOHXouj60KtlpHXCPZyu/RyCVL3fEJ4IHMxXcvQm fCgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VqrPUcGbhsITYwfKVhde6vEHrVvmKRxFguds+Ijv8RM=; b=Fif0f4M+Gtc1bOSKCGcQcjn5/BScWYGvTd2wNutD05iDeuqeXwg9fr9OM+ubIeBxKt xYBGWWkq55++S/So6K5UpBXjDppZhLhSZvmwCiWv/CLRimdF1hWi1/pBb5JcbFhBHARu +2eDRV3DL+0PvuOWLO29lEoIHtQmJjQ0TVoUM2vIvGY0MvHIpNu5uqohgY4pH734QrHI C957zLdJYEixTrrYSh3yTsy6VUybX40TAvaVU9ddclO1woyhu/VTUl3P+BoOxT15XTUO YgWxmGseil0Zvz5Vy7Z3MwpF3XrdnYmZtwD6MkNvqMnjaddmJZ5MPQ0niDdxEFmU2k3d wqQA== X-Gm-Message-State: ALyK8tL/mwasTxqwqfOSKEZNBZlvbDZreCCGQttqzoE37axYVpTieKA4O2TlAqtcAYn37gFLG3lSNCSx6n7yCfqt X-Received: by 10.55.125.129 with SMTP id y123mr38154440qkc.204.1468926095149; Tue, 19 Jul 2016 04:01:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.23.77 with HTTP; Tue, 19 Jul 2016 04:01:15 -0700 (PDT) In-Reply-To: <578E01A5.6020601@intel.com> References: <1468847463-107132-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1468857995-130392-1-git-send-email-sergio.gonzalez.monroy@intel.com> <578E01A5.6020601@intel.com> From: Christian Ehrhardt Date: Tue, 19 Jul 2016 13:01:15 +0200 Message-ID: To: Ferruh Yigit Cc: Sergio Gonzalez Monroy , dev , Thomas Monjalon Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2] 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: Tue, 19 Jul 2016 11:01:36 -0000 Hi, I haven't tested the new suggested way, just went into explaining what formerly were the reasons. But I'd strongly vote against reordering and dropping comments. Sergio - v3 had still awk for some parts. It doesn't have the "0,..." you mentioned. Could you check if that is already using GNU-sed only syntax - http://dpdk.org/dev/patchwork/patch/14592/ ? If this would be ok - AND - if it creates the same .config as the current code I'd think that is the way to go. Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jul 19, 2016 at 12:32 PM, Ferruh Yigit wrote: > On 7/18/2016 5:06 PM, Sergio Gonzalez Monroy wrote: > > 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 > > --- > > > > v2: > > - Use temp var instead of temp file > > > > mk/rte.sdkconfig.mk | 7 ++----- > > 1 file changed, 2 insertions(+), 5 deletions(-) > > > > diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk > > index e93237f..c2b6e13 100644 > > --- a/mk/rte.sdkconfig.mk > > +++ b/mk/rte.sdkconfig.mk > > @@ -88,11 +88,8 @@ $(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; \ > > + config=$$(grep -v "^#" $(RTE_OUTPUT)/.config_tmp) ; \ > > + echo "$$config" | awk -F'=' '{a[$$1]=$$0} END {for (i in > a) print a[i]}' > $(RTE_OUTPUT)/.config_tmp ; \ > This is another nice awk command. > > A few comments about new command: > - Removes all comments from final config > - Spreads config option all over the file, logical grouping of options > removed. > > When both happens at the same time, I have a concern that this may lead > missing some config options when somebody wants to update local config > file, but I am OK if everybody is OK. > > > > 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 ; \ > > > >