10seconds_install: Support $HOME with space.

This commit is contained in:
Ole Tange 2020-10-26 20:41:00 +01:00
parent 01c59822f0
commit 09d0ee1c73
14 changed files with 45 additions and 44 deletions

View file

@ -55,11 +55,11 @@ run() {
latest=$($get http://ftpmirror.gnu.org/parallel |
perl -ne '/.*(parallel-\d{8})/ and print $1."\n"' |
perl -e 'print ((reverse sort <>)[0])')
if test \! -e $latest.tar.bz2; then
if test \! -e "$latest".tar.bz2; then
# Source tar does not exist
rm -f $latest.tar.bz2 $latest.tar.bz2.sig
$get http://ftpmirror.gnu.org/parallel/$latest.tar.bz2 > $latest.tar.bz2
$get http://ftpmirror.gnu.org/parallel/$latest.tar.bz2.sig > $latest.tar.bz2.sig
rm -f "$latest".tar.bz2 "$latest".tar.bz2.sig
$get http://ftpmirror.gnu.org/parallel/"$latest".tar.bz2 > "$latest".tar.bz2
$get http://ftpmirror.gnu.org/parallel/"$latest".tar.bz2.sig > "$latest".tar.bz2.sig
fi
fetch_keys() {
@ -74,10 +74,10 @@ run() {
else
keyserver1=keys.gnupg.net
keyserver2=pool.sks-keyservers.net
if gpg --keyserver $keyserver1 --recv-key 0xFFFFFFF1 ||
gpg --keyserver $keyserver2 --recv-key 0xFFFFFFF1 ; then
if gpg --keyserver $keyserver1 --recv-key 0x88888888 ||
gpg --keyserver $keyserver2 --recv-key 0x88888888; then
if gpg --keyserver "$keyserver1" --recv-key 0xFFFFFFF1 ||
gpg --keyserver "$keyserver2" --recv-key 0xFFFFFFF1 ; then
if gpg --keyserver "$keyserver1" --recv-key 0x88888888 ||
gpg --keyserver "$keyserver2" --recv-key 0x88888888; then
# OK
return 0
else
@ -93,19 +93,19 @@ run() {
fi
else
# GnuPG not installed
echo
echo "GnuPG (gpg) is not installed so the signature cannot be checked."
echo
echo "GnuPG (gpg) is not installed so the signature cannot be checked."
return 1
fi
}
# Check signature - in case ftpmirror.gnu.org is compromised
if fetch_keys; then
if gpg --with-fingerprint $latest.tar.bz2.sig 2>&1 |
if gpg --with-fingerprint "$latest".tar.bz2.sig 2>&1 |
perl -e 'exit not grep /^Primary key fingerprint: BE9C B493 81DE 3166 A3BC 66C1 2C62 29E2 FFFF FFF1|^Primary key fingerprint: CDA0 1A42 08C4 F745 0610 7E7B D1AB 4516 8888 8888/, <>'; then
# Source code signed by Ole Tange <ole@tange.dk>
# KeyID FFFFFFF1/88888888
true
true
else
# GnuPG signature failed
echo
@ -114,57 +114,57 @@ run() {
echo
echo "See http://git.savannah.gnu.org/cgit/parallel.git/tree/README for other installation methods."
exit 1
fi
fi
else
# GnuPG not installed or public keys not downloaded
echo "This means that if the code has been changed by criminals, you will not discover that!"
echo
echo "Continue anyway? (y/n)"
read YN </dev/tty
read YN </dev/tty
if test "$YN" = "n"; then
# Stop
exit 2
else
# Continue
true
fi
fi
fi
bzip2 -dc $latest.tar.bz2 | tar xf -
cd $latest || exit 2
bzip2 -dc "$latest".tar.bz2 | tar xf -
cd "$latest" || exit 2
if ./configure && make && make install; then
echo
echo GNU $latest installed globally
echo "GNU $latest installed globally"
else
if ./configure --prefix=$HOME && make && make install; then
if ./configure --prefix="$HOME" && make && make install; then
echo
echo GNU $latest installed in $HOME/bin
echo "GNU $latest installed in $HOME/bin"
else
mkdir -p $HOME/bin/;
chmod 755 src/*;
cp src/parallel src/env_parallel* src/sem src/sql src/niceload src/parcat $HOME/bin;
mkdir -p "$HOME"/bin/;
chmod 755 src/*;
cp src/parallel src/env_parallel* src/sem src/sql src/niceload src/parcat "$HOME"/bin;
echo
echo GNU $latest copied to $HOME/bin
echo "GNU $latest copied to $HOME/bin"
fi
# Is $HOME/bin already in $PATH?
if echo $PATH | grep $HOME/bin >/dev/null; then
if echo "$PATH" | grep "$HOME"/bin >/dev/null; then
# $HOME/bin is already in $PATH
true
else
# Add $HOME/bin to $PATH for both bash and csh
echo 'PATH=$PATH:$HOME/bin' >> $HOME/.bashrc
echo 'setenv PATH ${PATH}:${HOME}/bin' >> $HOME/.cshrc
fi
echo 'PATH=$PATH:$HOME/bin' >> "$HOME"/.bashrc
echo 'setenv PATH ${PATH}:${HOME}/bin' >> "$HOME"/.cshrc
fi
# Is $HOME/share/man already in $MANPATH?
if echo $MANPATH | grep $HOME/share/man >/dev/null; then
if echo "$MANPATH" | grep "$HOME"/share/man >/dev/null; then
# $HOME/share/man is already in $MANPATH
true
else
# Add $HOME/share/man to $MANPATH for both bash and csh
echo 'MANPATH=$MANPATH:$HOME/share/man' >> $HOME/.bashrc
echo 'setenv MANPATH ${MANPATH}:${HOME}/share/man' >> $HOME/.cshrc
echo 'export MANPATH=$MANPATH:$HOME/share/man' >> "$HOME"/.bashrc
echo 'setenv MANPATH ${MANPATH}:${HOME}/share/man' >> "$HOME"/.cshrc
fi
fi
}

View file

@ -25,7 +25,7 @@ https://zenodo.org/deposit/new
(*) Software
(Reserve DOI)
GNU Parallel 20xxxx22 ('Xxxx')
Ole Tange
Tange, Ole
https://orcid.org/0000-0002-6345-1437
Description
GNU Parallel is a general parallelizer to run multiple serial command line programs in parallel without changing them.
@ -134,6 +134,7 @@ export YYYYMMDD=${YYYYMMDD:0:6}23
echo $YYYYMMDD
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/parallel
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/sql
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/env_parallel*
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/parsort
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/niceload

View file

@ -382,7 +382,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -384,7 +384,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -382,7 +382,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -365,7 +365,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -368,7 +368,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -382,7 +382,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -83,7 +83,7 @@ else
# Make a tmpfile for the variable definitions + alias
set _tMpaLLfILe=`_tempfile`
foreach _vARnAmE ($_vARnAmES);
# These 3 lines break in csh version 20201022-3
# These 3 lines break in csh version 20201023-3
# if not defined: next
eval if'(! $?'$_vARnAmE') continue'
# if $#myvar <= 1 echo scalar_myvar=$var

View file

@ -359,7 +359,7 @@ _parset_main() {
return 255
fi
if [ "$_parset_NAME" = "--version" ] ; then
echo "parset 20201022 (GNU parallel `parallel --minversion 1`)"
echo "parset 20201023 (GNU parallel `parallel --minversion 1`)"
echo "Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software"
echo "Foundation, Inc."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"

View file

@ -23,7 +23,7 @@
use strict;
use Getopt::Long;
$Global::progname="niceload";
$Global::version = 20201022;
$Global::version = 20201023;
Getopt::Long::Configure("bundling","require_order");
get_options_from_array(\@ARGV) || die_usage();
if($opt::version) {

View file

@ -2164,7 +2164,7 @@ sub check_invalid_option_combinations() {
sub init_globals() {
# Defaults:
$Global::version = 20201022;
$Global::version = 20201023;
$Global::progname = 'parallel';
$::name = "GNU Parallel";
$Global::infinity = 2**31;

View file

@ -118,7 +118,7 @@ GetOptions(
"help" => \$opt::dummy,
) || exit(255);
$Global::progname = ($0 =~ m:(^|/)([^/]+)$:)[1];
$Global::version = 20201022;
$Global::version = 20201023;
if($opt::version) { version(); exit 0; }
@Global::sortoptions = @ARGV_before[0..($#ARGV_before-$#ARGV-1)];
#if($opt::zero_terminated) { $/ = "\0"; }

View file

@ -574,7 +574,7 @@ $Global::Initfile && unlink $Global::Initfile;
exit ($err);
sub parse_options {
$Global::version = 20201022;
$Global::version = 20201023;
$Global::progname = 'sql';
# This must be done first as this may exec myself