After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636888 - nested modules don't work with dvcs_mirror_dir
nested modules don't work with dvcs_mirror_dir
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: module sets
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2010-12-09 16:23 UTC by David Adam
Modified: 2010-12-31 01:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correctly mirror git directory structures (1.68 KB, patch)
2010-12-12 11:39 UTC, Craig Keogh
needs-work Details | Review
git: Use checkoutdir tree structure below dvcs_mirror_dir (2.86 KB, patch)
2010-12-14 12:10 UTC, Dirk Wallenstein
committed Details | Review
info: Display Git mirror module in the output (1.06 KB, patch)
2010-12-17 13:09 UTC, Dirk Wallenstein
committed Details | Review

Description David Adam 2010-12-09 16:23:53 UTC
NetworkManager fails to checkout with dvcs_mirror_dir set:

% jhbuild updateone NetworkManager
*** Checking out NetworkManager *** [1/1]
git clone --mirror git://anongit.freedesktop.org/git/NetworkManager/NetworkManager.git
Cloning into bare repository NetworkManager.git...
remote: Counting objects: 45327, done.
remote: Compressing objects: 100% (12446/12446), done.
remote: Total 45327 (delta 36745), reused 40086 (delta 32777)
Receiving objects: 100% (45327/45327), 11.89 MiB | 279 KiB/s, done.
Resolving deltas: 100% (36745/36745), done.
git clone /space/buildbot/checkout/sources/NetworkManager/NetworkManager.git NetworkManager
fatal: Could not switch to '/space/buildbot/checkout/sources/NetworkManager': No such file or directory
*** Error during phase checkout of NetworkManager: ########## Error running git clone /space/buildbot/checkout/sources/NetworkManager/NetworkManager.git NetworkManager *** [1/1] 

From the moduleset:

    <branch repo="git.freedesktop.org"
	    module="NetworkManager/NetworkManager.git" checkoutdir="NetworkManager"/>

i.e. the module is nested within another directory. It is successfully cloned to the dvcs_mirror_dir but the nesting is not maintained.

The easy fix is probably to just make a new repo for NetworkManager and instead use "NetworkManager.git" as the module name.

An alternative fix that would avoid this in future is teaching jhbuild to either mirror git directory structures or to strip off path components in <branch> module attributes.
Comment 1 Craig Keogh 2010-12-12 11:39:08 UTC
Created attachment 176276 [details] [review]
Correctly mirror git directory structures


This patch implements the 'either mirror git directory structures' suggestion. I've only tested briefly and I don't know git mirroring well. Please run with this patch for a while, let me know if any problems. I'll continue to test too.
Apply patch with 'git am <filename>'
Comment 2 David Adam 2010-12-12 18:18:06 UTC
Looks good - NetworkManager successfully updates with dvcs_mirror_dir using your patch, and a `jhbuild update` on the remainder of the moduleset works ok too.

Thanks!
Comment 3 Dirk Wallenstein 2010-12-13 16:40:29 UTC
Review of attachment 176276 [details] [review]:

Instead of calculating the mirror_base and rely on git to match the assumed destination, it would be possible to explicitly give the destination directory to the clone command. The dir creation could be omitted.
But the real problem is that self.module has the wrong location. It is mirror+online_subpath instead of mirror+checkoutdir. So, it would be necessary to replicate the calculation that is done in srcdir()
Comment 4 Dirk Wallenstein 2010-12-14 12:10:42 UTC
Created attachment 176397 [details] [review]
git: Use checkoutdir tree structure below dvcs_mirror_dir

Always ensure a '.git' suffix for repositories to indicate that they are
bare repositories.  Extract the mirror directory calculation into a
function, as it is needed for the module when there isn't a branch yet
and it has to be recalculated when the configuration changed during a
configuration reload.

--

Another proposal. It should be equal to the previous patch when there is
an implicit checkoutdir, but will use checkoutdir if it is specified.
Comment 5 Dirk Wallenstein 2010-12-17 13:09:03 UTC
Created attachment 176588 [details] [review]
info: Display Git mirror module in the output

If a local mirror is being used, display the upstream URL of the mirror
in an additional line.

--

I've been wondering if the 'Git-Module' line should always display the
real upstream location, but I think the way it is makes it clear that
there is only an indirect connection to the online repository.  It would
however be nice to have the online URL in the display, too.
Comment 6 Craig Keogh 2010-12-31 01:08:09 UTC
Comment on attachment 176397 [details] [review]
git: Use checkoutdir tree structure below dvcs_mirror_dir

Thank you for the patch. Committed.

http://git.gnome.org/browse/jhbuild/commit/?id=c15d7b3b56e5b4c4b56c8d42a080a985c845f01d
Comment 7 Craig Keogh 2010-12-31 01:08:40 UTC
Comment on attachment 176588 [details] [review]
info: Display Git mirror module in the output

Thank you for the patch. Committed.

http://git.gnome.org/browse/jhbuild/commit/?id=9bd4dd4c2deaf99546135108a58d8a2e74b47de2