summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Laplante <chris.laplante@agilent.com>2020-01-16 11:28:04 -0500
committerArmin Kuster <akuster808@gmail.com>2020-02-08 13:24:10 -0800
commit716cdf737bc536f84ed1254d464c9f286e0d5a9a (patch)
tree17acf81a595269f672d4614d9e85ea032558359e
parent63556259f2e34003ad0618a8fe19e1cfe8aef5c9 (diff)
downloadbitbake-716cdf737bc536f84ed1254d464c9f286e0d5a9a.tar.gz
fetch2/git: _revision_key: collapse adjacent slashes
>From a SRCREV caching point of view, there is no reason to treat the following upstreams as different: SRC_URI = "git://github.com/file/file.git" SRC_URI = "git://github.com//file/file.git" Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 425e21c14955dd38868c6e97637df3bbe0f89fac) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--lib/bb/fetch2/git.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index fa41b078f..9ba9cdccc 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -594,7 +594,9 @@ class Git(FetchMethod):
"""
Return a unique key for the url
"""
- return "git:" + ud.host + ud.path.replace('/', '.') + ud.unresolvedrev[name]
+ # 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):
"""