]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: install python on ubuntu
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Fri, 25 Nov 2022 09:59:54 +0000 (17:59 +0800)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 12 Mar 2023 19:31:54 +0000 (20:31 +0100)
Python is missing from the default ubuntu-22.04 runner image, which
prevents git-p4 from working. To install python on ubuntu, we need
to provide the correct package names:

 * On Ubuntu 18.04 (bionic), "/usr/bin/python2" is provided by the
   "python" package, and "/usr/bin/python3" is provided by the "python3"
   package.

 * On Ubuntu 20.04 (focal) and above, "/usr/bin/python2" is provided by
   the "python2" package which has a different name from bionic, and
   "/usr/bin/python3" is provided by "python3".

Since the "ubuntu-latest" runner image has a higher version, its
safe to use "python2" or "python3" package name.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/install-dependencies.sh
ci/lib.sh

index 19c5e8735d727a759990e8dc5f63c008a93b85ca..2d544271751556a16338b8a80a81b1829d813667 100755 (executable)
@@ -16,7 +16,7 @@ linux-clang|linux-gcc)
        sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
        sudo apt-get -q update
        sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
-               $UBUNTU_COMMON_PKGS
+               $UBUNTU_COMMON_PKGS $PYTHON_PACKAGE
        case "$jobname" in
        linux-gcc)
                sudo apt-get -q -y install gcc-8
index 6c1476643122917e044acac6fbcd850c3fa628c8..702ea96a3843b3690a80d14c817a678cf504729d 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -184,13 +184,13 @@ export SKIP_DASHED_BUILT_INS=YesPlease
 
 case "$jobname" in
 linux-clang|linux-gcc)
+       PYTHON_PACKAGE=python2
        if [ "$jobname" = linux-gcc ]
        then
                export CC=gcc-8
-               MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3"
-       else
-               MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2"
+               PYTHON_PACKAGE=python3
        fi
+       MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
 
        export GIT_TEST_HTTPD=true