summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-06 16:26:10 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-19 15:04:37 +0100
commit45baa90c8cb0f5e92e6a2847d84312b52b0582a2 (patch)
tree1264d6664a4d8fc710838237c3e842ff54fd1c76 /bitbake/lib/bb/fetch2/__init__.py
parent843f7ae4108ad862b02ae84eef4f8cf7f6a3c950 (diff)
downloadpoky-45baa90c8cb0f5e92e6a2847d84312b52b0582a2.tar.gz
bitbake: fetch2: implement progress support
Implement progress reporting support specifically for the fetchers. For fetch tasks we don't necessarily know which fetcher will be used (we might initially be fetching a git:// URI, but if we instead download a mirror tarball we may fetch that over http using wget). These programs also have different abilities as far as reporting progress goes (e.g. wget gives us percentage complete and rate, git gives this some of the time depending on what stage it's at). Additionally we filter out the progress output before it makes it to the logs, in order to prevent the logs filling up with junk. At the moment this is only implemented for the wget and git fetchers since they are the most commonly used (and svn doesn't seem to support any kind of progress output, at least not without doing a relatively expensive remote file listing first). Line changes such as the ones you get in git's output as it progresses don't make it to the log files, you only get the final state of the line so the logs aren't filled with progress information that's useless after the fact. Part of the implementation for [YOCTO #5383]. (Bitbake rev: 4027649f422ee64b1c4e1ad8d48ac295050afbff) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index b6fcaaad55..a27512cc87 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -779,7 +779,7 @@ def localpath(url, d):
779 fetcher = bb.fetch2.Fetch([url], d) 779 fetcher = bb.fetch2.Fetch([url], d)
780 return fetcher.localpath(url) 780 return fetcher.localpath(url)
781 781
782def runfetchcmd(cmd, d, quiet=False, cleanup=None): 782def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None):
783 """ 783 """
784 Run cmd returning the command output 784 Run cmd returning the command output
785 Raise an error if interrupted or cmd fails 785 Raise an error if interrupted or cmd fails
@@ -821,7 +821,7 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None):
821 error_message = "" 821 error_message = ""
822 822
823 try: 823 try:
824 (output, errors) = bb.process.run(cmd, shell=True, stderr=subprocess.PIPE) 824 (output, errors) = bb.process.run(cmd, log=log, shell=True, stderr=subprocess.PIPE)
825 success = True 825 success = True
826 except bb.process.NotFoundError as e: 826 except bb.process.NotFoundError as e:
827 error_message = "Fetch command %s" % (e.command) 827 error_message = "Fetch command %s" % (e.command)