Bug 7771 - gitsm fetcher don't fetches submodules which are not any longer included in .gitmodules
Summary: gitsm fetcher don't fetches submodules which are not any longer included in ....
Status: CLOSED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.9
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-05-15 20:27 UTC by betacentauri
Modified: 2015-07-10 21:32 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Bitbake file (618 bytes, application/octet-stream)
2015-05-15 20:27 UTC, betacentauri
no flags Details
Patch (961 bytes, text/html)
2015-05-15 20:28 UTC, betacentauri
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description betacentauri 2015-05-15 20:27:36 UTC
Created attachment 2514 [details]
Bitbake file

I have used:
SRC_URI = "gitsm://github.com/google/google-api-python-client.git"
SRCREV = "62af5a96988404207da9fc0e4aff2f6cefcb26c2"

Unpack throws this error:
ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 1, output:
cp: cannot stat `....../git2/github.com.google.google-api-python-client.git/modules': No such file or directory

ERROR: Logfile of failure stored in: ....../python-api-python-client/1.2-r0/temp/log.do_unpack.17323

Problem is that current git has no submodules(https://github.com/google/google-api-python-client/blob/master/.gitmodules). But in old rev 62af5a96988404207da9fc0e4aff2f6cefcb26c2 there is a submodule (https://github.com/google/google-api-python-client/blob/62af5a96988404207da9fc0e4aff2f6cefcb26c2/.gitmodules). gitsm.py calls "git reset --hard" and then "git submodule init". So it looks in wrong rev.

Attached is a patch which worked for me. I don't know whether ud.revisions["default"] always contains the correct src rev. Please check.
Comment 1 betacentauri 2015-05-15 20:28:09 UTC
Created attachment 2515 [details]
Patch
Comment 2 Richard Purdie 2015-07-07 12:48:54 UTC
There was a version of this posted on the bitbake mailing list which used ud.names[0] instead of "default" so I've merged that and it should resolve this issue. Thanks for the patch!

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=62caaa4d6d1e3585c94c34af91e94d1b0deba8c3
Comment 3 betacentauri 2015-07-10 21:32:23 UTC
Thanks!