Backed out changeset 0db8bd8fbcad (bug 1127565) for linting failure at /builds/worker/checkouts/gecko/python/mozboot/mozboot/bootstrap.py:302:9

This commit is contained in:
Daniel Varga 2018-11-26 22:35:02 +02:00
parent 799fa314cc
commit 5428f49924
3 changed files with 1 additions and 162 deletions

View File

@ -68,7 +68,7 @@ the $PATH environment variable.
We recommend the following tools for installing Python:
pyenv -- https://github.com/yyuu/pyenv
pyenv -- https://github.com/yyuu/pyenv)
pythonz -- https://github.com/saghul/pythonz
official installers -- http://www.python.org/
'''

View File

@ -24,7 +24,6 @@ except ImportError:
# list in bin/bootstrap.py!
from mozboot.base import MODERN_RUST_VERSION
from mozboot.centosfedora import CentOSFedoraBootstrapper
from mozboot.opensuse import OpenSUSEBootstrapper
from mozboot.debian import DebianBootstrapper
from mozboot.freebsd import FreeBSDBootstrapper
from mozboot.gentoo import GentooBootstrapper
@ -262,8 +261,6 @@ class Bootstrapper(object):
elif os.path.exists('/etc/arch-release'):
# Even on archlinux, platform.linux_distribution() returns ['','','']
cls = ArchlinuxBootstrapper
elif os.path.exists('/etc/SUSE-brand'):
cls = OpenSUSEBootstrapper
else:
raise NotImplementedError('Bootstrap support for this Linux '
'distro not yet available.')
@ -298,7 +295,6 @@ class Bootstrapper(object):
raise NotImplementedError('Bootstrap support is not yet available '
'for your OS.')
self.instance = cls(**args)
def input_clone_dest(self, with_hg=True):

View File

@ -1,157 +0,0 @@
# 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/.
from __future__ import absolute_import, print_function
import os
import sys
import tempfile
import subprocess
import glob
from mozboot.base import BaseBootstrapper
from mozboot.linux_common import NodeInstall, StyloInstall
class OpenSUSEBootstrapper(NodeInstall, StyloInstall, BaseBootstrapper):
'''openSUSE experimental bootstrapper.'''
SYSTEM_PACKAGES = [
'autoconf213',
'nodejs',
'npm',
'which',
'python-devel',
'rpmconf',
'libcurl-devel',
]
BROWSER_PACKAGES = [
'alsa-devel',
'gcc-c++',
'python2-dbus-python',
'gtk3-devel',
'dbus-1-glib-devel',
'gconf2-devel',
'glibc-devel-static',
'libstdc++-devel',
'libXt-devel',
'libproxy-devel',
'libuuid-devel',
'yasm',
'gtk2-devel',
'clang-devel',
'patterns-gnome-devel_gnome',
]
BROWSER_GROUP_PACKAGES = [
'devel_C_C++',
'devel_gnome',
]
MOBILE_ANDROID_COMMON_PACKAGES = [
'java-1_8_0-openjdk',
'wget',
]
def __init__(self, version, dist_id, **kwargs):
print('Using an experimental bootstrapper for openSUSE.')
BaseBootstrapper.__init__(self, **kwargs)
def install_system_packages(self):
self.zypper_install(*self.SYSTEM_PACKAGES)
def install_browser_packages(self):
self.ensure_browser_packages()
def install_browser_group_packages(self):
self.ensure_browser_group_packages()
def install_browser_artifact_mode_packages(self):
self.ensure_browser_packages(artifact_mode=True)
def install_mobile_android_packages(self):
self.ensure_mobile_android_packages()
def install_mobile_android_artifact_mode_packages(self):
self.ensure_mobile_android_packages(artifact_mode=True)
def ensure_browser_packages(self, artifact_mode=False):
# TODO: Figure out what not to install for artifact mode
#self.aur_install(*self.BROWSER_AUR_PACKAGES)
self.zypper_install(*self.BROWSER_PACKAGES)
def ensure_browser_group_packages(self, artifact_mode=False):
# TODO: Figure out what not to install for artifact mode
#self.aur_install(*self.BROWSER_AUR_PACKAGES)
self.zypper_patterninstall(*self.BROWSER_GROUP_PACKAGES)
def ensure_mobile_android_packages(self, artifact_mode=False):
# Multi-part process:
# 1. System packages.
# 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages.
# 1. This is hard to believe, but the Android SDK binaries are 32-bit
# and that conflicts with 64-bit Arch installations out of the box. The
# solution is to add the multilibs repository; unfortunately, this
# requires manual intervention.
try:
self.zypper_install(*self.MOBILE_ANDROID_COMMON_PACKAGES)
except Exception as e:
print('Failed to install all packages. The Android developer '
'toolchain requires 32 bit binaries be enabled')
raise e
# 2. Android pieces.
from mozboot import android
android.ensure_android('linux', artifact_mode=artifact_mode,
no_interactive=self.no_interactive)
def suggest_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android
android.suggest_mozconfig('linux', artifact_mode=artifact_mode)
def suggest_mobile_android_artifact_mode_mozconfig(self):
self.suggest_mobile_android_mozconfig(artifact_mode=True)
def _update_package_manager(self):
self.zypper_update
def upgrade_mercurial(self, current):
self.zypper_install('mercurial')
def upgrade_python(self, current):
self.zypper_install('python2')
def zypper_install(self, *packages):
command = ['zypper', 'install']
if self.no_interactive:
command.append('-n')
command.extend(packages)
self.run_as_root(command)
def zypper_update(self):
command = ['zypper', 'update']
self.run_as_root(command)
def zypper_update(self, *packages):
command = ['zypper', 'update']
if self.no_interactive:
command.append('-n')
command.extend(packages)
self.run_as_root(command)
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)