mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-30 01:47:56 +00:00
src/parallel: transfer of relative files on systems without /./ capable rsync.
This commit is contained in:
parent
3615f0b473
commit
e14d8f9586
19
src/parallel
19
src/parallel
|
@ -3778,14 +3778,19 @@ sub sshreturn {
|
||||||
my @cmd = ();
|
my @cmd = ();
|
||||||
my $rsync_destdir = ($relpath ? "./" : "/");
|
my $rsync_destdir = ($relpath ? "./" : "/");
|
||||||
my $ret_file = $file;
|
my $ret_file = $file;
|
||||||
# If relative path: prepend workdir/./ to avoid problems
|
my $cd;
|
||||||
# if the dir contains ':' and to get the right relative return path
|
if($relpath) {
|
||||||
my $replaced = ($relpath ? $self->workdir()."/./" : "") . $file;
|
# rsync -avR /foo/./bar/baz.c remote:/tmp/
|
||||||
|
# == (on old systems)
|
||||||
|
# rsync -avR --rsync-path="cd /foo; rsync" remote:bar/baz.c /tmp/
|
||||||
|
my $wd = $self->workdir();
|
||||||
|
$cd = '--rsync-path='.::shell_quote_scalar("cd $wd; rsync");
|
||||||
|
}
|
||||||
# --return
|
# --return
|
||||||
# Abs path: rsync -rlDzR server:/home/tange/dir/subdir/file.gz /
|
# Abs path: rsync -rlDzR server:/home/tange/dir/subdir/file.gz /
|
||||||
# Rel path: rsync -rlDzR server:./subsir/file.gz ./
|
# Rel path: rsync -rlDzR server:./subdir/file.gz ./
|
||||||
$pre .= "rsync $rsync_opt $serverlogin:".
|
$pre .= "rsync $cd $rsync_opt $serverlogin:".
|
||||||
::shell_quote_scalar($replaced) . " ".$rsync_destdir.";";
|
::shell_quote_scalar($file) . " ".$rsync_destdir.";";
|
||||||
}
|
}
|
||||||
return $pre;
|
return $pre;
|
||||||
}
|
}
|
||||||
|
@ -3883,7 +3888,7 @@ sub workdir {
|
||||||
} else {
|
} else {
|
||||||
$workdir = ".";
|
$workdir = ".";
|
||||||
}
|
}
|
||||||
$self->{'workdir'} = $workdir;
|
$self->{'workdir'} = ::shell_quote_scalar($workdir);
|
||||||
}
|
}
|
||||||
return $self->{'workdir'};
|
return $self->{'workdir'};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue