diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-01-13 23:11:34 -0500 |
---|---|---|
committer | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-01-15 15:41:37 -0500 |
commit | 60a1503b2997b05e3f36f4ce92d688df44fdeae7 (patch) | |
tree | a2196ba44e6d3af41e28d322ff4dda7ffb59748b /python/servo/bootstrapper/base.py | |
parent | ef900cbdcb0e544639ae10b390a68da2afd8bcce (diff) | |
download | servo-60a1503b2997b05e3f36f4ce92d688df44fdeae7.tar.gz servo-60a1503b2997b05e3f36f4ce92d688df44fdeae7.zip |
Clean up and simplify existing `mach bootstrap`
- Default to interactive mode and remove the `--interactive` flag
- Use `--force` to skip interactivity
- Change MSVC dependency storage organization on disk: put each version
into its own folder and directly refer to the versioned folders,
providing immutability and making the installation list redundant
- Reuse `host_triple()` function to fix broken bootstrapper dispatching
- Simplify code:
- Remove or inline many unused and redudant functions and variables
- Prefer plain functions to classes
- Consolidate into fewer files, remove unnecessary bootstrapper/ dir
- Improve Python style
- Sort dependency list
Diffstat (limited to 'python/servo/bootstrapper/base.py')
-rw-r--r-- | python/servo/bootstrapper/base.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/python/servo/bootstrapper/base.py b/python/servo/bootstrapper/base.py deleted file mode 100644 index b988e06c53a..00000000000 --- a/python/servo/bootstrapper/base.py +++ /dev/null @@ -1,54 +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 print_function, unicode_literals - -import distutils -import subprocess - - -class BaseBootstrapper(object): - """Base class for system bootstrappers.""" - - def __init__(self, interactive=False): - self.package_manager_updated = False - self.interactive = interactive - - def ensure_system_packages(self): - ''' - Check for missing packages. - ''' - raise NotImplementedError('%s must implement ensure_system_packages()' % - __name__) - - def install_system_packages(self): - ''' - Install packages required to build Servo. - ''' - raise NotImplementedError('%s must implement install_system_packages()' % - __name__) - - def which(self, name): - """Python implementation of which. - - It returns the path of an executable or None if it couldn't be found. - """ - return distutils.spawn.find_executable(name) - - def check_output(self, *args, **kwargs): - """Run subprocess.check_output.""" - return subprocess.check_output(*args, **kwargs) - - def _ensure_package_manager_updated(self): - if self.package_manager_updated: - return - - self._update_package_manager() - self.package_manager_updated = True - - def _update_package_manager(self): - """Updates the package manager's manifests/package list. - - This should be defined in child classes. - """ |