[bitbake-devel] [PATCH 2/3] gitsm.py: Add support for alternative URL formats from submodule files

Olof Johansson olof.johansson at axis.com
Wed Jan 9 01:18:27 UTC 2019


On 19-01-08 18:38 -0500, Mark Hatle wrote:
> Note, in SSH format we simply replace the ':' with a '/' when constructing
> the URL.  However, if the original path was ":/...", we don't want '//' so
> we deal with this corner case as well.
...
> +  if ":/" in uris[module]:
> +      url = "gitsm://" + uris[module].replace(':/', '/', 1)
> +  else:
> +      url = "gitsm://" + uris[module].replace(':', '/', 1)

Without a / prefix in the original ssh path, the path becomes
relative to whatever the ssh server wants, usually the user's
$HOME. I.e., they do not refer to the same path on the remote
system.

  alice at example.com:/foo.git -> ssh://alice@example.com/foo.git
  alice at example.com:foo.git -> ssh://alice@example.com/home/alice/foo.git (or something else!)

The path in an ssh:// uri is absolute, so the relative case must
be handled differently. But it's easy, git supports ~ expansion,
like:

  alice at example.com:foo.git -> ssh://alice@example.com/~/foo.git

-- 
olofjn


More information about the bitbake-devel mailing list