diff --git a/src/D190537.patch b/src/D190537.patch new file mode 100644 index 0000000..593e4c8 --- /dev/null +++ b/src/D190537.patch @@ -0,0 +1,91 @@ +diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py +--- a/python/mozboot/mozboot/base.py ++++ b/python/mozboot/mozboot/base.py +@@ -168,17 +168,10 @@ + Called once the current firefox checkout has been detected. + Platform-specific implementations should check the environment and offer advice/warnings + to the user, if necessary. + """ + +- def suggest_install_distutils(self): +- """Called if distutils.{sysconfig,spawn} can't be imported.""" +- print( +- "Does your distro require installing another package for distutils?", +- file=sys.stderr, +- ) +- + def suggest_install_pip3(self): + """Called if pip3 can't be found.""" + print( + "Try installing pip3 with your system's package manager.", file=sys.stderr + ) +diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py +--- a/python/mozboot/mozboot/bootstrap.py ++++ b/python/mozboot/mozboot/bootstrap.py +@@ -490,26 +490,10 @@ + # No mozconfig file exists yet + self._write_default_mozconfig(raw_mozconfig) + + def _validate_python_environment(self, topsrcdir): + valid = True +- try: +- # distutils is singled out here because some distros (namely Ubuntu) +- # include it in a separate package outside of the main Python +- # installation. +- import distutils.spawn +- import distutils.sysconfig +- +- assert distutils.sysconfig is not None and distutils.spawn is not None +- except ImportError as e: +- print("ERROR: Could not import package %s" % e.name, file=sys.stderr) +- self.instance.suggest_install_distutils() +- valid = False +- except AssertionError: +- print("ERROR: distutils is not behaving as expected.", file=sys.stderr) +- self.instance.suggest_install_distutils() +- valid = False + pip3 = to_optional_path(which("pip3")) + if not pip3: + print("ERROR: Could not find pip3.", file=sys.stderr) + self.instance.suggest_install_pip3() + valid = False +diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py +--- a/python/mozboot/mozboot/debian.py ++++ b/python/mozboot/mozboot/debian.py +@@ -15,17 +15,10 @@ + self.distro = distro + self.version = version + self.dist_id = dist_id + self.codename = codename + +- def suggest_install_distutils(self): +- print( +- "HINT: Try installing distutils with " +- "`apt-get install python3-distutils`.", +- file=sys.stderr, +- ) +- + def suggest_install_pip3(self): + print( + "HINT: Try installing pip3 with `apt-get install python3-pip`.", + file=sys.stderr, + ) +diff --git a/python/mozboot/setup.py b/python/mozboot/setup.py +--- a/python/mozboot/setup.py ++++ b/python/mozboot/setup.py +@@ -1,10 +1,13 @@ + # 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 distutils.core import setup ++try: ++ from setuptools import setup ++except ImportError: ++ from distutils.core import setup + + VERSION = "0.1" + + setup( + name="mozboot", +