diff options
author | Diego Pino <dpino@igalia.com> | 2024-05-08 06:13:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 04:13:24 +0000 |
commit | 5298ccb0eb9e05bc9d0ec71b7c1d5610b5164aca (patch) | |
tree | cbf17b051ef4a57424292195f660d5ee2dd95267 /python/servo/platform/linux.py | |
parent | 6a2e4a61f7272b02bcc93b05521e50b359357892 (diff) | |
download | servo-5298ccb0eb9e05bc9d0ec71b7c1d5610b5164aca.tar.gz servo-5298ccb0eb9e05bc9d0ec71b7c1d5610b5164aca.zip |
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'.
Diffstat (limited to 'python/servo/platform/linux.py')
-rw-r--r-- | python/servo/platform/linux.py | 5 |
1 files changed, 5 insertions, 0 deletions
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']) |