[Bps-public-commit] r15328 - in Shipwright/trunk: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Aug 21 05:53:10 EDT 2008


Author: sunnavy
Date: Thu Aug 21 05:53:08 2008
New Revision: 15328

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Test.pm

Log:
 r15903 at sunnavys-mb:  sunnavy | 2008-08-21 17:39:50 +0800
 limit svk version to be 2+, svn version to be 1.4+


Modified: Shipwright/trunk/lib/Shipwright/Test.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Test.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Test.pm	Thu Aug 21 05:53:08 2008
@@ -7,6 +7,7 @@
 use File::Temp qw/tempdir/;
 use IPC::Cmd qw/can_run/;
 use File::Spec::Functions qw/catfile catdir/;
+use Shipwright::Util;
 
 our @EXPORT =
   qw/has_svk has_svn create_fs_repo create_svk_repo create_svn_repo devel_cover_enabled test_cmd/;
@@ -21,24 +22,36 @@
 
 =head2 has_svk
 
-check to see if we have svk or not.
-in fact, it also checks svnadmin since we need that to create repo for svk
+check to see if we have svk or not, also limit the svk version to be 2+.
+in fact, it also checks svnadmin since we need that to create repo for svk.
 
 =cut
 
 sub has_svk {
-    return can_run('svk') && can_run('svnadmin');
+    if ( can_run('svk') && can_run('svnadmin') ) {
+        my $out = Shipwright::Util->run(['svk', '--version']);
+        if ( $out =~ /version v(\d)\./ ) {
+            return 1 if $1 >= 2;
+        }
+    }
+    return;
 }
 
 =head2 has_svn
 
-check to see if we have svn or not.
-in fact, it also checks svnadmin since we need that to create repo
+check to see if we have svn or not, also limit the svn version to be 1.4+.
+in fact, it also checks svnadmin since we need that to create repo.
 
 =cut
 
 sub has_svn {
-    return can_run('svn') && can_run('svnadmin');
+    if ( can_run('svn') && can_run('svnadmin') ) {
+        my $out = Shipwright::Util->run(['svn', '--version']);
+        if ( $out =~ /version 1\.(\d)/ ) {
+            return 1 if $1 >= 4;
+        }
+    }
+    return;
 }
 
 =head2 create_fs_repo 



More information about the Bps-public-commit mailing list