From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 25866A04F0;
	Mon, 16 Dec 2019 17:22:59 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id BD6AC1D9E;
	Mon, 16 Dec 2019 17:22:58 +0100 (CET)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 51498330;
 Mon, 16 Dec 2019 17:22:57 +0100 (CET)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 840B121D73;
 Mon, 16 Dec 2019 11:22:55 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Mon, 16 Dec 2019 11:22:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding; s=mesmtp; bh=t7fXQtmWyUPvfWti2fjn1f+
 V5LPy2K8II3Jum69WRNU=; b=J50+k0HDv6L9ySvicZKFELWV7fdGoHoWQ+XhqaY
 mR45r/ac3l8GPDlPNrnjziLVByJkt8Iw2bdzH2E1GwhQxU9gSeeuwCBue9mUyRIl
 YbyhMS4BOAPydi+uXvdaa2NzfvNeFLS9CnEqYVUpdC7TSZwscft3jqQsXBhFCe0L
 IesU=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:date:from
 :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=t7fXQtmWyUPvfWti2
 fjn1f+V5LPy2K8II3Jum69WRNU=; b=KyWMKbv2x67/XS63pDszvNMIz517QKEze
 W5VLJ6OBE/KeQa2s9wnWSa978ZVdrs6aC7T/k+Z8Nslt8MGy4BH0DFzU0Fcl8sRq
 WbmKjH7s6XdT8k/ofEKpfyhPYPudrfDu6XCX0cRZG6Hvc7oifCcYsd+dINB3m177
 xUM+nLX0AH8sScezCW9DRO9PhrzcuRWesd/KYg8W5frQK9x6hhMmoMaDOjmP+4/f
 kf6+MDeMgf/DCjUAke5UrrzRUra9Sd1tPe8H3wiDkLoKVVYWbOgQND27b/KwBmwo
 HlZzi/Ap0nyX2qqSMf1Ql4ND9L5ccW928wQFoZibGjds9fFo3dy3Q==
X-ME-Sender: <xms:Xq_3XUWiexSRO2ZqdIThJ0IQu0cJjJCgSbm9UMVODarncO-SfYKYmw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddthedgkeekucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu
 ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuffhomh
 grihhnpehfrhgvvggsshgurdhorhhgnecukfhppeejjedrudefgedrvddtfedrudekgeen
 ucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
 enucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:Xq_3Xev_PsYE9051Wxklx3IC_3PffZkI8rR5sdLW0CWFKmL4GnDckQ>
 <xmx:Xq_3XbFpv7NrQIx0nTex3p7w8z6U7V-Nu4lxqONqI_PyFJ_4F2KVmg>
 <xmx:Xq_3XRIV_L6NBHl0krWzqio3cpRXG0lBzGZ62Xq7yrAivSODHfDiBw>
 <xmx:X6_3Xb2t65nCl8Kudy-4-3CtvIRioR--mbToZ7CdTqUmySFSyHr9zA>
Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 086968005B;
 Mon, 16 Dec 2019 11:22:53 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: olivier.matz@6wind.com, stable@dpdk.org,
 Ali Alnubani <alialnu@mellanox.com>,
 David Marchand <david.marchand@redhat.com>
Date: Mon, 16 Dec 2019 17:22:42 +0100
Message-Id: <20191216162242.1898285-1-thomas@monjalon.net>
X-Mailer: git-send-email 2.24.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH] devtools: avoid config backup during test build
	setup
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

The config options are updated with sed and the short inline option.
In FreeBSD, the suffix argument of the inline option is mandatory.
In order to avoid creating a backup file when using sed inline,
the argument is set as an empty suffix.

The short option '-i' does not expect '=' before the suffix argument,
so it understands '=' as the file suffix.
As a consequence, a backup file named '.config=' was created
in the build directory.

Removing the '=' sign while keeping an empty suffix
avoids creating a backup file.

Fixes: 4a4a20c4775b ("devtools: support FreeBSD")
Cc: olivier.matz@6wind.com
Cc: stable@dpdk.org

Reported-by: Ali Alnubani <alialnu@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---

This patch does not work on FreeBSD.
Does it mean the equal sign is required on FreeBSD?
This is not what I see on the documentation:
https://www.freebsd.org/cgi/man.cgi?query=sed&sektion=&n=1

---
 devtools/test-build.sh | 76 +++++++++++++++++++++---------------------
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 52305fbb8c..8b6e484a8e 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -141,82 +141,82 @@ config () # <directory> <target> <options>
 		echo 'Customize configuration'
 		# Built-in options (lowercase)
 		! echo $3 | grep -q '+default' || \
-		sed -ri="" 's,(RTE_MACHINE=")native,\1default,' $1/.config
+		sed -ri'' 's,(RTE_MACHINE=")native,\1default,' $1/.config
 		echo $3 | grep -q '+next' || \
-		sed -ri=""           's,(NEXT_ABI=)y,\1n,' $1/.config
+		sed -ri''           's,(NEXT_ABI=)y,\1n,' $1/.config
 		! echo $3 | grep -q '+shared' || \
-		sed -ri=""         's,(SHARED_LIB=)n,\1y,' $1/.config
+		sed -ri''         's,(SHARED_LIB=)n,\1y,' $1/.config
 		! echo $3 | grep -q '+debug' || ( \
-		sed -ri=""  's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
-		sed -ri=""           's,(_DEBUG.*=)n,\1y,' $1/.config
-		sed -ri=""  's,(_STAT)([S_].*=|=)n,\1\2y,' $1/.config
-		sed -ri="" 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
+		sed -ri'' 's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
+		sed -ri''           's,(_DEBUG.*=)n,\1y,' $1/.config
+		sed -ri''  's,(_STAT)([S_].*=|=)n,\1\2y,' $1/.config
+		sed -ri'' 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
 
 		# Automatic configuration
 		test "$DPDK_DEP_NUMA" != n || \
-		sed -ri=""             's,(NUMA.*=)y,\1n,' $1/.config
-		sed -ri=""    's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
-		sed -ri=""             's,(BYPASS=)n,\1y,' $1/.config
+		sed -ri''             's,(NUMA.*=)y,\1n,' $1/.config
+		sed -ri''    's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
+		sed -ri''             's,(BYPASS=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ARCHIVE" != y || \
-		sed -ri=""       's,(RESOURCE_TAR=)n,\1y,' $1/.config
+		sed -ri''       's,(RESOURCE_TAR=)n,\1y,' $1/.config
 		test "$DPDK_DEP_BPF" != y || \
-		sed -ri=""         's,(PMD_AF_XDP=)n,\1y,' $1/.config
+		sed -ri''         's,(PMD_AF_XDP=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ISAL" != y || \
-		sed -ri=""           's,(PMD_ISAL=)n,\1y,' $1/.config
+		sed -ri''           's,(PMD_ISAL=)n,\1y,' $1/.config
 		test "$DPDK_DEP_MLX" != y || \
-		sed -ri=""           's,(MLX._PMD=)n,\1y,' $1/.config
+		sed -ri''           's,(MLX._PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_NFB" != y || \
-		sed -ri=""            's,(NFB_PMD=)n,\1y,' $1/.config
+		sed -ri''            's,(NFB_PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SZE" != y || \
-		sed -ri=""       's,(PMD_SZEDATA2=)n,\1y,' $1/.config
+		sed -ri''       's,(PMD_SZEDATA2=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ZLIB" != y || \
-		sed -ri=""          's,(BNX2X_PMD=)n,\1y,' $1/.config
+		sed -ri''          's,(BNX2X_PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ZLIB" != y || \
-		sed -ri=""           's,(PMD_ZLIB=)n,\1y,' $1/.config
+		sed -ri''           's,(PMD_ZLIB=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ZLIB" != y || \
-		sed -ri=""   's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
+		sed -ri''   's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
 		test "$DPDK_DEP_PCAP" != y || \
-		sed -ri=""               's,(PCAP=)n,\1y,' $1/.config
+		sed -ri''               's,(PCAP=)n,\1y,' $1/.config
 		test -z "$ARMV8_CRYPTO_LIB_PATH" || \
-		sed -ri=""   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
+		sed -ri''   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
 		test "$DPDK_DEP_IPSEC_MB" != y || \
-		sed -ri=""       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
+		sed -ri''       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
 		test "$DPDK_DEP_IPSEC_MB" != y || \
-		sed -ri=""      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
+		sed -ri''      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
 		test -z "$LIBSSO_SNOW3G_PATH" || \
-		sed -ri=""         's,(PMD_SNOW3G=)n,\1y,' $1/.config
+		sed -ri''         's,(PMD_SNOW3G=)n,\1y,' $1/.config
 		test -z "$LIBSSO_KASUMI_PATH" || \
-		sed -ri=""         's,(PMD_KASUMI=)n,\1y,' $1/.config
+		sed -ri''         's,(PMD_KASUMI=)n,\1y,' $1/.config
 		test -z "$LIBSSO_ZUC_PATH" || \
-		sed -ri=""            's,(PMD_ZUC=)n,\1y,' $1/.config
+		sed -ri''            's,(PMD_ZUC=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SSL" != y || \
-		sed -ri=""            's,(PMD_CCP=)n,\1y,' $1/.config
+		sed -ri''            's,(PMD_CCP=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SSL" != y || \
-		sed -ri=""        's,(PMD_OPENSSL=)n,\1y,' $1/.config
+		sed -ri''        's,(PMD_OPENSSL=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SSL" != y || \
-		sed -ri=""            's,(QAT_SYM=)n,\1y,' $1/.config
+		sed -ri''            's,(QAT_SYM=)n,\1y,' $1/.config
 		test -z "$FLEXRAN_SDK" || \
-		sed -ri=""     's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
-		sed -ri=""           's,(SCHED_.*=)n,\1y,' $1/.config
+		sed -ri''     's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
+		sed -ri''           's,(SCHED_.*=)n,\1y,' $1/.config
 		test -z "$LIBMUSDK_PATH" || \
-		sed -ri=""   's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
+		sed -ri''   's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
 		test -z "$LIBMUSDK_PATH" || \
-		sed -ri=""          's,(MVPP2_PMD=)n,\1y,' $1/.config
+		sed -ri''          's,(MVPP2_PMD=)n,\1y,' $1/.config
 		test -z "$LIBMUSDK_PATH" || \
-		sed -ri=""         's,(MVNETA_PMD=)n,\1y,' $1/.config
+		sed -ri''         's,(MVNETA_PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ELF" != y || \
-		sed -ri=""            's,(BPF_ELF=)n,\1y,' $1/.config
+		sed -ri''            's,(BPF_ELF=)n,\1y,' $1/.config
 		test "$DPDK_DEP_JSON" != y || \
-		sed -ri=""          's,(TELEMETRY=)n,\1y,' $1/.config
+		sed -ri''          's,(TELEMETRY=)n,\1y,' $1/.config
 		build_config_hook $1 $2 $3
 
 		# Explicit enabler/disabler (uppercase)
 		for option in $(echo $3 | sed 's,[~+], &,g') ; do
 			pattern=$(echo $option | cut -c2-)
 			if echo $option | grep -q '^~' ; then
-				sed -ri="" "s,($pattern=)y,\1n," $1/.config
+				sed -ri'' "s,($pattern=)y,\1n," $1/.config
 			elif echo $option | grep -q '^+' ; then
-				sed -ri="" "s,($pattern=)n,\1y," $1/.config
+				sed -ri'' "s,($pattern=)n,\1y," $1/.config
 			fi
 		done
 	fi
-- 
2.24.0