0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 13:43:04 -05:00

update tumbleweed-bootstrap.patch

This commit is contained in:
Malte Jürgens 2022-07-21 16:07:17 +02:00
parent 4f71037be4
commit 10cafdb5ef
No known key found for this signature in database
GPG key ID: D29FBD5F93C0CFC3

View file

@ -1,14 +1,32 @@
--- a/python/mozboot/mozboot/opensuse.py --- a/python/mozboot/mozboot/opensuse.py
+++ b/python/mozboot/mozboot/opensuse.py +++ b/python/mozboot/mozboot/opensuse.py
@@ -16,6 +16,7 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper): @@ -4,18 +4,22 @@
"rpmconf",
from __future__ import absolute_import, print_function, unicode_literals
-from mozboot.base import BaseBootstrapper
+from mozboot.base import BaseBootstrapper, MERCURIAL_INSTALL_PROMPT
from mozboot.linux_common import LinuxBootstrapper
+import distro
+import subprocess
+
class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
"""openSUSE experimental bootstrapper."""
SYSTEM_PACKAGES = [
- "which",
- "rpmconf",
"libcurl-devel", "libcurl-devel",
"libpulse-devel", "libpulse-devel",
+ "rpmconf",
+ "which",
+ "unzip", + "unzip",
] ]
BROWSER_PACKAGES = [ BROWSER_PACKAGES = [
@@ -23,7 +24,6 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper): @@ -23,7 +27,6 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
"gcc-c++", "gcc-c++",
"gtk3-devel", "gtk3-devel",
"dbus-1-glib-devel", "dbus-1-glib-devel",
@ -16,42 +34,117 @@
"glibc-devel-static", "glibc-devel-static",
"libstdc++-devel", "libstdc++-devel",
"libXt-devel", "libXt-devel",
@@ -97,29 +97,19 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper): @@ -33,6 +36,10 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
self(["pip3", "install", "--upgrade", "pip", "--user"]) "patterns-gnome-devel_gnome",
self(["pip3", "install", "--upgrade", "Mercurial", "--user"]) ]
+ OPTIONAL_BROWSER_PACKAGES = [
+ "gconf2-devel", # https://bugzilla.mozilla.org/show_bug.cgi?id=1779931
+ ]
+
BROWSER_GROUP_PACKAGES = ["devel_C_C++", "devel_gnome"]
MOBILE_ANDROID_COMMON_PACKAGES = ["java-1_8_0-openjdk"]
@@ -46,7 +53,18 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
def install_browser_packages(self, mozconfig_builder, artifact_mode=False):
# TODO: Figure out what not to install for artifact mode
- self.zypper_install(*self.BROWSER_PACKAGES)
+ packages_to_install = self.BROWSER_PACKAGES.copy()
+
+ for package in self.OPTIONAL_BROWSER_PACKAGES:
+ if self.zypper_can_install(package):
+ packages_to_install.append(package)
+ else:
+ print(
+ f"WARNING! zypper cannot find a package for '{package}' for {distro.name(True)}. "
+ "It will not be automatically installed."
+ )
+
+ self.zypper_install(*packages_to_install)
def install_browser_group_packages(self):
self.ensure_browser_group_packages()
@@ -54,10 +72,6 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
def install_browser_artifact_mode_packages(self, mozconfig_builder):
self.install_browser_packages(mozconfig_builder, artifact_mode=True)
- def install_mercurial(self):
- self(["pip", "install", "--upgrade", "pip", "--user"])
- self(["pip", "install", "--upgrade", "Mercurial", "--user"])
-
def ensure_clang_static_analysis_package(self):
from mozboot import static_analysis
@@ -91,35 +105,51 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
)
def _update_package_manager(self):
- self.zypper_update
+ self.zypper_update()
def upgrade_mercurial(self, current):
- self(["pip3", "install", "--upgrade", "pip", "--user"])
- self(["pip3", "install", "--upgrade", "Mercurial", "--user"])
-
- def zypper_install(self, *packages): - def zypper_install(self, *packages):
- command = ["zypper", "install"] - command = ["zypper", "install"]
+ def zypper(self, *args): + """Install Mercurial from pip because system packages could lag."""
if self.no_interactive: if self.no_interactive:
- command.append("-n") - command.append("-n")
- + # Install via zypper in non-interactive mode because it is the more
+ # conservative option and less likely to make people upset.
+ self.zypper_install("mercurial")
+ return
- command.extend(packages) - command.extend(packages)
+ res = self.prompt_int(MERCURIAL_INSTALL_PROMPT, 1, 3)
- self.run_as_root(command)
+ # zypper.
+ if res == 2:
+ self.zypper_install("mercurial")
+ return False
- def zypper_update(self, *packages):
- command = ["zypper", "update"]
- if self.no_interactive:
- command.append("-n")
+ # No Mercurial.
+ if res == 3:
+ print("Not installing Mercurial.")
+ return False
+
+ # pip.
+ assert res == 1
+ self.run_as_root(["pip3", "install", "--upgrade", "Mercurial"])
- command.extend(packages)
+ def zypper(self, *args):
+ if self.no_interactive:
+ command = ["zypper", "-n", *args] + command = ["zypper", "-n", *args]
+ else: + else:
+ command = ["zypper", *args] + command = ["zypper", *args]
self.run_as_root(command) self.run_as_root(command)
- def zypper_update(self, *packages): - def zypper_patterninstall(self, *packages):
- command = ["zypper", "update"] - command = ["zypper", "install", "-t", "pattern"]
- if self.no_interactive: - if self.no_interactive:
- command.append("-n") - command.append("-y")
-
- command.extend(packages)
+ def zypper_install(self, *packages): + def zypper_install(self, *packages):
+ self.zypper("install", *packages) + self.zypper("install", *packages)
- command.extend(packages)
+ def zypper_can_install(self, package):
+ return (
+ subprocess.call(["zypper", "search", package], stdout=subprocess.DEVNULL)
+ == 0
+ )
- self.run_as_root(command) - self.run_as_root(command)
+ def zypper_update(self, *packages): + def zypper_update(self, *packages):
+ self.zypper("update", *packages) + self.zypper("update", *packages)
+
def zypper_patterninstall(self, *packages): + def zypper_patterninstall(self, *packages):
- command = ["zypper", "install", "-t", "pattern"]
- if self.no_interactive:
- command.append("-y")
-
- command.extend(packages)
-
- self.run_as_root(command)
+ self.zypper("install", "-t", "pattern", *packages) + self.zypper("install", "-t", "pattern", *packages)