parallel: Fixed bug #37680: --wd ... not working

This commit is contained in:
Ole Tange 2012-11-26 21:19:14 +01:00
parent 6921d28f9a
commit 4688ba04c9
3 changed files with 11 additions and 1 deletions

View file

@ -613,7 +613,7 @@ sub get_options_from_array {
sub parse_options {
# Returns: N/A
# Defaults:
$Global::version = 20121124;
$Global::version = 20121126;
$Global::progname = 'parallel';
$Global::infinity = 2**31;
$Global::debug = 0;
@ -3711,6 +3711,10 @@ sub sshcleanup {
$cleancmd .= "$sshcmd $serverlogin rm -f "
. ::shell_quote_scalar($cleandir.$file.$removeworkdir).";";
}
if(defined $opt::workdir and $opt::workdir eq "...") {
$cleancmd .= "$sshcmd $serverlogin rm -rf " . ::shell_quote_scalar($workdir).";";
}
return $cleancmd;
}

View file

@ -41,5 +41,9 @@ stdout parallel -k --wd /tmp/ --basefile 1-col.txt --trc {}.5 -S .. -v echo ">"{
# A few rmdir errors are OK as we have multiple files in the same dirs
find . -name '*.5' | sort
echo '### Test --wd ... --cleanup'
stdout parallel -k --wd ... --cleanup -S lo -v echo ">"{}.6 ::: uNiQuE_sTrInG
find ~/.parallel/tmp |grep uNiQuE_sTrInG
cd ..
rm -rf tmp

View file

@ -66,3 +66,5 @@ echo >./a\ b/cd\ /\ ef/efg.5
./a b/cd / ef/efg.5
./b/bar.5
./b/foo.5
### Test --wd ... --cleanup
echo >uNiQuE_sTrInG.6