summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2014-01-24 12:30:46 +0100
committerEdward Hervey <bilboed@bilboed.com>2014-02-06 10:02:09 +0100
commit02d106024560a213fceb76d024064c0afbbe2f28 (patch)
tree4eee826bf80a7054d867ad510bf9492573b1a0a0
parent5e2cba9dbff3cc78730c9a3cd7c42051841266ee (diff)
bootstrap: add option to build only the build tools
-rw-r--r--cerbero/bootstrap/bootstraper.py10
-rw-r--r--cerbero/commands/bootstrap.py9
2 files changed, 13 insertions, 6 deletions
diff --git a/cerbero/bootstrap/bootstraper.py b/cerbero/bootstrap/bootstraper.py
index 7fb6f964..51723038 100644
--- a/cerbero/bootstrap/bootstraper.py
+++ b/cerbero/bootstrap/bootstraper.py
@@ -34,8 +34,13 @@ def register_bootstraper(distro, klass, distro_version=None):
class Bootstraper (object):
- def __new__(klass, config):
+ def __new__(klass, config, build_tools_only):
bs = []
+
+ bs.append(BuildTools(config))
+ if build_tools_only:
+ return bs
+
target_distro = config.target_distro
distro = config.distro
target_distro_version = config.target_distro_version
@@ -61,8 +66,7 @@ class Bootstraper (object):
m.warning(_("No bootstrapper for the distro version %s" % v))
v = None
- bs.append(bootstrapers[d][v](config))
- bs.append(BuildTools(config))
+ bs.insert(0, bootstrapers[d][v](config))
return bs
diff --git a/cerbero/commands/bootstrap.py b/cerbero/commands/bootstrap.py
index 96aeb314..38e31b1f 100644
--- a/cerbero/commands/bootstrap.py
+++ b/cerbero/commands/bootstrap.py
@@ -18,7 +18,7 @@
from cerbero.commands import Command, register_command
-from cerbero.utils import N_
+from cerbero.utils import N_, _, ArgparseArgument
from cerbero.bootstrap.bootstraper import Bootstraper
@@ -27,10 +27,13 @@ class Bootstrap(Command):
name = 'bootstrap'
def __init__(self):
- Command.__init__(self, [])
+ args = [
+ ArgparseArgument('--build-tools-only', action='store_true',
+ default=False, help=_('only bootstrap the build tools'))]
+ Command.__init__(self, args)
def run(self, config, args):
- bootstrapers = Bootstraper(config)
+ bootstrapers = Bootstraper(config, args.build_tools_only)
for bootstraper in bootstrapers:
bootstraper.start()