From 5298ccb0eb9e05bc9d0ec71b7c1d5610b5164aca Mon Sep 17 00:00:00 2001 From: Diego Pino Date: Wed, 8 May 2024 06:13:24 +0200 Subject: Skip installing 'clang' if 'clang' binary already exists (#32242) Simply installing 'clang' installs the default version of Clang for Linux. For instance, the command: 'apt install clang' installs 'clang-14' in Ubuntu 22.04. It might be possible that a more recent version of clang is already installed in the system. For instance, package 'clang-17'. In the case a 'clang' binary is already installed in the system, skip the installation of 'clang'. --- python/servo/platform/linux.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/servo/platform/linux.py') diff --git a/python/servo/platform/linux.py b/python/servo/platform/linux.py index e382dbec0ec..6ed34ee9892 100644 --- a/python/servo/platform/linux.py +++ b/python/servo/platform/linux.py @@ -164,6 +164,11 @@ class Linux(Base): command = ['apt-get', 'install', "-m"] pkgs = APT_PKGS + # Skip 'clang' if 'clang' binary already exists. + result = subprocess.run(['which', 'clang'], capture_output=True) + if result and result.returncode == 0: + pkgs.remove('clang') + # Try to filter out unknown packages from the list. This is important for Debian # as it does not ship all of the packages we want. installable = subprocess.check_output(['apt-cache', '--generate', 'pkgnames']) -- cgit v1.2.3