there are few cases where one ebuild may require several git repositories. although you can put multi repo in EGIT_REPO_URI, but it seems doesn't work. Reproducible: Always Actual Results: set EGIT_REPO_URI="git://myfoobar.org/foo.git git://myfoobar.org/bar.git" if will download one repo (the first) - git://myfoobar.org/foo.git and put into ${DISTDIR}/egit-src/bar.git. only one repository was cloned/fetched. current acutal log: # ebuild myfoobar-9999.ebuild unpack >>> Unpacking source... Cloning into bare repository '/mnt/proj/gentoo/locals/egit-src/bar.git'... remote: warning: unable to access '/root/.config/git/attributes': Permission den ied remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done. Checking connectivity... done GIT NEW clone --> repository: git://myfoobar.org/foo.git at the commit: 0b47bc03757bba9455815728aac17e3e318bd77c branch: master storage directory: "/mnt/proj/gentoo/locals/egit-src/bar.git" checkout type: bare repository Cloning into '/var/tmp/portage/app-emulation/myfoobar-9999/work/myfoobar-9999'.. . done. Checking connectivity... done Branch branch-master set up to track remote branch master from origin. Switched to a new branch 'branch-master' >>> Unpacked to /var/tmp/portage/app-emulation/myfoobar-9999/work/myfoobar-9999 >>> Source unpacked in /var/tmp/portage/app-emulation/myfoobar-9999/work Expected Results: set EGIT_REPO_URI="git://myfoobar.org/foo.git git://myfoobar.org/bar.git" and it will download source code from both git://myfoobar.org/{foo,bar}.git, put them to ${DISTDIR}/egit-src/{foo,bar}.git and finally will sync source to ${WORKDIR}/{foo,bar} it would be better if we can control the EGIT_BRANCH, EGIT_COMMIT, EGIT_SOURCEDIR
Created attachment 355088 [details] git-2.eclass test ebuild
Created attachment 355090 [details] eclass debug log
after talking to @mgorny, this can be achieved to call git-2_src_unpack() multi times to fetch several repos. src_unpack() { EGIT_REPO_URI="git://myfoobar.org/foo.git" EGIT_SOURCEDIR="${S}/foo" git-2_src_unpack EGIT_REPO_URI="git://myfoobar.org/bar.git" EGIT_SOURCEDIR="${S}/bar" git-2_src_unpack } thanks
In my opinion this is not something we should do. The effort and potential confusion would be greater than the benefit, and AFAIK no other VCS eclass supports multi-repo natively. If there's something that causes trouble when doing multiple eclass function calls, please let us know and we'll fix it. But currently this seems like the proper thing to do -- or at least most proper, considering that using multiple repositories like that is broken by design.
Use git-r3.eclass instead