mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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'.
This commit is contained in:
parent
6a2e4a61f7
commit
5298ccb0eb
1 changed files with 5 additions and 0 deletions
|
@ -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'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue