[bitbake-devel] [PATCH] fetch2/gitsm.py: Change the URI construction logic

Richard Purdie richard.purdie at linuxfoundation.org
Mon Jan 7 10:51:30 UTC 2019


On Thu, 2018-12-20 at 11:23 +0100, Krystian Garliński wrote:
> Git allows to use both the proper URI's and SCP-like short style
> syntax
> for the SSH protocol. This commit changes construction logic to
> detect which
> one of the two is used in the submodule specification and to build a
> correct
> URI out of it.
> 
> Signed-off-by: Krystian Garliński <krystian.garlinski at comarch.pl>
> ---
>  lib/bb/fetch2/gitsm.py | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)

This causes bitbake-selftest to fail:

$ bitbake-selftest
..................................................................................................................................................................................................................................................................................................................E
Stdout:
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 ls-remote file:///tmp/tmp96d_f_w2/gitsource 
Trying PREMIRRORS
Trying Upstream
Running export PSEUDO_DISABLED=1; LANG=C git -c core.fsyncobjectfiles=0 clone --bare --mirror /tmp/tmp96d_f_w2/gitsource /tmp/tmp96d_f_w2/download/git2/tmp.tmp96d_f_w2.gitsource --progress
Cloning into bare repository '/tmp/tmp96d_f_w2/download/git2/tmp.tmp96d_f_w2.gitsource'...
done.
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 branch --contains b9f67d0efd04c6a57ac03c7b76166d76e2b46972 --list master 2> /dev/null | wc -l
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 branch --contains b9f67d0efd04c6a57ac03c7b76166d76e2b46972 --list master 2> /dev/null | wc -l
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 show b9f67d0efd04c6a57ac03c7b76166d76e2b46972:.gitmodules
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 ls-tree -z -d b9f67d0efd04c6a57ac03c7b76166d76e2b46972 gitsubmodule
Failed to fetch URL gitsm:///tmp/tmp96d_f_w2/gitsource;protocol=file;subdir=/tmp/tmp96d_f_w2/git, attempting MIRRORS if available
The URL: 'gitsm:/tmp/tmp96d_f_w2/gitsubmodule;protocol=file;name=gitsubmodule;bareclone=1;nocheckout=1;nobranch=1' is invalid and cannot be interpreted
Trying MIRRORS
The URL: 'gitsm:/tmp/tmp96d_f_w2/gitsubmodule;protocol=file;name=gitsubmodule;bareclone=1;nocheckout=1;nobranch=1' is invalid and cannot be interpreted
...........................................................................
======================================================================
ERROR: test_shallow_submodules (bb.tests.fetch.GitShallowTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/tests/fetch.py", line 1476, in test_shallow_submodules
    fetcher, ud = self.fetch_shallow(uri)
  File "/media/build1/poky/bitbake/lib/bb/tests/fetch.py", line 1305, in fetch_shallow
    fetcher, ud = self.fetch_and_unpack(uri)
  File "/media/build1/poky/bitbake/lib/bb/tests/fetch.py", line 1298, in fetch_and_unpack
    fetcher, ud = self.fetch(uri)
  File "/media/build1/poky/bitbake/lib/bb/tests/fetch.py", line 1293, in fetch
    fetcher.download()
  File "/media/build1/poky/bitbake/lib/bb/fetch2/__init__.py", line 1714, in download
    raise FetchError("Unable to fetch URL from any source.", u)
bb.fetch2.FetchError: Fetcher failure for URL: 'gitsm:///tmp/tmp96d_f_w2/gitsource;protocol=file;subdir=/tmp/tmp96d_f_w2/git'. Unable to fetch URL from any source.

Stdout:
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 ls-remote file:///tmp/tmp96d_f_w2/gitsource 
Trying PREMIRRORS
Trying Upstream
Running export PSEUDO_DISABLED=1; LANG=C git -c core.fsyncobjectfiles=0 clone --bare --mirror /tmp/tmp96d_f_w2/gitsource /tmp/tmp96d_f_w2/download/git2/tmp.tmp96d_f_w2.gitsource --progress
Cloning into bare repository '/tmp/tmp96d_f_w2/download/git2/tmp.tmp96d_f_w2.gitsource'...
done.
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 branch --contains b9f67d0efd04c6a57ac03c7b76166d76e2b46972 --list master 2> /dev/null | wc -l
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 branch --contains b9f67d0efd04c6a57ac03c7b76166d76e2b46972 --list master 2> /dev/null | wc -l
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 show b9f67d0efd04c6a57ac03c7b76166d76e2b46972:.gitmodules
Running export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0 ls-tree -z -d b9f67d0efd04c6a57ac03c7b76166d76e2b46972 gitsubmodule
Failed to fetch URL gitsm:///tmp/tmp96d_f_w2/gitsource;protocol=file;subdir=/tmp/tmp96d_f_w2/git, attempting MIRRORS if available
The URL: 'gitsm:/tmp/tmp96d_f_w2/gitsubmodule;protocol=file;name=gitsubmodule;bareclone=1;nocheckout=1;nobranch=1' is invalid and cannot be interpreted
Trying MIRRORS
The URL: 'gitsm:/tmp/tmp96d_f_w2/gitsubmodule;protocol=file;name=gitsubmodule;bareclone=1;nocheckout=1;nobranch=1' is invalid and cannot be interpreted

----------------------------------------------------------------------
Ran 382 tests in 477.872s

FAILED (errors=1)



More information about the bitbake-devel mailing list