src/parallel: Deal with unset $HOME.

This commit is contained in:
Ole Tange 2013-07-12 21:19:53 +02:00
parent 111fa14f57
commit 56e5118535
5 changed files with 28 additions and 3 deletions

View file

@ -12,7 +12,7 @@
#
# It first tries to install it globally.
# If that fails, it does a personal installation.
# If that fails, it does copies to $HOME/bin
# If that fails, it copies to $HOME/bin
LATEST=$(wget -qO- http://ftpmirror.gnu.org/parallel | perl -ne '/(parallel-\d{8})/ and print $1."\n"' | sort | tail -n1)
if test \! -d $LATEST/src/; then

View file

@ -195,9 +195,9 @@ cc:Sandro Cazzaniga <kharec@mandriva.org>,
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>,
Jesse Alama <jesse.alama@gmail.com>
Subject: GNU Parallel 20130722 ('') released
Subject: GNU Parallel 20130722 ('Engelbart') released
GNU Parallel 20130722 ('') has been released. It is
GNU Parallel 20130722 ('Engelbart') has been released. It is
available for download at: http://ftp.gnu.org/gnu/parallel/
Very few changes so this can be considered a stable release.

View file

@ -39,6 +39,12 @@ if(not $ENV{SHELL}) {
::warning("\$SHELL not set. Using /bin/sh.\n");
$ENV{SHELL} = "/bin/sh";
}
if(not $ENV{HOME}) {
# $ENV{HOME} is sometimes not set if called from PHP
::warning("\$HOME not set. Using /tmp\n");
$ENV{HOME} = "/tmp";
}
save_sig_stdin_stdout_stderr();
parse_options();

View file

@ -22,4 +22,9 @@ echo '### -l -n with pipe'
echo '### bug #39360: --joblog does not work with --pipe'
seq 100 | parallel --joblog - --pipe wc | tr '0-9' 'X'
echo '### How do we deal with missing $HOME'
unset HOME; stdout perl -w $(which parallel) echo ::: 1 2 3
echo '### How do we deal with missing $SHELL'
unset SHELL; stdout perl -w $(which parallel) echo ::: 1 2 3
EOF

View file

@ -93,3 +93,17 @@ echo '### bug #39360: --joblog does not work with --pipe'
Seq Host Starttime Runtime Send Receive Exitval Signal Command
X : XXXXXXXXXX.XXX X.XXX X X X X wc
XXX XXX XXX
echo '### How do we deal with missing $HOME'
### How do we deal with missing $HOME
unset HOME; stdout perl -w $(which parallel) echo ::: 1 2 3
parallel: Warning: $HOME not set. Using /tmp
1
2
3
echo '### How do we deal with missing $SHELL'
### How do we deal with missing $SHELL
unset SHELL; stdout perl -w $(which parallel) echo ::: 1 2 3
parallel: Warning: $SHELL not set. Using /bin/sh.
1
2
3