GNOME Bugzilla – Bug 636888
nested modules don't work with dvcs_mirror_dir
Last modified: 2010-12-31 01:09:03 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.
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>'
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!
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()
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.
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 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 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