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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D29FDC433F5 for ; Thu, 18 Nov 2021 03:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8D7C61B54 for ; Thu, 18 Nov 2021 03:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242641AbhKRDNl (ORCPT ); Wed, 17 Nov 2021 22:13:41 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:40606 "EHLO dcvr.yhbt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242676AbhKRDNS (ORCPT ); Wed, 17 Nov 2021 22:13:18 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 753EA1FA00; Thu, 18 Nov 2021 03:10:16 +0000 (UTC) From: Eric Wong To: io-uring@vger.kernel.org Cc: Liu Changcheng , Stefan Metzmacher Subject: [PATCH v2 1/7] make-debs: fix version detection Date: Thu, 18 Nov 2021 03:10:10 +0000 Message-Id: <20211118031016.354105-2-e@80x24.org> In-Reply-To: <20211118031016.354105-1-e@80x24.org> References: <20211118031016.354105-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org `head -l' is not supported on my version of head(1) on Debian buster nor bullseye (and AFAIK, not any version of head(1). Furthermore, head(1) is not required at all since sed(1) can limit operations to any line. Since this is a bash script, we'll also use "set -o pipefail" to ensure future errors of this type are caught. Signed-off-by: Eric Wong --- make-debs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make-debs.sh b/make-debs.sh index 01d563c..136b79e 100755 --- a/make-debs.sh +++ b/make-debs.sh @@ -16,6 +16,7 @@ # along with this program. If not, see . # set -xe +set -o pipefail # Create dir for build base=${1:-/tmp/release} @@ -38,7 +39,7 @@ cd ${releasedir}/${outfile} git clean -dxf # Change changelog if it's needed -cur_ver=`head -l debian/changelog | sed -n -e 's/.* (\(.*\)) .*/\1/p'` +cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog) if [ "$cur_ver" != "$version-1" ]; then dch -D $codename --force-distribution -b -v "$version-1" "new version" fi