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/git.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/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch/git.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index 9bd447ff8b..57d758dcda 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py | |||
@@ -25,6 +25,7 @@ import bb | |||
25 | from bb import data | 25 | from bb import data |
26 | from bb.fetch import Fetch | 26 | from bb.fetch import Fetch |
27 | from bb.fetch import runfetchcmd | 27 | from bb.fetch import runfetchcmd |
28 | from bb.fetch import logger | ||
28 | 29 | ||
29 | class Git(Fetch): | 30 | class Git(Fetch): |
30 | """Class to fetch a module or modules from git repositories""" | 31 | """Class to fetch a module or modules from git repositories""" |
@@ -153,7 +154,7 @@ class Git(Fetch): | |||
153 | os.chdir(ud.clonedir) | 154 | os.chdir(ud.clonedir) |
154 | mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) | 155 | mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) |
155 | if mirror_tarballs != "0" or 'fullclone' in ud.parm: | 156 | if mirror_tarballs != "0" or 'fullclone' in ud.parm: |
156 | bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository") | 157 | logger.info("Creating tarball of git repository") |
157 | runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) | 158 | runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) |
158 | 159 | ||
159 | if 'fullclone' in ud.parm: | 160 | if 'fullclone' in ud.parm: |
@@ -185,7 +186,7 @@ class Git(Fetch): | |||
185 | runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d) | 186 | runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d) |
186 | 187 | ||
187 | os.chdir(codir) | 188 | os.chdir(codir) |
188 | bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git checkout") | 189 | logger.info("Creating tarball of git checkout") |
189 | runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d) | 190 | runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d) |
190 | 191 | ||
191 | os.chdir(ud.clonedir) | 192 | os.chdir(ud.clonedir) |
@@ -238,7 +239,7 @@ class Git(Fetch): | |||
238 | print("no repo") | 239 | print("no repo") |
239 | self.go(None, ud, d) | 240 | self.go(None, ud, d) |
240 | if not os.path.exists(ud.clonedir): | 241 | if not os.path.exists(ud.clonedir): |
241 | bb.msg.error(bb.msg.domain.Fetcher, "GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value" % (url, ud.clonedir)) | 242 | logger.error("GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value", url, ud.clonedir) |
242 | return None | 243 | return None |
243 | 244 | ||
244 | 245 | ||
@@ -250,5 +251,5 @@ class Git(Fetch): | |||
250 | os.chdir(cwd) | 251 | os.chdir(cwd) |
251 | 252 | ||
252 | buildindex = "%s" % output.split()[0] | 253 | buildindex = "%s" % output.split()[0] |
253 | bb.msg.debug(1, bb.msg.domain.Fetcher, "GIT repository for %s in %s is returning %s revisions in rev-list before %s" % (url, ud.clonedir, buildindex, rev)) | 254 | logger.debug(1, "GIT repository for %s in %s is returning %s revisions in rev-list before %s", url, ud.clonedir, buildindex, rev) |
254 | return buildindex | 255 | return buildindex |