From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Subject: Re: [PATCH v2] mk: filter duplicate configuration entries Date: Wed, 6 Jul 2016 07:37:18 +0200 Message-ID: References: <1467288021-23950-1-git-send-email-christian.ehrhardt@canonical.com> <577BE4A1.3040302@intel.com> <2194981.Lpk1XbM1Qo@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Ferruh Yigit , dev To: Thomas Monjalon Return-path: Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com [209.85.220.174]) by dpdk.org (Postfix) with ESMTP id BD2FB5A53 for ; Wed, 6 Jul 2016 07:37:38 +0200 (CEST) Received: by mail-qk0-f174.google.com with SMTP id t127so306921958qkf.1 for ; Tue, 05 Jul 2016 22:37:38 -0700 (PDT) In-Reply-To: <2194981.Lpk1XbM1Qo@xps13> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, I came up with something very similar when looking for tac replacements yesterday, but had no time to finish things. But your suggestion is even shorter - I had found "sed -n '1{h;T;};G;h;$p;' file" or "sed -n '1!G;h;$p'". That removes the tac dependency, which I agree is a good thing. To chain things up without a temp file one would need the "in-place" features of sed&awk which I'm not sure they are available (awk >=4.1 and only GNU awk). sed -i is only used in validate-abi.sh which might not be used on all platforms to count as "-i is there already so I can use it". And I really don't want to break anyone due to that change, just naively clean up the resulting config a bit. Also we already have a temp file .config_tmp in the same scope and remove it on our own. So it is not that much different to create and remove a second one for that section. Thanks for both of your feedback, submitting v3 now ... Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jul 5, 2016 at 9:47 PM, Thomas Monjalon wrote: > 2016-07-05 17:47, Ferruh Yigit: > > On 6/30/2016 1:00 PM, Christian Ehrhardt wrote: > > > + tac $(RTE_OUTPUT)/.config_tmp > > $(RTE_OUTPUT)/.config_tmp_reverse ; \ > > Now we are adding new binary dependency (tac) to build system > > tac can be replaced by sed '1!G;h;$!d' > >