]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
osstest: make git proxy setup common
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 20 Aug 2018 10:00:19 +0000 (12:00 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 21 Aug 2018 10:27:07 +0000 (11:27 +0100)
By moving it into TestSupport. No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-xen-build-prep

index ea546011c63db0ad6bde62dfdc51be8521cd8f2c..29108423313e837fb70069d5c0083726c0aa1052 100644 (file)
@@ -138,6 +138,7 @@ BEGIN {
                       host_install_postboot_complete
                       target_core_dump_setup
                       sha256file host_shared_mark_ready
+                      gitcache_setup
                       );
     %EXPORT_TAGS = ( );
 
@@ -2903,4 +2904,24 @@ sub host_shared_mark_ready($$) {
                                               $sharetype);
 }
 
+sub gitcache_setup ($) {
+    my ($ho) = @_;
+    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');
+}
+
 1;
index bff5c927a6b0aa17d5a66fed1d62f8c517641787..77a2d284558c2b764ea6668c7024abae144521c2 100755 (executable)
@@ -245,25 +245,6 @@ 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();
@@ -272,7 +253,7 @@ if (!$ho->{Flags}{'no-reinstall'}) {
     lvextend_stage2();
     replace_home();
     ccache_setup();
-    gitcache_setup();
+    gitcache_setup($ho);
 }
 
 host_shared_mark_ready($ho, "build-".$ho->{Suite}."-".$r{arch});