Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] Fix relative URI processing for gitsm
@ 2018-10-02 21:08 Mark Hatle
  2018-10-02 21:08 ` [PATCH] gitsm: Allow relative URIs when fetching Mark Hatle
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Hatle @ 2018-10-02 21:08 UTC (permalink / raw)
  To: bitbake-devel

This patch depends on the prior patch set from Laurent Bonnans.

Identify and fix relative urls using os.path.join and os.path.realpath.

Mark Hatle (1):
  gitsm: Allow relative URIs when fetching

 lib/bb/fetch2/gitsm.py | 5 +++++
 1 file changed, 5 insertions(+)

-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] gitsm: Allow relative URIs when fetching
  2018-10-02 21:08 [PATCH] Fix relative URI processing for gitsm Mark Hatle
@ 2018-10-02 21:08 ` Mark Hatle
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Hatle @ 2018-10-02 21:08 UTC (permalink / raw)
  To: bitbake-devel

Some repositories may specify a relative submodule path.  If this happens,
it is our responsibility to use the parents URL (ud) and handle any relative
processing ourselves.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 lib/bb/fetch2/gitsm.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index 4d3805a..0a982da 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -31,6 +31,7 @@ NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your r
 
 import os
 import bb
+import copy
 from   bb.fetch2.git import Git
 from   bb.fetch2 import runfetchcmd
 from   bb.fetch2 import logger
@@ -77,6 +78,10 @@ class GitSM(Git):
                 submodules.append(m)
                 paths[m] = md['path']
                 uris[m] = md['url']
+                if uris[m].startswith('..'):
+                    newud = copy.copy(ud)
+                    newud.path = os.path.realpath(os.path.join(newud.path, md['url']))
+                    uris[m] = Git._get_repo_url(self, newud)
 
         for module in submodules:
             module_hash = runfetchcmd("%s ls-tree -z -d %s %s" % (ud.basecmd, ud.revisions[name], paths[module]), d, quiet=True, workdir=ud.clonedir)
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-02 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-02 21:08 [PATCH] Fix relative URI processing for gitsm Mark Hatle
2018-10-02 21:08 ` [PATCH] gitsm: Allow relative URIs when fetching Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox