aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/bootstrap.py
diff options
context:
space:
mode:
authorcdeler <serj.krotov@gmail.com>2018-12-08 12:55:27 +0300
committercdeler <serj.krotov@gmail.com>2018-12-08 15:19:56 +0300
commit7ceabcee0cfc50af2187bfc5ccca32815a9fadd0 (patch)
tree6804a1a8c9d2d183816bfd107c03c11524c4baf6 /python/servo/bootstrap.py
parent3c19cd49ec2ef0e8608faf9575d9fbee2391a867 (diff)
downloadservo-7ceabcee0cfc50af2187bfc5ccca32815a9fadd0.tar.gz
servo-7ceabcee0cfc50af2187bfc5ccca32815a9fadd0.zip
Use the base Ubuntu distro instead of LinuxMint in './mach bootstrap'
Diffstat (limited to 'python/servo/bootstrap.py')
-rw-r--r--python/servo/bootstrap.py46
1 files changed, 33 insertions, 13 deletions
diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py
index 486147451fa..4f3f84ebcae 100644
--- a/python/servo/bootstrap.py
+++ b/python/servo/bootstrap.py
@@ -341,6 +341,34 @@ LINUX_SPECIFIC_BOOTSTRAPPERS = {
}
+def get_linux_distribution():
+ distro, version, _ = platform.linux_distribution()
+
+ if distro == 'LinuxMint':
+ major, minor = version.split('.')
+
+ if major == '19':
+ base_version = '18.04'
+ elif major == '18':
+ base_version = '16.04'
+ elif major == '17':
+ base_version = '14.04'
+ else:
+ raise Exception('unsupported version of %s: %s' % (distro, version))
+
+ distro, version = 'Ubuntu', base_version
+ elif distro.lower() not in [
+ 'centos',
+ 'centos linux',
+ 'debian',
+ 'fedora',
+ 'ubuntu',
+ ]:
+ raise Exception('mach bootstrap does not support %s, please file a bug' % distro)
+
+ return distro, version
+
+
def bootstrap(context, force=False, specific=None):
'''Dispatches to the right bootstrapping function for the OS.'''
@@ -348,19 +376,11 @@ def bootstrap(context, force=False, specific=None):
if "windows-msvc" in host_triple():
bootstrapper = windows_msvc
elif "linux-gnu" in host_triple():
- distro, version, _ = platform.linux_distribution()
- if distro.lower() in [
- 'centos',
- 'centos linux',
- 'debian',
- 'fedora',
- 'ubuntu',
- ]:
- context.distro = distro
- context.distro_version = version
- bootstrapper = LINUX_SPECIFIC_BOOTSTRAPPERS.get(specific, linux)
- else:
- raise Exception("mach bootstrap does not support %s, please file a bug" % distro)
+ distro, version = get_linux_distribution()
+
+ context.distro = distro
+ context.distro_version = version
+ bootstrapper = LINUX_SPECIFIC_BOOTSTRAPPERS.get(specific, linux)
if bootstrapper is None:
print('Bootstrap support is not yet available for your OS.')