Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorJiang Xin <zhiyou.jx@alibaba-inc.com>2022-11-25 12:59:54 +0300
committerJunio C Hamano <gitster@pobox.com>2022-11-27 03:33:43 +0300
commit0d3507f3e7b74ccbaa6f1ddc282cf467cce0e102 (patch)
tree86d39a626db4f7ec673b363a05e47c8666c97aef /ci
parent31a1952bbd2e24e1bdcb3c29dcc38420b9a30b04 (diff)
ci: install python on ubuntu
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>
Diffstat (limited to 'ci')
-rwxr-xr-xci/install-dependencies.sh2
-rwxr-xr-xci/lib.sh8
2 files changed, 5 insertions, 5 deletions
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index b569893b38..d8fafc8ed2 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -15,7 +15,7 @@ case "$runs_on_pool" in
ubuntu-*)
sudo apt-get -q update
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
- $UBUNTU_COMMON_PKGS $CC_PACKAGE
+ $UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
mkdir --parents "$P4_PATH"
pushd "$P4_PATH"
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
diff --git a/ci/lib.sh b/ci/lib.sh
index 39d07f9788..fe37e87807 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -232,12 +232,12 @@ ubuntu-*)
break
fi
- if [ "$jobname" = linux-gcc ]
+ PYTHON_PACKAGE=python2
+ if test "$jobname" = linux-gcc
then
- 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