From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH] build_clone: When guessing vcs from url suffix, strip cache info Date: Thu, 5 Jun 2014 11:17:01 +0100 Message-ID: <1401963421-6551-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WsUjS-00034D-3d for xen-devel@lists.xenproject.org; Thu, 05 Jun 2014 10:17:14 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org We assume that anything not containing `/'s after `%20' is uninteresting. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 4187b6c..93c8fcf 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1045,13 +1045,16 @@ sub build_clone ($$$$) { my $timeout= 4000; my $vcs = $r{"treevcs_$which"}; - if (defined $vcs) { - } elsif ($tree =~ m/\.hg$/) { - $vcs= 'hg'; - } elsif ($tree =~ m/\.git$/) { - $vcs= 'git'; - } else { - die "unknown vcs for $which $tree "; + if (!defined $vcs) { + my $effurl = $tree; + $effurl =~ s#\%20[^/]*$##; + if ($effurl =~ m/\.hg$/) { + $vcs= 'hg'; + } elsif ($effurl =~ m/\.git$/) { + $vcs= 'git'; + } else { + die "unknown vcs for $which $tree "; + } } if ($vcs eq 'hg') { -- 1.7.10.4