From ecc68fa4fbb579e97ea45156e79a293b073697a0 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 10 Jun 2010 10:35:31 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch/git.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/fetch/git.py') 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 from bb import data from bb.fetch import Fetch from bb.fetch import runfetchcmd +from bb.fetch import logger class Git(Fetch): """Class to fetch a module or modules from git repositories""" @@ -153,7 +154,7 @@ class Git(Fetch): os.chdir(ud.clonedir) mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) if mirror_tarballs != "0" or 'fullclone' in ud.parm: - bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository") + logger.info("Creating tarball of git repository") runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) if 'fullclone' in ud.parm: @@ -185,7 +186,7 @@ class Git(Fetch): runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d) os.chdir(codir) - bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git checkout") + logger.info("Creating tarball of git checkout") runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d) os.chdir(ud.clonedir) @@ -238,7 +239,7 @@ class Git(Fetch): print("no repo") self.go(None, ud, d) if not os.path.exists(ud.clonedir): - 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)) + logger.error("GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value", url, ud.clonedir) return None @@ -250,5 +251,5 @@ class Git(Fetch): os.chdir(cwd) buildindex = "%s" % output.split()[0] - 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)) + logger.debug(1, "GIT repository for %s in %s is returning %s revisions in rev-list before %s", url, ud.clonedir, buildindex, rev) return buildindex -- cgit v1.2.3-54-g00ecf