From mboxrd@z Thu Jan 1 00:00:00 1970 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 249E43772 for ; Mon, 18 Jul 2016 15:54:49 +0200 (CEST) Received: by mail-qk0-f174.google.com with SMTP id p74so157353782qka.0 for ; Mon, 18 Jul 2016 06:54:49 -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=KcKwBcDblQst4iLBBq/8+P4eYfOD8FGTMEK7nOpmPic=; b=ZMxq/i4ejUCyz7cj0vs6NJDb/49iZZVQsQe1ISYv2CSWGbDu3bfC3m3vK77tKOEofB QwVtmfHSdSJD1lOilczW8bzbD+faclu72jegZ0cRFJybW0QNWv+CfS12BncQWQCB1VC3 58VkwqKPbc0C0nrW/e6QAxOq5Qb6rCXiYI2NrRuYJFp2uYHZ/zGn1znITxAioNoaetBt cndqC8w2LbcUm08/tgLu1sPLzEwHWzkAbTa7rKnX40pAIE7PkyzZFsPAdU5sBrKz+tfs pv0L/O157yAMU8OwC96ws27tn2fgotzWrZQwySLDmdlLSQtX3RK8gSB4F2SpUYI0hyDt Izdg== 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=KcKwBcDblQst4iLBBq/8+P4eYfOD8FGTMEK7nOpmPic=; b=LEZ5QB3uRrhkuoPig/pgG0ZIf/N0EvsCB0KV23qqJ+HLRiuAUw13+CB9X8RBghMlIb tW2dx26Z4/tAi7Lhfa6krY0g5juAYDp2tbsYMRX1oiMsUCjXajGk1ZIf8pSUgy2tCwSx xqhvPrw9d1SUO6OfOSCGp89QWsaFvvmBy6Rn52gDdf5lt65IsdGWPXAjciJci5cv4aGu ttGDtUCU4g4aRs0K2kASTGM1+Njl2MOKE/4M+L5rU4TdN0V8oBWECruFvT7T+YF7D9rt 5prlqHqQT4WWy2N1QQ2OOokaQzYJdkd3kPyCTAa2E7mWft5t+E24QYugQxa52XsdWFQd cZsg== X-Gm-Message-State: ALyK8tKoC91wZ/POU5a9M7x/SL2luCGlkcQUN9knFRX733xtNRhVOHACPFHBJng40Pml+kiFZ3zMqCtx8V2XeI9T X-Received: by 10.55.75.207 with SMTP id y198mr42119741qka.57.1468850088502; Mon, 18 Jul 2016 06:54:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.23.77 with HTTP; Mon, 18 Jul 2016 06:54:29 -0700 (PDT) In-Reply-To: References: <1468847463-107132-1-git-send-email-sergio.gonzalez.monroy@intel.com> <2323240.uRAlvIC4g0@xps13> From: Christian Ehrhardt Date: Mon, 18 Jul 2016 15:54:29 +0200 Message-ID: To: Sergio Gonzalez Monroy Cc: Thomas Monjalon , dev , Ferruh Yigit Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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:54:49 -0000 Hi Sergio, you might have seen that I had a similar version with awk in v2 IIRC. I also had the secondary tmp file just like you now. So, since it is so close to my old submission I wont object :-) Back then the discussion went for reduced build time dependencies and avoiding a second temp file, which was ok for me - so sed was chosen. I see that breaking on BSD causes us to rework it again, sorry that I was unable to test there. If you could come up with a Solution "sed + no-temp2 + noGNUspecifics" that would be great and solve everybodies needs. If not, it is a call up to the participants of the old discussion if not working on BSD outweighs their old feedback (I guess so). Most active in the discussion back then was Ferruh IIRC - setting to CC. Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Mon, Jul 18, 2016 at 3:39 PM, Sergio Gonzalez Monroy < sergio.gonzalez.monroy@intel.com> wrote: > On 18/07/2016 14:25, Thomas Monjalon wrote: > >> 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? >> > > Sorry, forgot to CC him. > > 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 >> > > Sure. > > Sergio >