Add --no-download to disable the downloader.

This commit is contained in:
Chris Johns
2013-04-15 09:18:31 +10:00
parent cc2c48ba88
commit 5e02e80d5a
3 changed files with 43 additions and 30 deletions

View File

@@ -41,32 +41,33 @@ class command_line:
def __init__(self, argv, optargs, _defaults, command_path):
self._long_opts = {
# key macro handler param defs init
'--prefix' : ('_prefix', self._lo_path, True, None, False),
'--topdir' : ('_topdir', self._lo_path, True, None, False),
'--configdir' : ('_configdir', self._lo_path, True, None, False),
'--builddir' : ('_builddir', self._lo_path, True, None, False),
'--sourcedir' : ('_sourcedir', self._lo_path, True, None, False),
'--tmppath' : ('_tmppath', self._lo_path, True, None, False),
'--jobs' : ('_jobs', self._lo_jobs, True, 'max', True),
'--log' : ('_logfile', self._lo_string, True, None, False),
'--url' : ('_url_base', self._lo_string, True, None, False),
'--macros' : ('_macros', self._lo_string, True, None, False),
'--targetcflags' : ('_targetcflags', self._lo_string, True, None, False),
'--targetcxxflags' : ('_targetcxxflags', self._lo_string, True, None, False),
'--libstdcxxflags' : ('_libstdcxxflags', self._lo_string, True, None, False),
'--force' : ('_force', self._lo_bool, False, '0', True),
'--quiet' : ('_quiet', self._lo_bool, False, '0', True),
'--trace' : ('_trace', self._lo_bool, False, '0', True),
'--dry-run' : ('_dry_run', self._lo_bool, False, '0', True),
'--warn-all' : ('_warn_all', self._lo_bool, False, '0', True),
'--no-clean' : ('_no_clean', self._lo_bool, False, '0', True),
'--keep-going' : ('_keep_going', self._lo_bool, False, '0', True),
'--always-clean' : ('_always_clean', self._lo_bool, False, '0', True),
'--host' : ('_host', self._lo_triplets, True, None, False),
'--build' : ('_build', self._lo_triplets, True, None, False),
'--target' : ('_target', self._lo_triplets, True, None, False),
'--help' : (None, self._lo_help, False, None, False)
# key macro handler param defs init
'--prefix' : ('_prefix', self._lo_path, True, None, False),
'--topdir' : ('_topdir', self._lo_path, True, None, False),
'--configdir' : ('_configdir', self._lo_path, True, None, False),
'--builddir' : ('_builddir', self._lo_path, True, None, False),
'--sourcedir' : ('_sourcedir', self._lo_path, True, None, False),
'--tmppath' : ('_tmppath', self._lo_path, True, None, False),
'--jobs' : ('_jobs', self._lo_jobs, True, 'max', True),
'--log' : ('_logfile', self._lo_string, True, None, False),
'--url' : ('_url_base', self._lo_string, True, None, False),
'--no-download' : ('_disable_download', self._lo_bool, False, '0', True),
'--macros' : ('_macros', self._lo_string, True, None, False),
'--targetcflags' : ('_targetcflags', self._lo_string, True, None, False),
'--targetcxxflags' : ('_targetcxxflags', self._lo_string, True, None, False),
'--libstdcxxflags' : ('_libstdcxxflags', self._lo_string, True, None, False),
'--force' : ('_force', self._lo_bool, False, '0', True),
'--quiet' : ('_quiet', self._lo_bool, False, '0', True),
'--trace' : ('_trace', self._lo_bool, False, '0', True),
'--dry-run' : ('_dry_run', self._lo_bool, False, '0', True),
'--warn-all' : ('_warn_all', self._lo_bool, False, '0', True),
'--no-clean' : ('_no_clean', self._lo_bool, False, '0', True),
'--keep-going' : ('_keep_going', self._lo_bool, False, '0', True),
'--always-clean' : ('_always_clean', self._lo_bool, False, '0', True),
'--host' : ('_host', self._lo_triplets, True, None, False),
'--build' : ('_build', self._lo_triplets, True, None, False),
'--target' : ('_target', self._lo_triplets, True, None, False),
'--help' : (None, self._lo_help, False, None, False)
}
self.command_path = command_path
@@ -200,6 +201,7 @@ class command_line:
print '--macros file[,[file] : Macro format files to load after the defaults'
print '--log file : Log file where all build out is written too'
print '--url url[,url] : URL to look for source'
print '--no-download : Disable the source downloader'
print '--targetcflags flags : List of C flags for the target code'
print '--targetcxxflags flags : List of C++ flags for the target code'
print '--libstdcxxflags flags : List of C++ flags to build the target libstdc++ code'
@@ -390,6 +392,9 @@ class command_line:
return self.opts['url'].split(',')
return None
def download_disabled(self):
return self.opts['no-download'] != '0'
def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'):
"""
Copy the defaults, get the host specific values and merge them overriding