[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH] ts-xen-build-prep: Use .gitconfig so _everything_ uses git cache



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@xxxxxxxxxxxxx>
---
 ts-xen-build-prep | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/ts-xen-build-prep b/ts-xen-build-prep
index 0450811..4dd10c4 100755
--- a/ts-xen-build-prep
+++ b/ts-xen-build-prep
@@ -243,6 +243,25 @@ sub ccache_setup () {
     }
 }
 
+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();
@@ -251,6 +270,7 @@ if (!$ho->{Flags}{'no-reinstall'}) {
     lvextend_stage2();
     replace_home();
     ccache_setup();
+    gitcache_setup();
 }
 $mjobdb->jobdb_resource_shared_mark_ready
    ($ho->{Ident}, $ho->{Name}, "build-".$ho->{Suite}."-".$r{arch});
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.