[Bps-public-commit] r15122 - in Shipwright/branches/1.10: . lib lib/Shipwright lib/Shipwright/Backend lib/Shipwright/Script lib/Shipwright/Source share/bin share/shipwright t t/hello t/hello/scripts

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Aug 13 10:57:33 EDT 2008


Author: sunnavy
Date: Wed Aug 13 10:57:33 2008
New Revision: 15122

Modified:
   Shipwright/branches/1.10/MANIFEST
   Shipwright/branches/1.10/META.yml
   Shipwright/branches/1.10/Makefile.PL
   Shipwright/branches/1.10/bin/shipwright
   Shipwright/branches/1.10/lib/Shipwright.pm
   Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm
   Shipwright/branches/1.10/lib/Shipwright/Backend/FS.pm
   Shipwright/branches/1.10/lib/Shipwright/Backend/SVK.pm
   Shipwright/branches/1.10/lib/Shipwright/Backend/SVN.pm
   Shipwright/branches/1.10/lib/Shipwright/Build.pm
   Shipwright/branches/1.10/lib/Shipwright/Script/Defaultbranch.pm
   Shipwright/branches/1.10/lib/Shipwright/Script/Import.pm
   Shipwright/branches/1.10/lib/Shipwright/Script/List.pm
   Shipwright/branches/1.10/lib/Shipwright/Source.pm
   Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm
   Shipwright/branches/1.10/lib/Shipwright/Source/Shipwright.pm
   Shipwright/branches/1.10/lib/Shipwright/Util.pm
   Shipwright/branches/1.10/share/bin/shipwright-builder
   Shipwright/branches/1.10/share/shipwright/branches.yml
   Shipwright/branches/1.10/t/21.perl_in_build.t
   Shipwright/branches/1.10/t/71.script_cmds.t
   Shipwright/branches/1.10/t/hello/scripts/build
   Shipwright/branches/1.10/t/hello/svk.t
   Shipwright/branches/1.10/t/hello/svn.t

Log:
revert back, stupidly pulled

Modified: Shipwright/branches/1.10/MANIFEST
==============================================================================
--- Shipwright/branches/1.10/MANIFEST	(original)
+++ Shipwright/branches/1.10/MANIFEST	Wed Aug 13 10:57:33 2008
@@ -29,7 +29,6 @@
 lib/Shipwright/Script.pm
 lib/Shipwright/Script/Build.pm
 lib/Shipwright/Script/Create.pm
-lib/Shipwright/Script/Defaultbranch.pm
 lib/Shipwright/Script/Delete.pm
 lib/Shipwright/Script/Flags.pm
 lib/Shipwright/Script/Help.pm
@@ -47,7 +46,6 @@
 lib/Shipwright/Source/Directory.pm
 lib/Shipwright/Source/FTP.pm
 lib/Shipwright/Source/HTTP.pm
-lib/Shipwright/Source/Shipwright.pm
 lib/Shipwright/Source/SVK.pm
 lib/Shipwright/Source/SVN.pm
 lib/Shipwright/Test.pm
@@ -64,7 +62,6 @@
 share/etc/shipwright-source-tcsh
 share/etc/shipwright-utility
 share/inc/YAML/Tiny.pm
-share/shipwright/branches.yml
 share/shipwright/flags.yml
 share/shipwright/known_test_failures.yml
 share/shipwright/map.yml

Modified: Shipwright/branches/1.10/META.yml
==============================================================================
--- Shipwright/branches/1.10/META.yml	(original)
+++ Shipwright/branches/1.10/META.yml	Wed Aug 13 10:57:33 2008
@@ -1,7 +1,7 @@
 ---
 abstract: 'Best Practical Builder'
 author:
-  - 'sunnavy  C<< <sunnavy at bestpractical.com> >>'
+  - 'sunnavy <sunnavy at bestpractical.com>'
 build_requires:
   ExtUtils::MakeMaker: 6.11
   IPC::Cmd: 0
@@ -18,9 +18,7 @@
     - t
     - docs
     - share
-    - share
     - inc
-    - t
 requires:
   Algorithm::Dependency::Ordered: 0
   Algorithm::Dependency::Source::HoA: 0
@@ -45,4 +43,4 @@
   version: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 2.0
+version: 1.11

Modified: Shipwright/branches/1.10/Makefile.PL
==============================================================================
--- Shipwright/branches/1.10/Makefile.PL	(original)
+++ Shipwright/branches/1.10/Makefile.PL	Wed Aug 13 10:57:33 2008
@@ -36,6 +36,7 @@
 
 no_index( directory => 't' );
 no_index( directory => 'docs' );
+no_index( directory => 'share' );
 
 install_script('bin/shipwright');
 install_share;

Modified: Shipwright/branches/1.10/bin/shipwright
==============================================================================
--- Shipwright/branches/1.10/bin/shipwright	(original)
+++ Shipwright/branches/1.10/bin/shipwright	Wed Aug 13 10:57:33 2008
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;

Modified: Shipwright/branches/1.10/lib/Shipwright.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright.pm	Wed Aug 13 10:57:33 2008
@@ -4,7 +4,7 @@
 use strict;
 use Carp;
 
-our $VERSION = '2.0';
+our $VERSION = '1.11';
 
 use base qw/Class::Accessor::Fast/;
 

Modified: Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Backend/Base.pm	Wed Aug 13 10:57:33 2008
@@ -61,7 +61,7 @@
     dircopy( Shipwright::Util->share_root, $dir );
 
     # share_root can't keep empty dirs, we have to create them manually
-    for (qw/scripts t sources/) {
+    for (qw/dists scripts t/) {
         mkdir File::Spec->catfile( $dir, $_ );
     }
 
@@ -84,21 +84,13 @@
     my $name = $args{source};
     $name =~ s{.*/}{};
 
-    if ( $args{branches} ) {
-        $args{as} = '';
-    }
-    else {
-        $args{as} ||= 'vendor';
-    }
-
     unless ( $args{_initialize} || $args{_extra_tests} ) {
         if ( $args{_extra_tests} ) {
             $self->delete( path => "/t/extra" ) if $args{delete};
 
             $self->log->info( "import extra tests to " . $self->repository );
-            for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
-                Shipwright::Util->run($cmd);
-            }
+            Shipwright::Util->run(
+                $self->_cmd( import => %args, name => $name ) );
         }
         elsif ( $args{build_script} ) {
             if ( $self->info( path => "/scripts/$name" )
@@ -113,22 +105,21 @@
 
                 $self->log->info(
                     "import $args{source}'s scripts to " . $self->repository );
-                for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
-                    Shipwright::Util->run($cmd);
-                }
+                Shipwright::Util->run(
+                    $self->_cmd( import => %args, name => $name ) );
                 $self->update_refs;
 
             }
         }
         else {
-            if ( $self->info( path => "/sources/$name/$args{as}" ) && not $args{overwrite} )
+            if ( $self->info( path => "/dists/$name" ) && not $args{overwrite} )
             {
                 $self->log->warn(
-"path sources/$name/$args{as} alreay exists, need to set overwrite arg to overwrite"
+"path dists/$name alreay exists, need to set overwrite arg to overwrite"
                 );
             }
             else {
-                $self->delete( path =>  "/sources/$name/$args{as}" ) if $args{delete};
+                $self->delete( path =>  "/dists/$name" ) if $args{delete};
                 $self->log->info(
                     "import $args{source} to " . $self->repository );
                 $self->_add_to_order($name);
@@ -137,34 +128,13 @@
                 $version->{$name} = $args{version};
                 $self->version($version);
 
-                my $branches = $self->branches;
-                if ( $args{branches} ) {
-            # mostly this happens when import from another shipwright repo
-                    $branches->{$name} = $args{branches};
-                    $self->branches($branches);
-                }
-                elsif (
-                    !(
-                        $branches->{$name} && grep { $args{as} eq $_ }
-                        @{ $branches->{$name} }
-                    )
-                  )
-                {
-                    $branches->{$name} =
-                      [ @{ $branches->{$name} || [] }, $args{as} ];
-                    $self->branches($branches);
-                }
-
-                for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
-                    Shipwright::Util->run($cmd);
-                }
+                Shipwright::Util->run(
+                    $self->_cmd( import => %args, name => $name ) );
             }
         }
     }
     else {
-        for my $cmd ( $self->_cmd( import => %args, name => $name ) ) {
-            Shipwright::Util->run($cmd);
-        }
+        Shipwright::Util->run( $self->_cmd( import => %args, name => $name ) );
     }
 }
 
@@ -179,9 +149,7 @@
     my $path = $args{path} || '';
     $self->log->info(
         'export ' . $self->repository . "/$path to $args{target}" );
-    for my $cmd ( $self->_cmd( export => %args ) ) {
-        Shipwright::Util->run( $cmd );
-    }
+    Shipwright::Util->run( $self->_cmd( export => %args ) );
 }
 
 =item checkout
@@ -194,9 +162,7 @@
     my $path = $args{path} || '';
     $self->log->info(
         'export ' . $self->repository . "/$path to $args{target}" );
-    for my $cmd ( $self->_cmd( checkout => %args ) ) {
-        Shipwright::Util->run( $cmd );
-    }
+    Shipwright::Util->run( $self->_cmd( checkout => %args ) );
 }
 
 =item commit
@@ -209,9 +175,7 @@
     my $self = shift;
     my %args = @_;
     $self->log->info( 'commit ' . $args{path} );
-    for my $cmd (  $self->_cmd( commit => @_ ) ) {
-        Shipwright::Util->run( $cmd, 1 );
-    }
+    Shipwright::Util->run( $self->_cmd( commit => @_ ), 1 );
 }
 
 
@@ -272,8 +236,8 @@
     my $name    = $args{name};
 
     return if $require->{$name};
-    my $out = Shipwright::Util->run( $self->_cmd( 'cat', path =>
-                "/scripts/$name/require.yml" ), 1 );
+    my $out = Shipwright::Util->run(
+        $self->_cmd( 'cat', path => "/scripts/$name/require.yml" ), 1 );
 
     my $req = Shipwright::Util::Load( $out ) || {};
 
@@ -379,20 +343,6 @@
     return $self->_yml( $path, $version );
 }
 
-=item branches
-
-Get or set branches.
-
-=cut
-
-sub branches {
-    my $self    = shift;
-    my $branches = shift;
-
-    my $path = '/shipwright/branches.yml';
-    return $self->_yml( $path, $branches );
-}
-
 =item ktf
 
 Get or set known failure conditions.
@@ -432,9 +382,7 @@
     my $path = $args{path} || '';
     if ( $self->info( path => $path ) ) {
         $self->log->info( "delete " . $self->repository . $path );
-        for my $cmd ( $self->_cmd( delete => path => $path ) ) {
-            Shipwright::Util->run( $cmd, 1 );
-        }
+        Shipwright::Util->run( $self->_cmd( delete => path => $path ), 1 );
     }
 }
 
@@ -477,15 +425,12 @@
     if ( $self->info( path => $path ) ) {
         $self->log->info(
             "move " . $self->repository . "/$path to /$new_path" );
-        for my $cmd (
+        Shipwright::Util->run(
             $self->_cmd(
                 move     => path => $path,
                 new_path => $new_path,
-            )
-          )
-        {
-            Shipwright::Util->run($cmd);
-        }
+            ),
+        );
     }
 }
 
@@ -611,7 +556,7 @@
     my $flags   = $self->flags   || {};
 
     for my $name (@names_to_trim) {
-        $self->delete( path => "/sources/$name" );
+        $self->delete( path => "/dists/$name" );
         $self->delete( path => "/scripts/$name" );
 
         # clean order.yml
@@ -659,8 +604,8 @@
         # initialize here, in case we don't have $name entry in $refs
         $refs->{$name} ||= 0;
 
-        my $out = Shipwright::Util->run( $self->_cmd( 'cat', path =>
-                    "/scripts/$name/require.yml"), 1 );
+        my $out = Shipwright::Util->run(
+            $self->_cmd( 'cat', path => "/scripts/$name/require.yml" ), 1 );
 
         my $req = Shipwright::Util::Load($out) || {};
 
@@ -685,18 +630,6 @@
     $self->refs( $refs );
 }
 
-=item has_branch_support
-
-return true if has branch support 
-
-=cut
-
-sub has_branch_support {
-    my $self = shift;
-    return 1 if $self->info( path => '/shipwright/branches.yml' );
-    return;
-}
-
 
 *_cmd = *_update_file = *_subclass_method;
 

Modified: Shipwright/branches/1.10/lib/Shipwright/Backend/FS.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Backend/FS.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Backend/FS.pm	Wed Aug 13 10:57:33 2008
@@ -51,75 +51,54 @@
         croak "$type need option $_" unless $args{$_};
     }
 
-    my @cmd;
+    my $cmd;
 
     if ( $type eq 'checkout' || $type eq 'export' ) {
-        @cmd = [ 'cp', '-r', $self->repository . $args{path}, $args{target} ];
+        $cmd = [ 'cp', '-r', $self->repository . $args{path}, $args{target} ];
     }
     elsif ( $type eq 'import' ) {
         if ( $args{_extra_tests} ) {
-            @cmd = [
+            $cmd = [
                 'cp', '-r',
                 $args{source}, $self->repository . '/t/extra'
             ];
         }
         else {
             if ( my $script_dir = $args{build_script} ) {
-                @cmd = [
+                $cmd = [
                     'cp',        '-r',
                     "$script_dir/", $self->repository . "/scripts/$args{name}",
                 ];
             }
             else {
-                if ( $self->has_branch_support ) {
-                    unless ( -e $self->repository
-                        . "/sources/$args{name}/$args{as}" )
-                    {
-                        push @cmd,
-                          [
-                            'mkdir', '-p',
-                            $self->repository . "/sources/$args{name}/$args{as}"
-                          ];
-                    }
-
-                    push @cmd,
-                      [
-                        'cp', '-r', "$args{source}/",
-                        $self->repository . "/sources/$args{name}/$args{as}",
-                      ];
-                }
-                else {
-                    push @cmd,
-                      [
-                        'cp', '-r', "$args{source}/",
-                        $self->repository . "/dists/$args{name}",
-                      ];
-
-                }
+                $cmd = [
+                    'cp',          '-r',
+                    "$args{source}/", $self->repository . "/dists/$args{name}",
+                ];
             }
         }
     }
     elsif ( $type eq 'delete' ) {
-        @cmd = [ 'rm', '-rf', $self->repository . $args{path}, ];
+        $cmd = [ 'rm', '-rf', $self->repository . $args{path}, ];
     }
     elsif ( $type eq 'move' ) {
-        @cmd = [
+        $cmd = [
             'mv',
             $self->repository . $args{path},
             $self->repository . $args{new_path}
         ];
     }
     elsif ( $type eq 'info' || $type eq 'list' ) {
-        @cmd = [ 'ls', $self->repository . $args{path} ];
+        $cmd = [ 'ls', $self->repository . $args{path} ];
     }
     elsif ( $type eq 'cat' ) {
-        @cmd = [ 'cat', $self->repository . $args{path} ];
+        $cmd = [ 'cat', $self->repository . $args{path} ];
     }
     else {
         croak "invalid command: $type";
     }
 
-    return @cmd;
+    return $cmd;
 }
 
 =item _yml

Modified: Shipwright/branches/1.10/lib/Shipwright/Backend/SVK.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Backend/SVK.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Backend/SVK.pm	Wed Aug 13 10:57:33 2008
@@ -54,98 +54,72 @@
         croak "$type need option $_" unless $args{$_};
     }
 
-    my @cmd;
+    my $cmd;
 
     if ( $type eq 'checkout' ) {
         if ( $args{detach} ) {
-            @cmd = [ 'svk', 'checkout', '-d', $args{target} ];
+            $cmd = [ 'svk', 'checkout', '-d', $args{target} ];
         }
         else {
-            @cmd = [
+            $cmd = [
                 'svk',                           'checkout',
                 $self->repository . $args{path}, $args{target}
             ];
         }
     }
     elsif ( $type eq 'export' ) {
-        @cmd = (
-            [
-                'svk',                           'checkout',
-                $self->repository . $args{path}, $args{target}
-            ],
-            [
-                'svk', 'checkout', '-d', $args{target}
-            ]
-        );
+        $cmd =
+          [ 'svk', 'checkout', $self->repository . $args{path}, $args{target} ];
+
+        #            $cmd = [ 'svk', 'checkout', '-d', $args{target} ];
     }
     elsif ( $type eq 'list' ) {
-        @cmd = [ 'svk', 'list', $self->repository . $args{path} ];
+        $cmd = [ 'svk', 'list', $self->repository . $args{path} ];
     }
     elsif ( $type eq 'import' ) {
         if ( $args{_initialize} ) {
-            @cmd = [
+            $cmd = [
                 'svk',         'import',
                 $args{source}, $self->repository,
                 '-m',          q{'} . $args{comment} . q{'},
             ];
         }
         elsif ( $args{_extra_tests} ) {
-            @cmd = [
+            $cmd = [
                 'svk', 'import',
                 $args{source}, $self->repository . '/t/extra',
                 '-m', q{'} . $args{comment} . q{'},
             ];
         }
         else {
-            my ( $path, $source );
-            if ( $args{build_script} ) {
-                $path   = "/scripts/$args{name}";
-                $source = $args{build_script};
-            }
-            else {
-                $path =
-                  $self->has_branch_support
-                  ? "/sources/$args{name}/$args{as}"
-                  : "/dists/$args{name}";
-                $source = $args{source};
-            }
-
-            if ( $self->info( path => $path ) ) {
-                my $tmp_dir = tempdir( CLEANUP => 1 );
-                @cmd = (
-                    [ 'rm',  '-rf', "$tmp_dir" ],
-                    [ 'svk', 'checkout', $self->repository . $path, $tmp_dir ],
-                    [ 'rm',  '-rf', "$tmp_dir" ],
-                    [ 'cp',  '-r',  $source,                   "$tmp_dir" ],
-                    [
-                        'svk',      'commit',
-                        '--import', $tmp_dir,
-                        '-m',       q{'} . $args{comment} . q{'}
-                    ],
-                    [ 'svk', 'checkout', '-d', $tmp_dir ],
-                );
+            if ( my $script_dir = $args{build_script} ) {
+                $cmd = [
+                    'svk',       'import',
+                    $script_dir, $self->repository . "/scripts/$args{name}/",
+                    '-m',        q{'} . $args{comment} . q{'},
+                ];
             }
             else {
-                @cmd = [
-                    'svk',   'import',
-                    $source, $self->repository . $path,
-                    '-m',    q{'} . $args{comment} . q{'},
+                $cmd = [
+                    'svk',         'import',
+                    $args{source}, $self->repository . "/dists/$args{name}",
+                    '-m',          q{'} . $args{comment} . q{'},
                 ];
             }
         }
     }
     elsif ( $type eq 'commit' ) {
-        @cmd =
+        $cmd =
           [ 'svk', 'commit', '-m', q{'} . $args{comment} . q{'}, $args{path} ];
     }
     elsif ( $type eq 'delete' ) {
-        @cmd = [
+        $cmd = [
             'svk', 'delete', '-m', q{'} . 'delete repository' . q{'},
             $self->repository . $args{path},
         ];
     }
     elsif ( $type eq 'move' ) {
-        @cmd = [
+        $cmd = [
             'svk',
             'move',
             '-m',
@@ -155,16 +129,16 @@
         ];
     }
     elsif ( $type eq 'info' ) {
-        @cmd = [ 'svk', 'info', $self->repository . $args{path} ];
+        $cmd = [ 'svk', 'info', $self->repository . $args{path} ];
     }
     elsif ( $type eq 'cat' ) {
-        @cmd = [ 'svk', 'cat', $self->repository . $args{path} ];
+        $cmd = [ 'svk', 'cat', $self->repository . $args{path} ];
     }
     else {
         croak "invalid command: $type";
     }
 
-    return @cmd;
+    return $cmd;
 }
 
 sub _yml {

Modified: Shipwright/branches/1.10/lib/Shipwright/Backend/SVN.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Backend/SVN.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Backend/SVN.pm	Wed Aug 13 10:57:33 2008
@@ -65,26 +65,26 @@
         croak "$type need option $_" unless $args{$_};
     }
 
-    my @cmd;
+    my $cmd;
 
     if ( $type eq 'checkout' ) {
-        @cmd =
+        $cmd =
           [ 'svn', 'checkout', $self->repository . $args{path}, $args{target} ];
     }
     elsif ( $type eq 'export' ) {
-        @cmd =
+        $cmd =
           [ 'svn', 'export', $self->repository . $args{path}, $args{target} ];
     }
     elsif ( $type eq 'import' ) {
         if ( $args{_initialize} ) {
-            @cmd = [
+            $cmd = [
                 'svn',         'import',
                 $args{source}, $self->repository,
                 '-m',          q{'} . $args{comment} . q{'}
             ];
         }
         elsif ( $args{_extra_tests} ) {
-            @cmd = [
+            $cmd = [
                 'svn', 'import',
                 $args{source}, $self->repository . 't/extra',
                 '-m', q{'} . $args{comment} . q{'},
@@ -92,52 +92,36 @@
         }
         else {
             if ( my $script_dir = $args{build_script} ) {
-                @cmd = [
+                $cmd = [
                     'svn',       'import',
                     $script_dir, $self->repository . "/scripts/$args{name}/",
                     '-m',        q{'} . $args{comment} || '' . q{'},
                 ];
             }
             else {
-                if ( $self->has_branch_support ) {
-                    @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{'},
-                    ];
-
-                }
+                $cmd = [
+                    'svn',         'import',
+                    $args{source}, $self->repository . "/dists/$args{name}",
+                    '-m',          q{'} . $args{comment} . q{'},
+                ];
             }
         }
     }
     elsif ( $type eq 'list' ) {
-        @cmd = [ 'svn', 'list', $self->repository . $args{path} ];
+        $cmd = [ 'svn', 'list', $self->repository . $args{path} ];
     }
     elsif ( $type eq 'commit' ) {
-        @cmd =
+        $cmd =
           [ 'svn', 'commit', '-m', q{'} . $args{comment} . q{'}, $args{path} ];
     }
     elsif ( $type eq 'delete' ) {
-        @cmd = [
+        $cmd = [
             'svn', 'delete', '-m', q{'} . 'delete' . $args{path} . q{'},
             $self->repository . $args{path}
         ];
     }
     elsif ( $type eq 'move' ) {
-        @cmd = [
+        $cmd = [
             'svn',
             'move',
             '-m',
@@ -147,16 +131,16 @@
         ];
     }
     elsif ( $type eq 'info' ) {
-        @cmd = [ 'svn', 'info', $self->repository . $args{path} ];
+        $cmd = [ 'svn', 'info', $self->repository . $args{path} ];
     }
     elsif ( $type eq 'cat' ) {
-        @cmd = [ 'svn', 'cat', $self->repository . $args{path} ];
+        $cmd = [ 'svn', 'cat', $self->repository . $args{path} ];
     }
     else {
         croak "invalid command: $type";
     }
 
-    return @cmd;
+    return $cmd;
 }
 
 sub _yml {

Modified: Shipwright/branches/1.10/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Build.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Build.pm	Wed Aug 13 10:57:33 2008
@@ -116,7 +116,7 @@
             File::Spec->catfile( 'shipwright', 'order.yml' ) )
           || [];
 
-        my ( $flags, $ktf, $branches );
+        my ( $flags, $ktf );
         if ( -e File::Spec->catfile( 'shipwright', 'flags.yml' ) ) {
 
             $flags = Shipwright::Util::LoadFile(
@@ -144,12 +144,6 @@
             $ktf = {};
         }
 
-        if ( -e File::Spec->catfile( 'shipwright', 'branches.yml' ) ) {
-
-            $branches = Shipwright::Util::LoadFile(
-                File::Spec->catfile( 'shipwright', 'branches.yml' ) );
-        }
-
         # calculate the real order
         if ( $self->only ) {
             @$order = grep { $self->only->{$_} } @$order;
@@ -182,9 +176,8 @@
             }
         }
 
-        mkdir 'dists' unless -e 'dists';
         for my $dist (@$order) {
-            $self->_install( $dist, $ktf, $branches );
+            $self->_install( $dist, $ktf );
             $self->_record($dist);
             chdir $self->build_base;
         }
@@ -203,19 +196,6 @@
     my $self = shift;
     my $dir  = shift;
     my $ktf  = shift;
-    my $branches = shift;
-
-    if ( $branches ) {
-            system(
-                "cp -r "
-                  . File::Spec->catdir( 'sources', $dir, split /\//,
-                    $branches->{$dir}[0] )
-                  . ' '
-                  . File::Spec->catdir( 'dists', $dir )
-              )
-              && die
-              "cp sources/$dir/$branches->{$dir}[0] to dists/$dir failed";
-    }
 
     chdir File::Spec->catfile( 'dists', $dir );
 

Modified: Shipwright/branches/1.10/lib/Shipwright/Script/Defaultbranch.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Script/Defaultbranch.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Script/Defaultbranch.pm	Wed Aug 13 10:57:33 2008
@@ -1,56 +0,0 @@
-package Shipwright::Script::Defaultbranch;
-use strict;
-use warnings;
-use Carp;
-
-use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
-
-use Shipwright;
-
-sub run {
-    my $self    = shift;
-    my $name    = shift;
-    my $default = shift;
-
-    die "need name arg\n" unless $name;
-    die "need default arg\n" unless $default;
-
-    my $shipwright = Shipwright->new( repository => $self->repository, );
-
-    my $branches = $shipwright->backend->branches;
-
-    if ( grep { $default eq $_ } @{ $branches->{$name} } ) {
-
-        # move $default to head
-        @{ $branches->{$name} } =
-          ( $default, grep { $_ ne $default } @{ $branches->{$name} } );
-        $shipwright->backend->branches( $branches );
-        print "set default branch for $name with success, now it's $default\n";
-    }
-    else {
-        die "$name doesn't have branches $default.
-Available branches are " . join( ', ', @{$branches->{$name}} ). "\n";
-    }
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-Shipwright::Script::Defaultbranch - set the default branch for a dist
-
-=head1 SYNOPSIS
-
- defaultbranch -r ... DIST BRANCH
-
-=head1 OPTIONS
-
- -r [--repository] REPOSITORY   : specify the repository of our project
- -l [--log-level] LOGLEVEL      : specify the log level
-                                  (info, debug, warn, error, or fatal)
- --log-file FILENAME            : specify the log file
-
-=head1 DESCRIPTION
-

Modified: Shipwright/branches/1.10/lib/Shipwright/Script/Import.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Script/Import.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Script/Import.pm	Wed Aug 13 10:57:33 2008
@@ -7,7 +7,7 @@
 use base qw/App::CLI::Command Class::Accessor::Fast Shipwright::Script/;
 __PACKAGE__->mk_accessors(
     qw/comment no_follow build_script require_yml
-      name test_script extra_tests overwrite min_perl_version skip version as/
+      name test_script extra_tests overwrite min_perl_version skip version/
 );
 
 use Shipwright;
@@ -34,7 +34,6 @@
         'min-perl-version' => 'min_perl_version',
         'skip=s'           => 'skip',
         'version=s'        => 'version',
-        'as=s'             => 'as',
     );
 }
 
@@ -137,7 +136,6 @@
             $script_dir = File::Spec->catdir( $base, '__scripts', $name );
         }
         else {
-
      # Source part doesn't have script stuff, so we need to create by ourselves.
             $script_dir = tempdir( CLEANUP => 1 );
 
@@ -162,18 +160,12 @@
             }
         }
 
-        my $branches =
-          Shipwright::Util::LoadFile( $shipwright->source->branches_path );
-
         $shipwright->backend->import(
             source  => $source,
             comment => $self->comment || 'import ' . $source,
-            overwrite => 1,                    # import anyway for the main dist
+            overwrite => 1,                   # import anyway for the main dist
             version   => $version->{$name},
-            as        => $self->as,
-            branches  => $branches->{$name},
         );
-
         $shipwright->backend->import(
             source       => $source,
             comment      => 'import scripts for' . $source,
@@ -205,10 +197,10 @@
 # _import_req: import required dists for a dist
 
 sub _import_req {
-    my $self       = shift;
-    my $source     = shift;
-    my $shipwright = shift;
-    my $script_dir = shift;
+    my $self         = shift;
+    my $source       = shift;
+    my $shipwright   = shift;
+    my $script_dir   = shift;
 
     my $require_file = File::Spec->catfile( $source, '__require.yml' );
     $require_file = File::Spec->catfile( $script_dir, 'require.yml' )
@@ -269,14 +261,11 @@
 
                     $self->_import_req( $s, $shipwright, $script_dir );
 
-                    my $branches = Shipwright::Util::LoadFile(
-                        $shipwright->source->branches_path );
                     $shipwright->backend->import(
                         comment   => 'deps for ' . $source,
                         source    => $s,
                         overwrite => $self->overwrite,
                         version   => $version->{$dist},
-                        branches  => $branches->{$dist},
                     );
                     $shipwright->backend->import(
                         source       => $s,

Modified: Shipwright/branches/1.10/lib/Shipwright/Script/List.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Script/List.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Script/List.pm	Wed Aug 13 10:57:33 2008
@@ -28,11 +28,6 @@
     my $versions = $shipwright->backend->version;
     my $source   = $shipwright->backend->source;
     my $refs = $shipwright->backend->refs || {};
-    my $branches;
-
-    if ( $shipwright->backend->has_branch_support ) {
-        $branches = $shipwright->backend->branches;
-    }
 
     my $latest_version = {};
 
@@ -43,7 +38,7 @@
         my $map = $shipwright->backend->map;
 
         if ( $name ) {
-            if ( $name =~ /^cpan-/ && ! $source->{$name} ) {
+            if ( $name =~ /^cpan-/ ) {
                 my %reversed = reverse %$map;
                 my $module   = $reversed{ $name };
                 $latest_version->{ $name } =
@@ -64,7 +59,7 @@
 
             for my $name ( keys %$source ) {
                 next if exists $latest_version->{$name};
-                if ( $source->{$name} =~ m{^(sv[nk]|shipwright):} ) {
+                if ( $source->{$name} =~ m{^sv[nk]:} ) {
                     $latest_version->{$name} =
                       $self->_latest_version( url => $source->{$name} );
                 }
@@ -103,10 +98,6 @@
                 print ' ' x 4 . 'latest_version: ', $latest_version->{$name}
                   || 'unknown', "\n";
             }
-            if ($branches) {
-                print ' ' x 4 . 'branches: ',
-                  join( ', ', @{ $branches->{$name} } ), "\n";
-            }
         }
     }
 
@@ -122,11 +113,6 @@
 
         my ( $cmd, $out );
 
-# XXX TODO we need a better latest_version for shipwright source
-# using the source shipwright repo's whole version seems lame
-        $args{url} =~ s/^shipwright://;
-        $args{url} =~ s!/[^/]+$!!;
-
         # has url, meaning svn or svk
         if ( $args{url} =~ /^svn[:+]/ ) {
             $args{url} =~ s{^svn:(?!//)}{};

Modified: Shipwright/branches/1.10/lib/Shipwright/Source.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Source.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Source.pm	Wed Aug 13 10:57:33 2008
@@ -20,10 +20,8 @@
 $DEFAULT{url_path} = File::Spec->catfile( $DEFAULT{directory}, 'url.yml' );
 $DEFAULT{version_path} =
   File::Spec->catfile( $DEFAULT{directory}, 'version.yml' );
-$DEFAULT{branches_path} =
-  File::Spec->catfile( $DEFAULT{directory}, 'branches.yml' );
 
-for (qw/map_path url_path version_path branches_path/) {
+for (qw/map_path url_path version_path/) {
     open my $fh, '>', $DEFAULT{$_} or die "can't write to $DEFAULT{$_}: $!";
     close $fh;
 }

Modified: Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm	Wed Aug 13 10:57:33 2008
@@ -14,7 +14,7 @@
 __PACKAGE__->mk_accessors(
     qw/source directory scripts_directory download_directory follow 
     min_perl_version map_path skip map keep_recommends keep_build_requires 
-    name log url_path version_path branches_path version/
+    name log url_path version_path version/
 );
 
 =head1 NAME
@@ -394,19 +394,6 @@
     Shipwright::Util::DumpFile( $self->version_path, $map );
 }
 
-sub _update_branches {
-    my $self    = shift;
-    my $name    = shift;
-    my $branches = shift;
-
-    my $map = {};
-    if ( -e $self->version_path && !-z $self->branches_path ) {
-        $map = Shipwright::Util::LoadFile( $self->branches_path );
-    }
-    $map->{$name} = $branches;
-    Shipwright::Util::DumpFile( $self->branches_path, $map );
-}
-
 sub _is_skipped {
     my $self   = shift;
     my $module = shift;

Modified: Shipwright/branches/1.10/lib/Shipwright/Source/Shipwright.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Source/Shipwright.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Source/Shipwright.pm	Wed Aug 13 10:57:33 2008
@@ -20,18 +20,10 @@
     my $source_shipwright = Shipwright->new( repository => $base );
     $self->name( $dist ) unless $self->name;
 
-    if ( $source_shipwright->backend->has_branch_support ) {
-        $source_shipwright->backend->export(
-            target => File::Spec->catfile( $self->directory, $self->name ),
-            path   => "/sources/$dist",
-        );
-    }
-    else {
-        $source_shipwright->backend->export(
-            target => File::Spec->catfile( $self->directory, $self->name ),
-            path   => "/dists/$dist",
-        );
-    }
+    $source_shipwright->backend->export(
+        target => File::Spec->catfile( $self->directory, $self->name ),
+        path   => "/dists/$dist",
+    );
 
     $source_shipwright->backend->export(
         target => File::Spec->catfile( $self->scripts_directory, $self->name ),
@@ -39,17 +31,14 @@
     );
     
     my $source_version = $source_shipwright->backend->version->{$dist};
-    my $branches = $source_shipwright->backend->branches;
     $self->_update_version( $self->name || $dist, $source_version );
-    $self->_update_url( $self->name || $dist, 'shipwright:' . $self->source );
-    $self->_update_branches( $self->name || $dist, $branches->{$dist} );
+    $self->_update_url( $self->name || $dist, $self->source );
 
 # follow
     if ( $self->follow ) {
         my $out = Shipwright::Util->run(
             $source_shipwright->backend->_cmd(
-                'cat',
-                path => "/scripts/$dist/require.yml",
+                'cat', path => "/scripts/$dist/require.yml"
             ),
             1
         );

Modified: Shipwright/branches/1.10/lib/Shipwright/Util.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Util.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Util.pm	Wed Aug 13 10:57:33 2008
@@ -61,18 +61,13 @@
     Shipwright::Util->select('stdout');
 
     $log->info("run output:\n$out") if $out;
-    $log->error("run err:\n$err")    if $err;
+    $log->warn("run err:\n$err")    if $err;
 
     if ($?) {
         $log->error(
             'failed to run ' . join( ' ', @$cmd ) . " with exit number $?" );
-        unless ($ignore_failure) {
-            die <<"EOF";
-something wrong when execute @$cmd: $?
-the output is: $out
-the error is: $err
-EOF
-        }
+
+        die "something wrong when execute @$cmd: $?" unless $ignore_failure;
     }
 
     return wantarray ? ( $out, $err ) : $out;

Modified: Shipwright/branches/1.10/share/bin/shipwright-builder
==============================================================================
--- Shipwright/branches/1.10/share/bin/shipwright-builder	(original)
+++ Shipwright/branches/1.10/share/bin/shipwright-builder	Wed Aug 13 10:57:33 2008
@@ -132,7 +132,7 @@
 my $order =
   ( YAML::Tiny->read( File::Spec->catfile( 'shipwright', 'order.yml' ) ) )->[0];
 
-my ( $flags, $ktf, $branches );
+my ( $flags, $ktf );
 
 if ( -e File::Spec->catfile( 'shipwright', 'flags.yml' ) ) {
     $flags =
@@ -154,14 +154,6 @@
     $ktf = {};
 }
 
-if ( -e File::Spec->catfile( 'shipwright', 'branches.yml' ) ) {
-    $branches = (
-        YAML::Tiny->read(
-            File::Spec->catfile( 'shipwright', 'branches.yml' )
-        )
-    )->[0];
-}
-
 # fill not specified but mandatory flags
 if ( $flags->{__mandatory} ) {
     for my $list ( values %{ $flags->{__mandatory} } ) {
@@ -197,17 +189,12 @@
     open $log, '>', 'clean.log' or die $!;
 
     system('rm -rf tmp_dists') && die "rm tmp_dists failed\n";
+
     print $log "removed tmp_dists";
 
-    if ($branches) {
-        system('rm -rf dists') && die "rm dists failed\n";
-        print $log "removed dists";
-    }
-    else {
-        for my $dist (@$order) {
-            clean($dist);
-            chdir $build_base;
-        }
+    for my $dist (@$order) {
+        clean($dist);
+        chdir $build_base;
     }
 
     unlink '__need_clean';
@@ -307,7 +294,6 @@
       File::Spec->catfile( $args{'install-base'}, 'tools',
         'shipwright-utility' );
 
-    mkdir 'dists' unless -e 'dists';
     for my $dist (@$order) {
         install($dist);
         record($dist);
@@ -329,18 +315,7 @@
         chdir File::Spec->catfile( 'tmp_dists', $dir );
     }
     else {
-        if ($branches) {
-            system(
-                "cp -r "
-                  . File::Spec->catdir( 'sources', $dir, split /\//,
-                    $branches->{$dir}[0] )
-                  . ' '
-                  . File::Spec->catdir( 'dists', $dir )
-              )
-              && die
-              "cp sources/$dir/$branches->{$dir}[0] to dists/$dir failed";
-        }
-        chdir File::Spec->catdir( 'dists', $dir );
+        chdir File::Spec->catfile( 'dists', $dir );
     }
 
     my $skip_test = $args{'skip-test'} || $args{'skip-test-except-final'};

Modified: Shipwright/branches/1.10/share/shipwright/branches.yml
==============================================================================
--- Shipwright/branches/1.10/share/shipwright/branches.yml	(original)
+++ Shipwright/branches/1.10/share/shipwright/branches.yml	Wed Aug 13 10:57:33 2008
@@ -1 +0,0 @@
----

Modified: Shipwright/branches/1.10/t/21.perl_in_build.t
==============================================================================
--- Shipwright/branches/1.10/t/21.perl_in_build.t	(original)
+++ Shipwright/branches/1.10/t/21.perl_in_build.t	Wed Aug 13 10:57:33 2008
@@ -66,6 +66,7 @@
         build_script => $script_dir,
     );
     $sw->backend->export( target => $sw->build->build_base );
+    $sw->build->build_base;
     $sw->build->run;
     is( $sw->build->perl, $perl,
 'set $build->perl to the one that will be in installed_dir if there is a dist with name perl'

Modified: Shipwright/branches/1.10/t/71.script_cmds.t
==============================================================================
--- Shipwright/branches/1.10/t/71.script_cmds.t	(original)
+++ Shipwright/branches/1.10/t/71.script_cmds.t	Wed Aug 13 10:57:33 2008
@@ -280,7 +280,7 @@
                 [ 'list', 'foo' ],
                 $update_cmd
                 ? qr/version:\s+1\s+/
-                : qr/version:\s+57\s+/m, # the magic number is from practice ;)
+                : qr/version:\s+55\s+/m, # the magic number is from practice ;)
                 'list foo, version seems ok',
             ],
             $update_cmd,    # if the source dist is svk, $update_cmd is undef
@@ -288,7 +288,7 @@
                 [ 'list', 'foo', '--with-latest-version' ],
                 $update_cmd
                 ? qr/latest_version:\s+([^1]|\d{2,})\s+/
-                : qr/latest_version:\s+(?!57)\d+\s+/,
+                : qr/latest_version:\s+(?!55)\d+\s+/,
                 'list foo, latest version seems ok',
             ],
 

Modified: Shipwright/branches/1.10/t/hello/scripts/build
==============================================================================
--- Shipwright/branches/1.10/t/hello/scripts/build	(original)
+++ Shipwright/branches/1.10/t/hello/scripts/build	Wed Aug 13 10:57:33 2008
@@ -1,5 +1,5 @@
 # this is a test comment
-configure: /usr/bin/perl Build.PL --install_base=%%INSTALL_BASE%%
+configure: /usr/bin/env perl Build.PL --install_base=%%INSTALL_BASE%%
 make: ./Build
 test: ./Build test
 # and another

Modified: Shipwright/branches/1.10/t/hello/svk.t
==============================================================================
--- Shipwright/branches/1.10/t/hello/svk.t	(original)
+++ Shipwright/branches/1.10/t/hello/svk.t	Wed Aug 13 10:57:33 2008
@@ -62,7 +62,7 @@
     chomp @dirs;
     is_deeply(
         [@dirs],
-        [ 'bin/', 'etc/', 'inc/', 'scripts/', 'shipwright/', 'sources/', 't/' ],
+        [ 'bin/', 'dists/', 'etc/', 'inc/', 'scripts/', 'shipwright/', 't/' ],
         'initialize works'
     );
 
@@ -82,8 +82,7 @@
     # import
 
     $shipwright->backend->import( name => 'hello', source => $source_dir );
-    ok( grep( {/Build\.PL/} `svk ls $repo/sources/Acme-Hello/vendor` ),
-        'imported ok' );
+    ok( grep( {/Build\.PL/} `svk ls $repo/dists/Acme-Hello` ), 'imported ok' );
 
     my $script_dir = tempdir( CLEANUP => 1 );
     copy( File::Spec->catfile( 't', 'hello', 'scripts', 'build' ),
@@ -112,13 +111,12 @@
             'shipwright-script-wrapper'
         ),
         File::Spec->catfile(
-            $shipwright->build->build_base, 'sources',
-            'Acme-Hello',                   'vendor',
+            $shipwright->build->build_base,
+            'dists', 'Acme-Hello',
         ),
         File::Spec->catfile(
-            $shipwright->build->build_base, 'sources',
-            'Acme-Hello',                   'vendor',
-            'MANIFEST',
+            $shipwright->build->build_base, 'dists',
+            'Acme-Hello',                   'MANIFEST',
         ),
         File::Spec->catfile(
             $shipwright->build->build_base, 'scripts',
@@ -146,18 +144,16 @@
     chdir $cwd;
     $shipwright = Shipwright->new(
         repository => "svk:$repo",
-        source     => 'file:'
-          . File::Spec->catfile( 't', 'hello', 'Acme-Hello-0.03.tar.gz' ),
-        name      => 'howdy',
-        follow    => 0,
+        source => 'file:' . File::Spec->catfile( 't', 'hello', 'Acme-Hello-0.03.tar.gz' ),
+        name   => 'howdy',
+        follow => 0,
         log_level => 'FATAL',
     );
 
     $source_dir = $shipwright->source->run();
     like( $source_dir, qr/\bhowdy\b/, 'source name looks ok' );
     $shipwright->backend->import( name => 'hello', source => $source_dir );
-    ok( grep( {/Build\.PL/} `svk ls $repo/sources/howdy/vendor` ),
-        'imported ok' );
+    ok( grep( {/Build\.PL/} `svk ls $repo/dists/howdy` ), 'imported ok' );
     $script_dir = tempdir( CLEANUP => 1 );
     copy( File::Spec->catfile( 't', 'hello', 'scripts', 'build' ),
         $script_dir );

Modified: Shipwright/branches/1.10/t/hello/svn.t
==============================================================================
--- Shipwright/branches/1.10/t/hello/svn.t	(original)
+++ Shipwright/branches/1.10/t/hello/svn.t	Wed Aug 13 10:57:33 2008
@@ -34,7 +34,7 @@
     chomp @dirs;
     is_deeply(
         [@dirs],
-        [ 'bin/', 'etc/', 'inc/', 'scripts/', 'shipwright/', 'sources/', 't/' ],
+        [ 'bin/', 'dists/', 'etc/', 'inc/', 'scripts/', 'shipwright/', 't/' ],
         'initialize works'
     );
 
@@ -43,8 +43,7 @@
 
     # import
     $shipwright->backend->import( name => 'hello', source => $source_dir );
-    ok( grep( {/Build\.PL/} `svn ls $repo/sources/Acme-Hello/vendor` ),
-        'imported ok' );
+    ok( grep( {/Build\.PL/} `svn ls $repo/dists/Acme-Hello` ), 'imported ok' );
 
     my $script_dir = tempdir( CLEANUP => 1 );
     copy( File::Spec->catfile( 't', 'hello', 'scripts', 'build' ),
@@ -74,13 +73,12 @@
             'shipwright-script-wrapper'
         ),
         File::Spec->catfile(
-            $shipwright->build->build_base, 'sources',
-            'Acme-Hello',                   'vendor',
+            $shipwright->build->build_base,
+            'dists', 'Acme-Hello',
         ),
         File::Spec->catfile(
-            $shipwright->build->build_base, 'sources',
-            'Acme-Hello',                   'vendor',
-            'MANIFEST',
+            $shipwright->build->build_base, 'dists',
+            'Acme-Hello',                   'MANIFEST',
         ),
         File::Spec->catfile(
             $shipwright->build->build_base, 'scripts',
@@ -118,8 +116,7 @@
     $source_dir = $shipwright->source->run();
     like( $source_dir, qr/\bhowdy\b/, 'source name looks ok' );
     $shipwright->backend->import( name => 'hello', source => $source_dir );
-    ok( grep( {/Build\.PL/} `svn ls $repo/sources/howdy/vendor` ),
-        'imported ok' );
+    ok( grep( {/Build\.PL/} `svn ls $repo/dists/howdy` ), 'imported ok' );
     $script_dir = tempdir( CLEANUP => 1 );
     copy( File::Spec->catfile( 't', 'hello', 'scripts', 'build' ),
         $script_dir );



More information about the Bps-public-commit mailing list