In particular, when xen.git clones a subtrees, whose url we didn't
specify in the runvars, we end up using the url from xen.git's
Config.mk.
Arrange to use the git cache for all git urls, via the insteadOf
feature.
Note that the git config url insteadOf feature is backwards: one
configures the config variable "url.NEW-URL.insteadOf.OLD-URL". So
the key is the value, and the value is the key.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
}
}
+sub gitcache_setup () {
+ my $proxy = $c{GitCacheProxy};
+ return unless $proxy;
+
+ logm("setting up git cacheing proxy $proxy");
+
+ my $gitcfg = '';
+ foreach my $urlprefix (qw(git:// http:// https://)) {
+ $gitcfg .= <<END
+[url "${proxy}$urlprefix"]
+ insteadOf = $urlprefix
+[url "${proxy}$urlprefix"]
+ insteadOf = ${proxy}$urlprefix
+END
+ }
+ target_putfilecontents_stash($ho,30,$gitcfg,"/home/osstest/.gitconfig",
+ 'home-osstest-gitconfig');
+}
+
if (!$ho->{Flags}{'no-reinstall'}) {
determine_vg_lv();
lvcreate();
lvextend_stage2();
replace_home();
ccache_setup();
+ gitcache_setup();
}
$mjobdb->jobdb_resource_shared_mark_ready
($ho->{Ident}, $ho->{Name}, "build-".$ho->{Suite}."-".$r{arch});