[Bps-public-commit] r14900 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Thu Aug 7 15:37:55 EDT 2008


Author: sartak
Date: Thu Aug  7 15:37:52 2008
New Revision: 14900

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI/PublishCommand.pm

Log:
 r68942 at onn:  sartak | 2008-08-07 15:37:42 -0400
 Reimplement PublishCommand to use rsync directly, and to not put the files into where-you-want/DB-UUID but instead where-you-want


Modified: Prophet/trunk/lib/Prophet/CLI/PublishCommand.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/PublishCommand.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/PublishCommand.pm	Thu Aug  7 15:37:52 2008
@@ -3,35 +3,24 @@
 
 use Path::Class;
 use File::Temp ();
-use File::Rsync;
 
-sub tempdir {
-    my $self = shift;
-    my $tmp = File::Temp::tempdir(CLEANUP => 1);
-    my $uuid = $self->app_handle->handle->db_uuid;
-
-    my $dir = dir($tmp, $uuid);
-    $dir->mkpath;
-
-    return $dir;
-}
+sub tempdir { dir(File::Temp::tempdir(CLEANUP => 1)) }
 
 sub publish_dir {
     my $self = shift;
     my %args = @_;
 
-    my $rsync = File::Rsync->new;
-    $rsync->exec({
-        src       => $args{from},
-        dst       => $args{to},
-        recursive => 1,
-        verbose   => $self->has_arg('verbose'),
-    });
+    my @args;
+    push @args, '--recursive';
+    push @args, '--verbose' if $self->has_arg('verbose');
+
+    push @args, '--';
+
+    push @args, dir($args{from})->children;
 
-    warn $_ for $rsync->err;
-    print $_ for $rsync->out;
+    push @args, $args{to};
 
-    return $rsync;
+    system("rsync", @args);
 }
 
 no Moose::Role;



More information about the Bps-public-commit mailing list