diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-06-10 10:35:31 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:33 +0000 |
| commit | ecc68fa4fbb579e97ea45156e79a293b073697a0 (patch) | |
| tree | 6d08682e43476e37ccf48ee14c8d81e208d1c897 /bitbake/lib/bb/fetch/wget.py | |
| parent | d3a45c7d41a88d79389fc40eb68816e4939fb6f9 (diff) | |
| download | poky-ecc68fa4fbb579e97ea45156e79a293b073697a0.tar.gz | |
Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers
This logger provides:
- 'debug' method which accepts a debug level
- 'plain' method which bypasses log formatting
- 'verbose' method which is more detail than info, but less than debug
(Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/wget.py')
| -rw-r--r-- | bitbake/lib/bb/fetch/wget.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch/wget.py b/bitbake/lib/bb/fetch/wget.py index 18503a03f7..4d4bdfd493 100644 --- a/bitbake/lib/bb/fetch/wget.py +++ b/bitbake/lib/bb/fetch/wget.py | |||
| @@ -26,13 +26,11 @@ BitBake build tools. | |||
| 26 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | 26 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig |
| 27 | 27 | ||
| 28 | import os | 28 | import os |
| 29 | import logging | ||
| 29 | import bb | 30 | import bb |
| 30 | import urllib | 31 | import urllib |
| 31 | from bb import data | 32 | from bb import data |
| 32 | from bb.fetch import Fetch | 33 | from bb.fetch import Fetch, FetchError, encodeurl, decodeurl, logger, runfetchcmd |
| 33 | from bb.fetch import FetchError | ||
| 34 | from bb.fetch import encodeurl, decodeurl | ||
| 35 | from bb.fetch import runfetchcmd | ||
| 36 | 34 | ||
| 37 | class Wget(Fetch): | 35 | class Wget(Fetch): |
| 38 | """Class to fetch urls via 'wget'""" | 36 | """Class to fetch urls via 'wget'""" |
| @@ -69,15 +67,14 @@ class Wget(Fetch): | |||
| 69 | 67 | ||
| 70 | fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) | 68 | fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) |
| 71 | fetchcmd = fetchcmd.replace("${FILE}", ud.basename) | 69 | fetchcmd = fetchcmd.replace("${FILE}", ud.basename) |
| 72 | 70 | logger.info("fetch " + uri) | |
| 73 | bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) | 71 | logger.debug(2, "executing " + fetchcmd) |
| 74 | bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd) | ||
| 75 | runfetchcmd(fetchcmd, d) | 72 | runfetchcmd(fetchcmd, d) |
| 76 | 73 | ||
| 77 | # Sanity check since wget can pretend it succeed when it didn't | 74 | # Sanity check since wget can pretend it succeed when it didn't |
| 78 | # Also, this used to happen if sourceforge sent us to the mirror page | 75 | # Also, this used to happen if sourceforge sent us to the mirror page |
| 79 | if not os.path.exists(ud.localpath) and not checkonly: | 76 | if not os.path.exists(ud.localpath) and not checkonly: |
| 80 | bb.msg.debug(2, bb.msg.domain.Fetcher, "The fetch command for %s returned success but %s doesn't exist?..." % (uri, ud.localpath)) | 77 | logger.debug(2, "The fetch command for %s returned success but %s doesn't exist?...", uri, ud.localpath) |
| 81 | return False | 78 | return False |
| 82 | 79 | ||
| 83 | return True | 80 | return True |
