2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2025-01-11 10:55:08 +01:00

Enable 'waf update' when use_config is provided - Issue 1541

This commit is contained in:
Thomas Nagy 2015-08-29 13:05:00 +02:00
parent 3e6b3bc5ca
commit 61f09a3f7c
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
3 changed files with 25 additions and 7 deletions

View File

@ -1,3 +1,10 @@
NEW IN WAF 1.8.13
-----------------
* Exposed the Popen parameters input/timeout to cmd_and_log/exec_command (timeout is for Python >= 3.3)
* Added an option to skip searching the regular sys.path when loading waf tools
* Changed gccdeps so that it handle .. within paths
* env = conf.env.derive().detach()
NEW IN WAF 1.8.12
-----------------
* Fixed a regression when building in sub-folders - https://github.com/waf-project/waf/issues/1590

View File

@ -564,15 +564,26 @@ def distcheck(ctx):
pass
def update(ctx):
lst = Options.options.files.split(',')
if not lst:
lst = [x for x in Utils.listdir(Context.waf_dir + '/waflib/extras') if x.endswith('.py')]
lst = Options.options.files
if lst:
lst = lst.split(',')
else:
path = os.path.join(Context.waf_dir, 'waflib', 'extras')
lst = [x for x in Utils.listdir(path) if x.endswith('.py')]
for x in lst:
tool = x.replace('.py', '')
if not tool:
continue
try:
Configure.download_tool(tool, force=True, ctx=ctx)
dl = Configure.download_tool
except AttributeError:
ctx.fatal('The command "update" is dangerous; include the tool "use_config" in your project!')
try:
dl(tool, force=True, ctx=ctx)
except Errors.WafError:
Logs.error('Could not find the tool %s in the remote repository' % x)
Logs.error('Could not find the tool %r in the remote repository' % x)
else:
Logs.warn('Updated %r' % tool)
def autoconfigure(execute_method):
"""

View File

@ -58,7 +58,7 @@ else:
urlopen = request.urlopen
from waflib import Errors, Context, Logs, Utils, Options
from waflib import Errors, Context, Logs, Utils, Options, Configure
try:
from urllib.parse import urlparse
@ -144,7 +144,7 @@ def load_tool(tool, tooldir=None, ctx=None, with_sys_path=True):
Context.load_tool_default = Context.load_tool
Context.load_tool = load_tool
Configure.download_tool = download_tool
def configure(self):
opts = self.options