From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f169.google.com (mail-qt0-f169.google.com [209.85.216.169]) by dpdk.org (Postfix) with ESMTP id A09AE29D6 for ; Thu, 30 Jun 2016 13:58:19 +0200 (CEST) Received: by mail-qt0-f169.google.com with SMTP id c34so40726208qte.0 for ; Thu, 30 Jun 2016 04:58:19 -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=kVw+IHehRP0SgNtg/IajAlTJAMm+peeuZSwCtUQg+7Q=; b=WT6kP64N8UvM16aivf8wgksBMaB1gW2nYzCzAYDh3troeUBOCh67NxOrQ7ti3fb/2d fLBhtLf97zRBrr0Yl+KvueHgDMczd8cLEGW9hvzQU7md1d21kwppfASOhe+iaO0+EJnT w2CNNb4Ka7lwgSvJGGBSr1n7dG+Lu0oPCAASzyg00BBMUv1mvxIyNCP9XJAWcc/LJ+Wo eHwGJ6krFMsZyoanv1PM8zef5Z+QURd1j7MqdD+c6Jr/KCAIJbgWgWkkGEImRmHpbz69 nfuLchTb10d8yoQMNmF9pHjQyf1ZZIkSkV2/yu20ck0nScR43UqNUlCQRzfXhVN7P8RW n5oQ== 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=kVw+IHehRP0SgNtg/IajAlTJAMm+peeuZSwCtUQg+7Q=; b=Z7CV5o/w57MjKol0K8oErlUJl4+gz4qI2Xtv72fTq6Fh7V2b8Gf7jcA5vNzil5AsWh 5k65v6PhbkZIaQKr8Yl+zPpBwknaWTyVj5+4ONx8HMZAymntNbyB0sYWOVj++GeYirUk RbGinv2i8ad5DNvqX3DrZdknpy0zmBUGNTsoBD2K/ei8L3VQigkAy5zBUutvqe8X4IH6 gl0TZANMYGvlWnnLcPoWxy5VOzZzlIGaEj2SZ1IPX13Lz7eGPKTrbmqvEbE7gEzISmVO sLb3zWIIMjzi64JiaQKa7MYMHVmwpmyb3X5vxDkRCTrsMU20eFsENerBxAcz3vINPdIV HgWg== X-Gm-Message-State: ALyK8tJ4mZ9JsPl/xa+LwS9iCpOaa8FGCisSx+oxKVSUvtkYgXJ9y64Yx6MMOMBJUZpiNn7To+6SgxaA35/2dAg+ X-Received: by 10.200.52.197 with SMTP id x5mr20055254qtb.41.1467287899018; Thu, 30 Jun 2016 04:58:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.23.77 with HTTP; Thu, 30 Jun 2016 04:57:59 -0700 (PDT) In-Reply-To: <5772AA48.2090209@intel.com> References: <1465830632-25156-1-git-send-email-christian.ehrhardt@canonical.com> <5772A1C4.3030700@intel.com> <5772AA48.2090209@intel.com> From: Christian Ehrhardt Date: Thu, 30 Jun 2016 13:57:59 +0200 Message-ID: To: Ferruh Yigit Cc: Thomas Monjalon , dev Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [RFC] mk: filter duplicate configuration entries 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: Thu, 30 Jun 2016 11:58:20 -0000 Hi, thanks a lot for your feedback. I looked at it once more and found some issues - the tac was correct, but at the wrong place. Also I could simplify the inner section at least a bit. I agree to the move to the .config target. I'll submit a v2 now to this thread. Here is the diff it generates for a: "make V=1 T=x86_64-native-linuxapp-gcc config" http://paste.ubuntu.com/18163566/ Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jun 28, 2016 at 6:48 PM, Ferruh Yigit wrote: > On 6/28/2016 5:38 PM, Christian Ehrhardt wrote: > > On Tue, Jun 28, 2016 at 6:11 PM, Ferruh Yigit > > wrote: > > > > On 6/13/2016 4:10 PM, Christian Ehrhardt wrote: > > > Due to the hierarchy and the demand to keep the base config shoing > all > > > options some options end up multiple times in the .config file. > > > > > > A suggested solution was to filter for duplicates at the end of the > > > actual config step which is implemented here. > > > > > > Signed-off-by: Christian Ehrhardt < > christian.ehrhardt@canonical.com > > > > > > --- > > > mk/rte.sdkconfig.mk | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/mk/rte.sdkconfig.mk b/mk/ > rte.sdkconfig.mk > > > > > index a3acfe6..734aa06 100644 > > > --- a/mk/rte.sdkconfig.mk > > > +++ b/mk/rte.sdkconfig.mk > > > @@ -70,6 +70,11 @@ config: notemplate > > > else > > > config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile > > Not sure if this should go under this rule, or > "$(RTE_OUTPUT)/.config:" > > and should work with ".config_tmp". > > > > > $(Q)$(MAKE) depdirs > > > + tac $(RTE_OUTPUT)/.config | awk --field-separator '=' '!/^#/ > {print $$1}' | while read config; do \ > > Why reversing file since already checking all lines one by one in > > original file? > > > > > > Hi, > > every other comment is ok I'll rebase and resubmit once I find some time > > again. > > But for this (tac) the reason is simple - to keep behaviour. > > Currently the last one wins. > > Correct, but if I am not missing something, reversing doesn't help to this, > how lines deleted taking care of this: > sed -i "0,/$${config}/{//d}" $(RTE_OUTPUT)/.config; > > sed works on original file, and deletes first occurrence, independent > from lines from bottom to up, or up to bottom fed into it. > > > So if you have > > CONFIG_A=n > > CONFIG_A=y > > > > Essentially you have > > CONFIG_A=y > > > > By the tac and keeping the first occurrence we maintain behavior. > > It is interestingly hard to "keep the last occurrence" without such > > tricks, but I'm open to suggestions. > > > > > > And instead of checking each line, it is possible to get list of > > duplicates via "sort | uniq -d". > > > > > > That would fail for the reasons outlined above. > > > > Although less important, file comments also tripled in final .config. > > > > > + if [ $$(grep "^$${config}=" $(RTE_OUTPUT)/.config | > wc -l) -gt 1 ]; then \ > > "grep -c" can be used instead of "grep | wc -l" > > > > > + sed -i "0,/$${config}/{//d}" > > $(RTE_OUTPUT)/.config; \ > > > + fi; \ > > > + done > > > @echo "Configuration done" > > > endif > > > > > > > > > > > >