# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/.
import subprocess
from mozfile import which
from mozboot.base import BaseBootstrapper from mozboot.linux_common import LinuxBootstrapper
def install_packages(self, packages): if self.version >= 33 and"perl"in packages:
packages.append("perl-FindBin") # watchman is not available on centos/rocky if self.distro in ("centos", "rocky", "oracle"):
packages = [p for p in packages if p != "watchman"]
self.dnf_install(*packages)
def upgrade_mercurial(self, current): if current isNone:
self.dnf_install("mercurial") else:
self.dnf_update("mercurial")
def dnf_install(self, *packages): if which("dnf"):
def not_installed(package): # We could check for "Error: No matching Packages to list", but # checking `dnf`s exit code is sufficent. # Ideally we'd invoke dnf with '--cacheonly', but there's: # https://bugzilla.redhat.com/show_bug.cgi?id=2030255
is_installed = subprocess.run(
["dnf", "list", "--installed", package],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
) if is_installed.returncode notin [0, 1]:
stdout = is_installed.stdout raise Exception(
f'Failed to determine whether package "{package}" is installed: "{stdout}"'
) return is_installed.returncode != 0
if self.no_interactive:
command.append("-y")
command.extend(packages)
self.run_as_root(command)
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.5Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.