From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) by dpdk.org (Postfix) with ESMTP id 8F7CC5584 for ; Tue, 19 Jul 2016 16:30:52 +0200 (CEST) Received: by mail-qk0-f169.google.com with SMTP id p74so17292159qka.0 for ; Tue, 19 Jul 2016 07:30:52 -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=bu+GFO9LsfSYmu0k9coeaAexWUlnlzlEAfIcvo3Jx2U=; b=tq6EzVAYn2XgP3Iyn1ZFfYdnms2iK6X8kP7MF3gsNTGR/zNK4XrzTMSanY76bzN2Cd Hx8DmSrfP9xEg+anI/1Qtjr6pbjGJH4z3yhC0vsp9p+U1HM9dDwD+laKl+utqPR3iAMN 8wB3dv82i5nPijX6hlFocKDz5IG37vmdK9vEPLmmLWnbJr5MAcNEnm/HcTHuQctvZvEO o/6g1jvvTYSzAd5/ytGYpOYCE4hHDeAn4iXwr2RqDSnEfdEHSYq2vK1t5G91ztXrXnyf qwEFJahwvS2cDL70R2ZxVI0D9rg/dar41zp81pnvDFqEkbyjBYU6knuDOwGFgIvPHL7i fPoA== 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=bu+GFO9LsfSYmu0k9coeaAexWUlnlzlEAfIcvo3Jx2U=; b=WzeKApoJ1eHKqLLK+MsU+erCNctsZBkMQP0BD0yeWGqxeLDvnN2ASJV4pma0QwAhG1 ln05NHtDzN3VLziOMHvp7z1T+YkJ9Iw/sMfUUqnguTTy56LzjsIbAflaNpYxxdP7QMjB FTfeKKslPHFKWDRIPmyq/801SFnQFV3OH0tKK4KJ+9yb7ITlIKB5IP7uDCYAutMCV37Y XP6Da6G5VZMEl0xVf0Nsq9YCXKbrvkqE7Pdl3Fv5OFlJfMfJ+sx8yJ8EcSgM5rDLv6tt GlOkli3djEex3DOdpDkkKmdU5H1K63g0TR9WZHbFZwVaJp/oV2pVn1SxNxAjmW/tkShc i4OQ== X-Gm-Message-State: ALyK8tLikg4xj7SDG2RK605gtU/B15zEOM6891Y54itcSBrX9BQhP9yFxnW9CwRoAdAtHQpt8obQ0Tu6xp/DExjI X-Received: by 10.55.125.129 with SMTP id y123mr39454574qkc.204.1468938651961; Tue, 19 Jul 2016 07:30:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.23.77 with HTTP; Tue, 19 Jul 2016 07:30:32 -0700 (PDT) In-Reply-To: <1468935637-39937-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1468857995-130392-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1468935637-39937-1-git-send-email-sergio.gonzalez.monroy@intel.com> From: Christian Ehrhardt Date: Tue, 19 Jul 2016 16:30:32 +0200 Message-ID: To: Sergio Gonzalez Monroy Cc: dev , Thomas Monjalon , Ferruh Yigit Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3] 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 14:30:52 -0000 Hi, the order changed, but IMHO actually it improved. Things are now at the place they were before, but with the overwriting config value that came later - that is the best of both worlds. Tested a few config runs pre/post patch and compared them sorted (equal) and unsorted - now configs slotted in where they belong. Thanks for updating Sergio Acked-by: Christian Ehrhardt Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jul 19, 2016 at 3:40 PM, Sergio Gonzalez Monroy < sergio.gonzalez.monroy@intel.com> 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. > > The awk script basically keeps the last config value, while > maintaining order and comments from original config file. > > Fixes: b2063f104db7 ("mk: filter duplicate configuration entries") > > Signed-off-by: Sergio Gonzalez Monroy > --- > mk/rte.sdkconfig.mk | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk > index e93237f..5c94edf 100644 > --- a/mk/rte.sdkconfig.mk > +++ b/mk/rte.sdkconfig.mk > @@ -88,11 +88,13 @@ $(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=$$(cat $(RTE_OUTPUT)/.config_tmp) ; \ > + echo "$$config" | awk -F '=' 'BEGIN {i=1} \ > + /^#/ {pos[i++]=$$0} \ > + !/^#/ {if (!s[$$1]) {pos[i]=$$0; s[$$1]=i++} \ > + else {pos[s[$$1]]=$$0}} END \ > + {for (j=1; j + > $(RTE_OUTPUT)/.config_tmp ; \ > 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 > >