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 CD3EEC433F5 for ; Tue, 16 Nov 2021 22:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2E2D615E1 for ; Tue, 16 Nov 2021 22:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbhKPW4e (ORCPT ); Tue, 16 Nov 2021 17:56:34 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:43770 "EHLO dcvr.yhbt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbhKPW4d (ORCPT ); Tue, 16 Nov 2021 17:56:33 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7B1001F9F4; Tue, 16 Nov 2021 22:44:56 +0000 (UTC) From: Eric Wong To: io-uring@vger.kernel.org Cc: Liu Changcheng , Stefan Metzmacher Subject: [PATCH 1/4] make-debs: fix version detection Date: Tue, 16 Nov 2021 22:44:53 +0000 Message-Id: <20211116224456.244746-2-e@80x24.org> In-Reply-To: <20211116224456.244746-1-e@80x24.org> References: <20211116224456.244746-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