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

[Xen-devel] [OSSTEST PATCH 3/9] submodulefixup: Tell git cache [fetch=try]



Make git_massage_url take an optional %xopts list, currently with
only GitFetchBestEffort as a possible key.

Use that in submodulefixup, unconditionally.  Often the submodule
update will work fine with an older version of the submodule, and if
the submodule we get is out of date then the submodule update will
fail anyway.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/BuildSupport.pm |    5 ++++-
 Osstest/TestSupport.pm  |    8 ++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Osstest/BuildSupport.pm b/Osstest/BuildSupport.pm
index bd79b4b..f3b8c63 100644
--- a/Osstest/BuildSupport.pm
+++ b/Osstest/BuildSupport.pm
@@ -117,7 +117,10 @@ sub submodulefixup ($$$$) {
                    $log1->("  recording url=$u");
                    store_runvar($urv, $u);
                }
-               my $nu = $submod->{Url} = git_massage_url($u);
+               my $nu = $submod->{Url} =
+                   git_massage_url($u, GitFetchBestEffort => 1);
+               # If we don't manage to fetch a version which contains the
+               # necessary commit(s), we will fail later.
                $_ = "${l}${nu}\n";
            }
            print ::EO or die $!;
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 93c8fcf..23ad106 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1026,12 +1026,16 @@ sub file_simple_write_contents ($$) {
 
 #---------- building, vcs's, etc. ----------
 
-sub git_massage_url ($) {
-    my ($url) = @_;
+sub git_massage_url ($;@) {
+    my ($url, %xopts) = @_;
+    # Supports $xopts{GitFetchBestEffort}
 
     if ($url =~ m,^(git|https?)://, && $c{GitCacheProxy} &&
        substr($url,0,length($c{GitCacheProxy})) ne $c{GitCacheProxy}) {
        $url = $c{GitCacheProxy}.$url;
+       if ($xopts{GitFetchBestEffort}) {
+           $url .= '%20[fetch=try]';
+       }
     }
     return $url;
 }
-- 
1.7.10.4


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


 


Rackspace

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