From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30B87A04F3 for ; Mon, 16 Dec 2019 20:16:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2A7B2B96; Mon, 16 Dec 2019 20:16:05 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id A899E330; Mon, 16 Dec 2019 20:16:02 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 034A322254; Mon, 16 Dec 2019 14:16:02 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 16 Dec 2019 14:16:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=02BdnzYPF0 1lyRQU/KpRJZ5A4C7sCCDJ5Zzy/rgJA4Y=; b=rOKAVjujBT1s2Gz+xZbcZ8AIop Ntche7H8DgzSGGmyzrSo6Z6OlCEW57w7AhgCwCvegbRh0ogMqx4T4ddPlukMNZgg fEArQAfe4YdZwGFm42AZMPVmDc3vtHoAYgA78ltxTM4JdwaXWkmBFEYd0f/DN33d XYGZ8bJ6lGRNwFoII= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=02BdnzYPF01lyRQU/KpRJZ5A4C7sCCDJ5Zzy/rgJA4Y=; b=uS65cmcX dUe30NgWF0HenydLU7JK2FawJcDdrKuJQIKxTwCT+mpfftGhihFXVm41RSX9IgEy fmGIs3ESfbTvviQkelIhlU1O2xAGshcWaKj78HN/y852p3A22wIbI+FdlfIjHGJt X60FS+U8kBT41me1lhqoGE0LUr9w2zG0XCKTOIsxrvfeDt5Q17F+OtukNTtsMjEt +447Quo4cPwTYarjuwKDe74C0v4bCHNRdoVZwUMMRI98RYBtObkC2/GmEu73zO62 tfQIrEhHqU3+JSVj1ZKIX4bqHhm+0pkkk5c0K3kK9yPcBE4uOJBVHN9hloU2xxpH i8V5J4w9DL72Dw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddthedguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc fkphepjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpeht hhhomhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C8EF830600B1; Mon, 16 Dec 2019 14:16:00 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: olivier.matz@6wind.com, stable@dpdk.org, Ali Alnubani , David Marchand Date: Mon, 16 Dec 2019 20:15:53 +0100 Message-Id: <20191216191553.1997116-1-thomas@monjalon.net> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191216162242.1898285-1-thomas@monjalon.net> References: <20191216162242.1898285-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] devtools: remove config backup after test build setup X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The config options are updated with sed and the short in-place option. In order to avoid creating a backup file when using sed in-place, the argument was tentatively set as an empty suffix. On Linux, the suffix argument is optional, without space or equal before. On FreeBSD, the suffix argument of the in-place option is mandatory. This argument cannot be an empty string if no space before. In GNU sed, 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 on Linux in the build directory. There is no common solution (without creating a function) to skip the backup file with GNU sed and BSD sed. It is solved by always creating a .config.tmp backup file which is removed at the end of the configuration. Fixes: 4a4a20c4775b ("devtools: support FreeBSD") Cc: olivier.matz@6wind.com Cc: stable@dpdk.org Reported-by: Ali Alnubani Signed-off-by: Thomas Monjalon --- v1: try removing = sign v2: do not skip backup file --- devtools/test-build.sh | 78 ++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/devtools/test-build.sh b/devtools/test-build.sh index 52305fbb8c..f451d91ad3 100755 --- a/devtools/test-build.sh +++ b/devtools/test-build.sh @@ -141,84 +141,86 @@ config () # echo 'Customize configuration' # Built-in options (lowercase) ! echo $3 | grep -q '+default' || \ - sed -ri="" 's,(RTE_MACHINE=")native,\1default,' $1/.config + sed -ri.tmp 's,(RTE_MACHINE=")native,\1default,' $1/.config echo $3 | grep -q '+next' || \ - sed -ri="" 's,(NEXT_ABI=)y,\1n,' $1/.config + sed -ri.tmp 's,(NEXT_ABI=)y,\1n,' $1/.config ! echo $3 | grep -q '+shared' || \ - sed -ri="" 's,(SHARED_LIB=)n,\1y,' $1/.config + sed -ri.tmp '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.tmp 's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config + sed -ri.tmp 's,(_DEBUG.*=)n,\1y,' $1/.config + sed -ri.tmp 's,(_STAT)([S_].*=|=)n,\1\2y,' $1/.config + sed -ri.tmp '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.tmp 's,(NUMA.*=)y,\1n,' $1/.config + sed -ri.tmp 's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config + sed -ri.tmp 's,(BYPASS=)n,\1y,' $1/.config test "$DPDK_DEP_ARCHIVE" != y || \ - sed -ri="" 's,(RESOURCE_TAR=)n,\1y,' $1/.config + sed -ri.tmp 's,(RESOURCE_TAR=)n,\1y,' $1/.config test "$DPDK_DEP_BPF" != y || \ - sed -ri="" 's,(PMD_AF_XDP=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_AF_XDP=)n,\1y,' $1/.config test "$DPDK_DEP_ISAL" != y || \ - sed -ri="" 's,(PMD_ISAL=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_ISAL=)n,\1y,' $1/.config test "$DPDK_DEP_MLX" != y || \ - sed -ri="" 's,(MLX._PMD=)n,\1y,' $1/.config + sed -ri.tmp 's,(MLX._PMD=)n,\1y,' $1/.config test "$DPDK_DEP_NFB" != y || \ - sed -ri="" 's,(NFB_PMD=)n,\1y,' $1/.config + sed -ri.tmp 's,(NFB_PMD=)n,\1y,' $1/.config test "$DPDK_DEP_SZE" != y || \ - sed -ri="" 's,(PMD_SZEDATA2=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_SZEDATA2=)n,\1y,' $1/.config test "$DPDK_DEP_ZLIB" != y || \ - sed -ri="" 's,(BNX2X_PMD=)n,\1y,' $1/.config + sed -ri.tmp 's,(BNX2X_PMD=)n,\1y,' $1/.config test "$DPDK_DEP_ZLIB" != y || \ - sed -ri="" 's,(PMD_ZLIB=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_ZLIB=)n,\1y,' $1/.config test "$DPDK_DEP_ZLIB" != y || \ - sed -ri="" 's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config + sed -ri.tmp 's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config test "$DPDK_DEP_PCAP" != y || \ - sed -ri="" 's,(PCAP=)n,\1y,' $1/.config + sed -ri.tmp 's,(PCAP=)n,\1y,' $1/.config test -z "$ARMV8_CRYPTO_LIB_PATH" || \ - sed -ri="" 's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config + sed -ri.tmp '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.tmp '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.tmp 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config test -z "$LIBSSO_SNOW3G_PATH" || \ - sed -ri="" 's,(PMD_SNOW3G=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_SNOW3G=)n,\1y,' $1/.config test -z "$LIBSSO_KASUMI_PATH" || \ - sed -ri="" 's,(PMD_KASUMI=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_KASUMI=)n,\1y,' $1/.config test -z "$LIBSSO_ZUC_PATH" || \ - sed -ri="" 's,(PMD_ZUC=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_ZUC=)n,\1y,' $1/.config test "$DPDK_DEP_SSL" != y || \ - sed -ri="" 's,(PMD_CCP=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_CCP=)n,\1y,' $1/.config test "$DPDK_DEP_SSL" != y || \ - sed -ri="" 's,(PMD_OPENSSL=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_OPENSSL=)n,\1y,' $1/.config test "$DPDK_DEP_SSL" != y || \ - sed -ri="" 's,(QAT_SYM=)n,\1y,' $1/.config + sed -ri.tmp '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.tmp 's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config + sed -ri.tmp 's,(SCHED_.*=)n,\1y,' $1/.config test -z "$LIBMUSDK_PATH" || \ - sed -ri="" 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config + sed -ri.tmp 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config test -z "$LIBMUSDK_PATH" || \ - sed -ri="" 's,(MVPP2_PMD=)n,\1y,' $1/.config + sed -ri.tmp 's,(MVPP2_PMD=)n,\1y,' $1/.config test -z "$LIBMUSDK_PATH" || \ - sed -ri="" 's,(MVNETA_PMD=)n,\1y,' $1/.config + sed -ri.tmp 's,(MVNETA_PMD=)n,\1y,' $1/.config test "$DPDK_DEP_ELF" != y || \ - sed -ri="" 's,(BPF_ELF=)n,\1y,' $1/.config + sed -ri.tmp 's,(BPF_ELF=)n,\1y,' $1/.config test "$DPDK_DEP_JSON" != y || \ - sed -ri="" 's,(TELEMETRY=)n,\1y,' $1/.config + sed -ri.tmp '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.tmp "s,($pattern=)y,\1n," $1/.config elif echo $option | grep -q '^+' ; then - sed -ri="" "s,($pattern=)n,\1y," $1/.config + sed -ri.tmp "s,($pattern=)n,\1y," $1/.config fi done + + rm -f $1/.config.tmp fi } -- 2.24.0