From patchwork Mon Jun 6 11:36:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Gongyi X-Patchwork-Id: 1639257 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LGs2X2GB4z9sG6 for ; Mon, 6 Jun 2022 21:38:59 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id A56ED3C8CCF for ; Mon, 6 Jun 2022 13:38:56 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 355ED3C1DB8 for ; Mon, 6 Jun 2022 13:38:53 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 1554660073B for ; Mon, 6 Jun 2022 13:38:51 +0200 (CEST) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LGs0C4tVyzfbVC for ; Mon, 6 Jun 2022 19:36:59 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.63) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 6 Jun 2022 19:38:46 +0800 To: Date: Mon, 6 Jun 2022 19:36:49 +0800 Message-ID: <20220606113649.41600-1-zhaogongyi@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.63] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] tst_kvercmp.sh: strip '+' when $(EXTRAVERSION) is blank X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Zhao Gongyi via ltp From: Zhao Gongyi Reply-To: Zhao Gongyi Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" $(EXTRAVERSION) defines an even tinier sublevel for pre-patches or additional patches. It is usually some non-numeric string such as "-pre4", and is often blank. When $(EXTRAVERSION) is blank, there may be a extra '+' which shoud be stripped. Signed-off-by: Zhao Gongyi Reviewed-by: Petr Vorel --- testcases/open_posix_testsuite/scripts/tst_kvercmp.sh | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh b/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh index 69466bb12..ce1d13c72 100755 --- a/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh +++ b/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh @@ -10,6 +10,7 @@ r1=$(echo ${ker_ver} | awk -F. '{print $1}') r2=$(echo ${ker_ver} | awk -F. '{print $2}') r3=$(echo ${ker_ver} | awk -F. '{print $3}') r3=${r3%%-*} +r3=${r3%%+*} test_ver=$(($1 * 65536 + $2 * 256 + $3)) curr_ver=$((${r1} * 65536 + ${r2} * 256 + ${r3}))