summaryrefslogtreecommitdiff
path: root/poky/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
Diffstat (limited to 'poky/bitbake/lib/bb/fetch2')
-rw-r--r--poky/bitbake/lib/bb/fetch2/__init__.py1
-rw-r--r--poky/bitbake/lib/bb/fetch2/crate.py3
-rw-r--r--poky/bitbake/lib/bb/fetch2/git.py16
-rw-r--r--poky/bitbake/lib/bb/fetch2/osc.py2
-rw-r--r--poky/bitbake/lib/bb/fetch2/ssh.py6
5 files changed, 16 insertions, 12 deletions
diff --git a/poky/bitbake/lib/bb/fetch2/__init__.py b/poky/bitbake/lib/bb/fetch2/__init__.py
index 5dfe5ff360..ac557176d7 100644
--- a/poky/bitbake/lib/bb/fetch2/__init__.py
+++ b/poky/bitbake/lib/bb/fetch2/__init__.py
@@ -839,6 +839,7 @@ FETCH_EXPORT_VARS = ['HOME', 'PATH',
'ALL_PROXY', 'all_proxy',
'GIT_PROXY_COMMAND',
'GIT_SSH',
+ 'GIT_SSH_COMMAND',
'GIT_SSL_CAINFO',
'GIT_SMART_HTTP',
'SSH_AUTH_SOCK', 'SSH_AGENT_PID',
diff --git a/poky/bitbake/lib/bb/fetch2/crate.py b/poky/bitbake/lib/bb/fetch2/crate.py
index f7e2354afb..f4ddc782a9 100644
--- a/poky/bitbake/lib/bb/fetch2/crate.py
+++ b/poky/bitbake/lib/bb/fetch2/crate.py
@@ -13,7 +13,6 @@ BitBake 'Fetch' implementation for crates.io
import hashlib
import json
import os
-import shutil
import subprocess
import bb
from bb.fetch2 import logger, subprocess_setup, UnpackError
@@ -72,7 +71,7 @@ class Crate(Wget):
ud.parm['downloadfilename'] = "%s-%s.crate" % (name, version)
ud.parm['name'] = name
- logger.debug(2, "Fetching %s to %s" % (ud.url, ud.parm['downloadfilename']))
+ logger.debug("Fetching %s to %s" % (ud.url, ud.parm['downloadfilename']))
def unpack(self, ud, rootdir, d):
"""
diff --git a/poky/bitbake/lib/bb/fetch2/git.py b/poky/bitbake/lib/bb/fetch2/git.py
index 4d06a57198..bdcfa4978c 100644
--- a/poky/bitbake/lib/bb/fetch2/git.py
+++ b/poky/bitbake/lib/bb/fetch2/git.py
@@ -74,6 +74,9 @@ from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger
+sha1_re = re.compile(r'^[0-9a-f]{40}$')
+slash_re = re.compile(r"/+")
+
class GitProgressHandler(bb.progress.LineFilterProgressHandler):
"""Extract progress information from git output"""
def __init__(self, d):
@@ -249,8 +252,8 @@ class Git(FetchMethod):
ud.setup_revisions(d)
for name in ud.names:
- # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
- if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
+ # Ensure any revision that doesn't look like a SHA-1 is translated into one
+ if not sha1_re.match(ud.revisions[name] or ''):
if ud.revisions[name]:
ud.unresolvedrev[name] = ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud, d, name)
@@ -259,10 +262,10 @@ class Git(FetchMethod):
if gitsrcname.startswith('.'):
gitsrcname = gitsrcname[1:]
- # for rebaseable git repo, it is necessary to keep mirror tar ball
- # per revision, so that even the revision disappears from the
+ # For a rebaseable git repo, it is necessary to keep a mirror tar ball
+ # per revision, so that even if the revision disappears from the
# upstream repo in the future, the mirror will remain intact and still
- # contains the revision
+ # contain the revision
if ud.rebaseable:
for name in ud.names:
gitsrcname = gitsrcname + '_' + ud.revisions[name]
@@ -464,7 +467,7 @@ class Git(FetchMethod):
with create_atomic(ud.fullmirror) as tfile:
mtime = runfetchcmd("git log --all -1 --format=%cD", d,
quiet=True, workdir=ud.clonedir)
- runfetchcmd("tar -czf %s --owner pokybuild --group users --mtime \"%s\" ."
+ runfetchcmd("tar -czf %s --owner oe:0 --group oe:0 --mtime \"%s\" ."
% (tfile, mtime), d, workdir=ud.clonedir)
runfetchcmd("touch %s.done" % ud.fullmirror, d)
@@ -697,7 +700,6 @@ class Git(FetchMethod):
Return a unique key for the url
"""
# Collapse adjacent slashes
- slash_re = re.compile(r"/+")
return "git:" + ud.host + slash_re.sub(".", ud.path) + ud.unresolvedrev[name]
def _lsremote(self, ud, d, search):
diff --git a/poky/bitbake/lib/bb/fetch2/osc.py b/poky/bitbake/lib/bb/fetch2/osc.py
index d9ce44390c..99a529e5bf 100644
--- a/poky/bitbake/lib/bb/fetch2/osc.py
+++ b/poky/bitbake/lib/bb/fetch2/osc.py
@@ -43,7 +43,7 @@ class Osc(FetchMethod):
ud.revision = ud.parm['rev']
else:
pv = d.getVar("PV", False)
- rev = bb.fetch2.srcrev_internal_helper(ud, d)
+ rev = bb.fetch2.srcrev_internal_helper(ud, d, '')
if rev:
ud.revision = rev
else:
diff --git a/poky/bitbake/lib/bb/fetch2/ssh.py b/poky/bitbake/lib/bb/fetch2/ssh.py
index 484453088f..8d082b38c1 100644
--- a/poky/bitbake/lib/bb/fetch2/ssh.py
+++ b/poky/bitbake/lib/bb/fetch2/ssh.py
@@ -32,6 +32,7 @@ IETF secsh internet draft:
import re, os
from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd
+import urllib
__pattern__ = re.compile(r'''
@@ -70,6 +71,7 @@ class SSH(FetchMethod):
"git:// prefix with protocol=ssh", urldata.url)
m = __pattern__.match(urldata.url)
path = m.group('path')
+ path = urllib.parse.unquote(path)
host = m.group('host')
urldata.localpath = os.path.join(d.getVar('DL_DIR'),
os.path.basename(os.path.normpath(path)))
@@ -99,7 +101,7 @@ class SSH(FetchMethod):
if path[0] != '~':
path = '/%s' % path
- path = path.replace("%3A", ":")
+ path = urllib.parse.unquote(path)
fr += ':%s' % path
@@ -139,7 +141,7 @@ class SSH(FetchMethod):
if path[0] != '~':
path = '/%s' % path
- path = path.replace("%3A", ":")
+ path = urllib.parse.unquote(path)
cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % (
portarg,