[Bps-public-commit] Prophet branch, master, updated. 0.69_01-24-g4e99c26

spang at bestpractical.com spang at bestpractical.com
Sat Aug 29 23:28:20 EDT 2009


The branch, master has been updated
       via  4e99c2609b4a1dc41a5163feb93ad6a878272a71 (commit)
      from  fbb53f8f30dd3879826ce2cbc7757d10eab6a9e5 (commit)

Summary of changes:
 lib/Prophet/CLI/PublishCommand.pm |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 4e99c2609b4a1dc41a5163feb93ad6a878272a71
Author: Christine Spang <spang at bestpractical.com>
Date:   Fri Aug 28 17:22:53 2009 -0400

    print a warning in publish if rsync <= 2.6.7
    
    Closes: 816699d2-918f-11de-811d-a8b61e21f617

diff --git a/lib/Prophet/CLI/PublishCommand.pm b/lib/Prophet/CLI/PublishCommand.pm
index 47534ca..3e908b6 100644
--- a/lib/Prophet/CLI/PublishCommand.pm
+++ b/lib/Prophet/CLI/PublishCommand.pm
@@ -12,9 +12,30 @@ sub publish_dir {
 
     $args{from} .= '/';
 
+    my $rsync = $ENV{RSYNC} || "rsync";
+
     my @args;
 
+    # chmod feature requires rsync >= 2.6.7
+    my ($rsync_version) = ( (qx{$rsync --version})[0] =~ /version ([\d.]+) / );
+    $rsync_version =~ s/[.]//g if $rsync_version; # kill dot separators in vnum
+    if ( $rsync_version && $rsync_version < 267 ) {
+        warn <<'END_WARNING';
+
+W: rsync >= 2.6.7 is required in order to ensure the published replica has
+W: the default permissions of the destination if they are more permissive
+W: than the source replica's permissions. You may wish to upgrade your
+W: rsync if possible. (I'll still publish, but your published replica
+W: will have the same permissions as the source replica, which is probably
+W: not what you want.)
+END_WARNING
+    }
     # Set directories to be globally +rx, files to be globally +r
+    # note - this frobs the permissions on the *sending* side; the
+    # receiving side's umask is still applied -- this option just
+    # allows you to publish a replica stored in a private directory
+    # and have it have the receiving end's default permissions, even
+    # if those are more permissive than the original location
     push @args, '--chmod=Da+rx,a+r';
 
     push @args, '--verbose' if $self->context->has_arg('verbose');
@@ -40,16 +61,14 @@ sub publish_dir {
     
     push @args, '--recursive', '--' , $args{from}, $args{to};
 
-    my $rsync = $ENV{RSYNC} || "rsync";
-
     my $ret = system($rsync, @args);
 
     if ($ret == -1) {
         die <<'END_DIE_MSG';
 You must have 'rsync' installed to use this command.
 
-If you have rsync but it's not in your path, set environment variable \$RSYNC
-to the absolute path of your rsync executable.
+If you have rsync but it's not in your path, set the environment variable
+$RSYNC to the absolute path of your rsync executable.
 END_DIE_MSG
     }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list