From patchwork Tue Sep 7 15:33:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12478973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0908BC43219 for ; Tue, 7 Sep 2021 15:33:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D85F561051 for ; Tue, 7 Sep 2021 15:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345313AbhIGPet (ORCPT ); Tue, 7 Sep 2021 11:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345287AbhIGPep (ORCPT ); Tue, 7 Sep 2021 11:34:45 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2731DC061575 for ; Tue, 7 Sep 2021 08:33:39 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id i28so3835077wrb.2 for ; Tue, 07 Sep 2021 08:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G4hbnf4c8Zr+mX9xys1DDqIp7wq3Kh5Z16ScZwLcP2s=; b=KINB2vlg08bpKDN00jJ7pfDuGeHaZQb853ubxsqMUmnNhGFsN6Kaqbdw1eexkmNIpS iws97gphH2M5WHw2IjOrt+1g1yZEa4LvS5UDucxJup8k2nPwhuvOFz7Ph3ZiPtgSWW0q FJ4IqN6aasygQNZvhkcz4CjF+8LbC+VBORMk3H8SvtAOAYqaHojEznWCCfK9u72ZIrIB r5XLExE+fAwRw+W8FuAkfIv0buLWRfwXc5SWDpnhgOhsHJcME2Srb78OuxTN8za+0T4z YK8RKbuqcdmznQ6Aw9TBDoJzhzlGYwakdgBvorZHfl6QICOR4NUohEHd5yERRC2zYEdv Wdcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G4hbnf4c8Zr+mX9xys1DDqIp7wq3Kh5Z16ScZwLcP2s=; b=PMrU1k+OHtJl/L8aF+zIdhmIwLsjz71l3ihy/E0z0EWamoLRZoQcwa0RnA0YtIzRxG uvp7SGxGGP2OBSdgGaHJCI9jb3YXxfNeO8RagXc2UjkDLpUYGz2Tw8hfqrs5d10G2ff/ 0ZiKxsTpMkGCutz5Rfell1XJdX5knFVUjCQ6OZz3dFmE7ZSmgB4BA4wg6Nsh887fWNYq a0TtqQRkL2eQynLNNqHiS1s1fXxlpQXOzeX4UsE8OIoIyqs86giLRUfTlt5/j/Q7JSg+ JV6MP3kiandhU9Aym+HjYTTejsk3oQX67ss0hsISgj23kRKtZxQHk3LQUHwDPk5GYYPx 2IwQ== X-Gm-Message-State: AOAM532owYW2WjFYanvm+zq//qOzl0EEl5qJ1ZF4UfkuR3eOd2xPF39y wjgY0it+hV4ZlRZrc2KhPjyXii6PbnMKyg== X-Google-Smtp-Source: ABdhPJzD09WuE5iGmEnO93lIEERDg244K35mP3u3VRLv5Cl63Zvy0twWMDNEg7c+DXMMSGjXj2XeEQ== X-Received: by 2002:adf:f747:: with SMTP id z7mr19656738wrp.194.1631028817516; Tue, 07 Sep 2021 08:33:37 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id t64sm2568799wma.48.2021.09.07.08.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 08:33:37 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Andrzej Hunt , =?utf-8?b?TMOpbmHDr2MgSHVhcmQ=?= , Derrick Stolee , Felipe Contreras , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZyBEYW5o?= , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v4 2/3] CI: refactor "if" to "case" statement Date: Tue, 7 Sep 2021 17:33:30 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.818.gd2ef2916285 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Refactor an "if" statement for "linux-gcc" and "osx-gcc" to a "case" statement in preparation for another case being added to them. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 476c3f369f5..33b9777ab7e 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -184,13 +184,15 @@ export SKIP_DASHED_BUILT_INS=YesPlease case "$jobname" in linux-clang|linux-gcc) - if [ "$jobname" = linux-gcc ] - then + case "$jobname" in + linux-gcc) export CC=gcc-8 MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3" - else + ;; + *) MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2" - fi + ;; + esac export GIT_TEST_HTTPD=true @@ -207,13 +209,15 @@ linux-clang|linux-gcc) export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH" ;; osx-clang|osx-gcc) - if [ "$jobname" = osx-gcc ] - then + case "$jobname" in + osx-gcc) export CC=gcc-9 MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)" - else + ;; + *) MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python2)" - fi + ;; + esac # t9810 occasionally fails on Travis CI OS X # t9816 occasionally fails with "TAP out of sequence errors" on