فهرست منبع

Forgot I'm in caveman land

Andy Baugh 1 ماه پیش
والد
کامیت
185ce56ee2
2فایلهای تغییر یافته به همراه7 افزوده شده و 6 حذف شده
  1. 5 5
      lib/Net/OpenSSH/More.pm
  2. 2 1
      lib/Net/OpenSSH/More/Linux.pm

+ 5 - 5
lib/Net/OpenSSH/More.pm

@@ -553,7 +553,7 @@ Dies in this module, as this varies on different platforms (GNU/LINUX, Windows,
 =cut
 
 sub copy {
-	die "Unimplemented, use a subclass of this perhaps?";
+    die "Unimplemented, use a subclass of this perhaps?";
 }
 
 =head2 B<backup_files (FILES)>
@@ -602,11 +602,11 @@ sub backup_files {
                 my $bkup = $file . '.' . $self->{'file_backups'}{$file};
                 if ($stash) {
                     $self->diag("[INFO] Moving '$file' to '$bkup'");
-                    $self->sftp->rename($file, $bkup);
+                    $self->sftp->rename( $file, $bkup );
                 }
                 else {
                     $self->diag("[INFO] Backing up '$file' to '$bkup'");
-                    $self->copy($file, $bkup); # XXX Probably not that portable, maybe move to Linux.pm somehow?
+                    $self->copy( $file, $bkup );    # XXX Probably not that portable, maybe move to Linux.pm somehow?
                 }
 
                 # otherwise if the file to be backed up doesn't exist
@@ -684,8 +684,8 @@ the parent's destructor kicks in:
 
 sub DESTROY {
     my ($self) = @_;
-    return                                                       if !$self->{'_perl_pid'} || $$ != $self->{'_perl_pid'} || $disable_destructor;
-	$self->restore_files();
+    return if !$self->{'_perl_pid'} || $$ != $self->{'_perl_pid'} || $disable_destructor;
+    $self->restore_files();
     $ENV{SSH_AUTH_SOCK} = $self->{'_opts'}{'_restore_auth_sock'} if $self->{'_opts'}{'_restore_auth_sock'};
     $self->{'persistent_shell'}->close()                         if $self->{'persistent_shell'};
 

+ 2 - 1
lib/Net/OpenSSH/More/Linux.pm

@@ -119,7 +119,8 @@ Effectively the same thing as `cp $SOURCE $DEST` on the remote server.
 
 =cut
 
-sub copy ( $self, $SOURCE, $DEST ) {
+sub copy {
+    my ( $self, $SOURCE, $DEST ) = @_;
     return $self->send("cp -a $SOURCE $DEST");
 }