From ee1dd9f1e2630d100776c436badc97902d224082 Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Thu, 16 Jan 2020 11:28:04 -0500 Subject: bitbake: 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" (Bitbake rev: 716cdf737bc536f84ed1254d464c9f286e0d5a9a) Signed-off-by: Chris Laplante Signed-off-by: Richard Purdie (cherry picked from commit 425e21c14955dd38868c6e97637df3bbe0f89fac) Signed-off-by: Armin Kuster Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index fa41b078f1..9ba9cdccc7 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/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): """ -- cgit v1.2.3-54-g00ecf