From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBF83C282DD for ; Thu, 23 May 2019 10:47:30 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 77E1C20851 for ; Thu, 23 May 2019 10:47:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77E1C20851 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED2C5493D; Thu, 23 May 2019 12:47:28 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1D46014EC for ; Thu, 23 May 2019 12:47:26 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 03:47:26 -0700 X-ExtLoop1: 1 Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.96]) by orsmga004.jf.intel.com with SMTP; 23 May 2019 03:47:23 -0700 Received: by (sSMTP sendmail emulation); Thu, 23 May 2019 11:47:23 +0100 Date: Thu, 23 May 2019 11:47:22 +0100 From: Bruce Richardson To: Olivier Matz Cc: dev@dpdk.org, Thomas Monjalon Message-ID: <20190523104722.GA1374@bricha3-MOBL.ger.corp.intel.com> References: <20190523074318.29044-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190523074318.29044-1-olivier.matz@6wind.com> User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH] devtools: better freebsd support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, May 23, 2019 at 09:43:18AM +0200, Olivier Matz wrote: > - As "readlink -e" and "readlink -m" do not exist on freebsd, > use "readlink -f", it should not have any impact in these cases. > - "sed -ri" is invalid on freebsd and should be replaced by > "sed -r -i ''" > - Use gmake instead of make. > > This fixes the following command: > SYSDIR=/usr/src/sys ./devtools/test-build.sh \ > -j4 x86_64-native-freebsd-gcc > > Signed-off-by: Olivier Matz > --- > devtools/check-dup-includes.sh | 2 +- > devtools/checkpatches.sh | 8 ++-- > devtools/get-maintainer.sh | 2 +- > devtools/load-devel-config | 4 +- > devtools/test-build.sh | 98 +++++++++++++++++++++++------------------- > devtools/validate-abi.sh | 2 +- > 6 files changed, 62 insertions(+), 54 deletions(-) > > > +sed_ri () { > + sed --version >/dev/null 2>&1 && sed -ri "$@" || sed -r -i "" "$@" > +} Two comments here: 1. if being kept, this function needs a comment to explain the how and why of it. I assume, from testing sed on linux and BSD, that you are taking advantage of the fact that BSD sed doesn't support "--version" flag and using that to select which path to take? 2. I'm not sure we really need this, or if so, it possibly can be shortened. My tests show that using the syntax "i=" works on both OS's, i.e. sed -ri="" "$@". Given that the only change to existing calls to sed is the addition of '=""', a whole new function may not be needed. /Bruce