summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py8
-rw-r--r--bitbake/lib/bb/fetch2/git.py4
2 files changed, 10 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 5c2a1c76c48..eee9b8e35ea 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -889,6 +889,9 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
return output
+def get_mirrorname(ud):
+ return ud.host.replace(':','.') + ud.path.replace('/', '.').replace('*', '.')
+
def check_network_access(d, info, url):
"""
log remote network access, and error if BB_NO_NETWORK is set or the given
@@ -910,7 +913,10 @@ def build_mirroruris(origud, mirrors, ld):
replacements["HOST"] = origud.host
replacements["PATH"] = origud.path
replacements["BASENAME"] = origud.path.split("/")[-1]
- replacements["MIRRORNAME"] = origud.host.replace(':','.') + origud.path.replace('/', '.').replace('*', '.')
+ if hasattr(origud, "mirrorname"):
+ replacements["MIRRORNAME"] = origud.mirrorname
+ else:
+ replacements["MIRRORNAME"] = get_mirrorname(origud)
def adduri(ud, uris, uds, mirrors, tarballs):
for line in mirrors:
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 1a8ebe3da87..48c12bb9c89 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -248,10 +248,12 @@ class Git(FetchMethod):
ud.unresolvedrev[name] = ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud, d, name)
- gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.'))
+ gitsrcname = bb.fetch2.get_mirrorname(ud)
if gitsrcname.startswith('.'):
gitsrcname = gitsrcname[1:]
+ ud.mirrorname = gitsrcname
+
# for rebaseable git repo, it is necessary to keep mirror tar ball
# per revision, so that even the revision disappears from the
# upstream repo in the future, the mirror will remain intact and still