summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/hg.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-02-09 09:50:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-10 23:48:16 +0000
commit75f87db413f3659fee18eff389b7b339b01cce15 (patch)
treee733135549b516c72c4f34172b6bbf865377fc76 /bitbake/lib/bb/fetch2/hg.py
parent7283a0b3b6ca49d0d2e13593333a580ef10439a8 (diff)
downloadpoky-75f87db413f3659fee18eff389b7b339b01cce15.tar.gz
bitbake: logging: Make bitbake logger compatible with python logger
The bitbake logger overrode the definition of the debug() logging call to include a debug level, but this causes problems with code that may be using standard python logging, since the extra argument is interpreted differently. Instead, change the bitbake loggers debug() call to match the python logger call and add a debug2() and debug3() API to replace calls that were logging to a different debug level. [RP: Small fix to ensure bb.debug calls bbdebug()] (Bitbake rev: f68682a79d83e6399eb403f30a1f113516575f51) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/hg.py')
-rw-r--r--bitbake/lib/bb/fetch2/hg.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index 8f503701ed..063e13008a 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -150,7 +150,7 @@ class Hg(FetchMethod):
150 def download(self, ud, d): 150 def download(self, ud, d):
151 """Fetch url""" 151 """Fetch url"""
152 152
153 logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'") 153 logger.debug2("Fetch: checking for module directory '" + ud.moddir + "'")
154 154
155 # If the checkout doesn't exist and the mirror tarball does, extract it 155 # If the checkout doesn't exist and the mirror tarball does, extract it
156 if not os.path.exists(ud.pkgdir) and os.path.exists(ud.fullmirror): 156 if not os.path.exists(ud.pkgdir) and os.path.exists(ud.fullmirror):
@@ -160,7 +160,7 @@ class Hg(FetchMethod):
160 if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK): 160 if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
161 # Found the source, check whether need pull 161 # Found the source, check whether need pull
162 updatecmd = self._buildhgcommand(ud, d, "update") 162 updatecmd = self._buildhgcommand(ud, d, "update")
163 logger.debug(1, "Running %s", updatecmd) 163 logger.debug("Running %s", updatecmd)
164 try: 164 try:
165 runfetchcmd(updatecmd, d, workdir=ud.moddir) 165 runfetchcmd(updatecmd, d, workdir=ud.moddir)
166 except bb.fetch2.FetchError: 166 except bb.fetch2.FetchError:
@@ -168,7 +168,7 @@ class Hg(FetchMethod):
168 pullcmd = self._buildhgcommand(ud, d, "pull") 168 pullcmd = self._buildhgcommand(ud, d, "pull")
169 logger.info("Pulling " + ud.url) 169 logger.info("Pulling " + ud.url)
170 # update sources there 170 # update sources there
171 logger.debug(1, "Running %s", pullcmd) 171 logger.debug("Running %s", pullcmd)
172 bb.fetch2.check_network_access(d, pullcmd, ud.url) 172 bb.fetch2.check_network_access(d, pullcmd, ud.url)
173 runfetchcmd(pullcmd, d, workdir=ud.moddir) 173 runfetchcmd(pullcmd, d, workdir=ud.moddir)
174 try: 174 try:
@@ -183,14 +183,14 @@ class Hg(FetchMethod):
183 logger.info("Fetch " + ud.url) 183 logger.info("Fetch " + ud.url)
184 # check out sources there 184 # check out sources there
185 bb.utils.mkdirhier(ud.pkgdir) 185 bb.utils.mkdirhier(ud.pkgdir)
186 logger.debug(1, "Running %s", fetchcmd) 186 logger.debug("Running %s", fetchcmd)
187 bb.fetch2.check_network_access(d, fetchcmd, ud.url) 187 bb.fetch2.check_network_access(d, fetchcmd, ud.url)
188 runfetchcmd(fetchcmd, d, workdir=ud.pkgdir) 188 runfetchcmd(fetchcmd, d, workdir=ud.pkgdir)
189 189
190 # Even when we clone (fetch), we still need to update as hg's clone 190 # Even when we clone (fetch), we still need to update as hg's clone
191 # won't checkout the specified revision if its on a branch 191 # won't checkout the specified revision if its on a branch
192 updatecmd = self._buildhgcommand(ud, d, "update") 192 updatecmd = self._buildhgcommand(ud, d, "update")
193 logger.debug(1, "Running %s", updatecmd) 193 logger.debug("Running %s", updatecmd)
194 runfetchcmd(updatecmd, d, workdir=ud.moddir) 194 runfetchcmd(updatecmd, d, workdir=ud.moddir)
195 195
196 def clean(self, ud, d): 196 def clean(self, ud, d):
@@ -247,9 +247,9 @@ class Hg(FetchMethod):
247 if scmdata != "nokeep": 247 if scmdata != "nokeep":
248 proto = ud.parm.get('protocol', 'http') 248 proto = ud.parm.get('protocol', 'http')
249 if not os.access(os.path.join(codir, '.hg'), os.R_OK): 249 if not os.access(os.path.join(codir, '.hg'), os.R_OK):
250 logger.debug(2, "Unpack: creating new hg repository in '" + codir + "'") 250 logger.debug2("Unpack: creating new hg repository in '" + codir + "'")
251 runfetchcmd("%s init %s" % (ud.basecmd, codir), d) 251 runfetchcmd("%s init %s" % (ud.basecmd, codir), d)
252 logger.debug(2, "Unpack: updating source in '" + codir + "'") 252 logger.debug2("Unpack: updating source in '" + codir + "'")
253 if ud.user and ud.pswd: 253 if ud.user and ud.pswd:
254 runfetchcmd("%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" pull %s" % (ud.basecmd, ud.user, ud.pswd, proto, ud.moddir), d, workdir=codir) 254 runfetchcmd("%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" pull %s" % (ud.basecmd, ud.user, ud.pswd, proto, ud.moddir), d, workdir=codir)
255 else: 255 else:
@@ -259,5 +259,5 @@ class Hg(FetchMethod):
259 else: 259 else:
260 runfetchcmd("%s up -C %s" % (ud.basecmd, revflag), d, workdir=codir) 260 runfetchcmd("%s up -C %s" % (ud.basecmd, revflag), d, workdir=codir)
261 else: 261 else:
262 logger.debug(2, "Unpack: extracting source to '" + codir + "'") 262 logger.debug2("Unpack: extracting source to '" + codir + "'")
263 runfetchcmd("%s archive -t files %s %s" % (ud.basecmd, revflag, codir), d, workdir=ud.moddir) 263 runfetchcmd("%s archive -t files %s %s" % (ud.basecmd, revflag, codir), d, workdir=ud.moddir)