[Bps-public-commit] r14985 - in Shipwright/branches/2.0: lib/Shipwright/Backend

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Aug 11 05:59:21 EDT 2008


Author: sunnavy
Date: Mon Aug 11 05:59:18 2008
New Revision: 14985

Modified:
   Shipwright/branches/2.0/   (props changed)
   Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm
   Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm
   Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm

Log:
 r15452 at sunnavys-mb:  sunnavy | 2008-08-11 15:23:30 +0800
 support old format layout, aka. import to dists/ if there is no sources/


Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/FS.pm	Mon Aug 11 05:59:18 2008
@@ -71,16 +71,28 @@
                 ];
             }
             else {
-                unless ( -e $self->repository . "/sources/$args{name}/" ) {
+                if ( -e $self->repository . '/sources/' ) {
+                    unless ( -e $self->repository . "/sources/$args{name}/" ) {
+                        push @cmd,
+                          [
+                            'mkdir', $self->repository . "/sources/$args{name}/"
+                          ];
+                    }
+
                     push @cmd,
-                      [ 'mkdir', $self->repository . "/sources/$args{name}/" ];
+                      [
+                        'cp', '-r', "$args{source}/",
+                        $self->repository . "/sources/$args{name}/$args{as}",
+                      ];
                 }
+                else {
+                    push @cmd,
+                      [
+                        'cp', '-r', "$args{source}/",
+                        $self->repository . "/dists/$args{name}",
+                      ];
 
-                push @cmd, [
-                    'cp',          '-r',
-                    "$args{source}/", $self->repository .
-                        "/sources/$args{name}/$args{as}",
-                ];
+                }
             }
         }
     }

Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/SVK.pm	Mon Aug 11 05:59:18 2008
@@ -100,12 +100,27 @@
                 ];
             }
             else {
-                @cmd = [
-                    'svk',         'import',
-                    $args{source}, $self->repository .
-                        "/sources/$args{name}/$args{as}",
-                    '-m',          q{'} . $args{comment} . q{'},
-                ];
+                if ( $self->info( path => '/sources' ) ) {
+                    @cmd = [
+                        'svk',
+                        'import',
+                        $args{source},
+                        $self->repository . "/sources/$args{name}/$args{as}",
+                        '-m',
+                        q{'} . $args{comment} . q{'},
+                    ];
+                }
+                else {
+                    @cmd = [
+                        'svk',
+                        'import',
+                        $args{source},
+                        $self->repository . "/dists/$args{name}",
+                        '-m',
+                        q{'} . $args{comment} . q{'},
+                    ];
+
+                }
             }
         }
     }

Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm	(original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/SVN.pm	Mon Aug 11 05:59:18 2008
@@ -99,12 +99,28 @@
                 ];
             }
             else {
-                @cmd = [
-                    'svn',         'import',
-                    $args{source}, $self->repository .
-                        "/sources/$args{name}/$args{as}",
-                    '-m',          q{'} . $args{comment} . q{'},
-                ];
+                if ( $self->info( path => '/sources' ) ) {
+
+                    @cmd = [
+                        'svn',
+                        'import',
+                        $args{source},
+                        $self->repository . "/sources/$args{name}/$args{as}",
+                        '-m',
+                        q{'} . $args{comment} . q{'},
+                    ];
+                }
+                else {
+                    @cmd = [
+                        'svn',
+                        'import',
+                        $args{source},
+                        $self->repository . "/dists/$args{name}",
+                        '-m',
+                        q{'} . $args{comment} . q{'},
+                    ];
+
+                }
             }
         }
     }



More information about the Bps-public-commit mailing list