From 2ba2c706ff60012a2d50d5172189e5808781ed89 Mon Sep 17 00:00:00 2001 From: Niklas Holm Date: Fri, 25 May 2018 15:56:47 +0200 Subject: [PATCH] parallel: Update to 20180522 --- parallel/0001-support-MSys2.patch | 204 ++++++++++-------------------- parallel/PKGBUILD | 8 +- 2 files changed, 70 insertions(+), 142 deletions(-) diff --git a/parallel/0001-support-MSys2.patch b/parallel/0001-support-MSys2.patch index 690371c5..3150c494 100644 --- a/parallel/0001-support-MSys2.patch +++ b/parallel/0001-support-MSys2.patch @@ -1,54 +1,7 @@ -From c485e838936e6162dca3c4fabdf32f8979e436a8 Mon Sep 17 00:00:00 2001 -From: Rafael Kitover -Date: Sun, 24 Dec 2017 14:16:41 -0500 -Subject: [PATCH] support MSys2 - -- on MSys2 MSYS or MINGW shells, prepend `/usr/bin` to `PATH` during - configure so that the MSys perl is used rather than the native Windows - perl, making the scripts work with native Windows perl would be a lot - of work - -- use the `AX_SYS_PERLSHARPBANG` m4 macro from autoconf-archive to - determine which perl to use for the Perl scripts based on the PATH, - and modify the the shebang of the scripts accordingly in the automake - `install-exec-hook`, this is overridable using the `configure` option - `--with-perl-shebang`. - -- add an `autogen.sh` script to run `aclocal`, `autoconf` and `automake` - as is common to do - -- when executing `perl` from the shell from inside perl scripts, use - `$^X` instead of `perl` so that the interpreter the script was run - with is used instead of the `perl` that is in the `PATH` - -- use the Cygwin `ps` and process status methods for MSys2 - -- don't `exec 'sleep'` on MSys2, it has the same problem with this as - Cygwin - -The reason I did this was so that I could use my wallpaper downloader -in MSys2: - -https://github.com/macearl/Wallhaven-Downloader - -:D ---- - Makefile.in | 15 ++--- - aclocal.m4 | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++------ - autogen.sh | 5 ++ - configure | 154 ++++++++++++++++++++++++++++++++++++++++++++----- - configure.ac | 12 ++++ - src/Makefile.am | 10 +++- - src/Makefile.in | 16 ++++-- - src/niceload | 9 +-- - src/parallel | 63 ++++++++++----------- - 9 files changed, 376 insertions(+), 81 deletions(-) - create mode 100644 autogen.sh - -diff --git a/Makefile.in b/Makefile.in +diff --git old/Makefile.in 001/Makefile.in index 33af24d..d39833b 100644 ---- a/Makefile.in -+++ b/Makefile.in +--- old/Makefile.in ++++ 001/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. @@ -112,10 +65,10 @@ index 33af24d..d39833b 100644 *.zip*) \ unzip $(distdir).zip ;;\ esac -diff --git a/aclocal.m4 b/aclocal.m4 +diff --git old/aclocal.m4 001/aclocal.m4 index c24039f..2fa8b41 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 +--- old/aclocal.m4 ++++ 001/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- @@ -398,21 +351,21 @@ index c24039f..2fa8b41 100644 # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, -diff --git a/autogen.sh b/autogen.sh +diff --git old/autogen.sh 001/autogen.sh new file mode 100644 index 0000000..dee27fb --- /dev/null -+++ b/autogen.sh ++++ 001/autogen.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +aclocal --force +autoconf --force +automake --foreign --add-missing --copy -diff --git a/configure b/configure -index 03d899d..3b455c2 100755 ---- a/configure -+++ b/configure +diff --git old/configure 001/configure +index 0c763df..00b5eb4 100644 +--- old/configure ++++ 001/configure @@ -616,6 +616,8 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT @@ -556,7 +509,7 @@ index 03d899d..3b455c2 100755 +if test "${with_perl_shebang+set}" = set; then : + withval=$with_perl_shebang; opt_perl_shebang="$withval" +else -+ opt_perl_shebang="not_set" ++ opt_perl_shebang="not_set" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether explicit instead of detected sharpbang is to be used" >&5 @@ -630,12 +583,12 @@ index 03d899d..3b455c2 100755 am__api_version='1.15' ac_aux_dir= -diff --git a/configure.ac b/configure.ac -index d3583d8..0918de7 100644 ---- a/configure.ac -+++ b/configure.ac +diff --git old/configure.ac 001/configure.ac +index cb5a1b0..33e3fda 100644 +--- old/configure.ac ++++ 001/configure.ac @@ -1,4 +1,16 @@ - AC_INIT([parallel], [20171222], [bug-parallel@gnu.org]) + AC_INIT([parallel], [20180522], [bug-parallel@gnu.org]) + +# on MSys2 prefer msys to native programs, especially perl +# native windows perl does not work for the time being @@ -651,19 +604,19 @@ index d3583d8..0918de7 100644 AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ -diff --git a/src/Makefile.am b/src/Makefile.am -index ea12e76..1412a84 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am +diff --git old/src/Makefile.am 001/src/Makefile.am +index 9b5f7e4..17a5c64 100644 +--- old/src/Makefile.am ++++ 001/src/Makefile.am @@ -1,4 +1,6 @@ --bin_SCRIPTS = parallel sql niceload parcat env_parallel \ -+PERL_BINS = parallel sql niceload parcat +-bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \ ++PERL_BINS = parallel sql niceload parcat parset + +bin_SCRIPTS = $(PERL_BINS) env_parallel \ env_parallel.ash env_parallel.bash env_parallel.csh \ env_parallel.dash env_parallel.fish env_parallel.ksh \ env_parallel.pdksh env_parallel.sh env_parallel.tcsh \ -@@ -7,6 +9,12 @@ bin_SCRIPTS = parallel sql niceload parcat env_parallel \ +@@ -7,6 +9,12 @@ bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \ install-exec-hook: rm $(DESTDIR)$(bindir)/sem || true $(LN_S) parallel $(DESTDIR)$(bindir)/sem @@ -676,10 +629,10 @@ index ea12e76..1412a84 100644 if DOCUMENTATION man_MANS = parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 \ -diff --git a/src/Makefile.in b/src/Makefile.in -index 0a97ec2..936e327 100644 ---- a/src/Makefile.in -+++ b/src/Makefile.in +diff --git old/src/Makefile.in 001/src/Makefile.in +index ce1c2b8..0716192 100644 +--- old/src/Makefile.in ++++ 001/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. @@ -711,8 +664,8 @@ index 0a97ec2..936e327 100644 top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ --bin_SCRIPTS = parallel sql niceload parcat env_parallel \ -+PERL_BINS = parallel sql niceload parcat +-bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \ ++PERL_BINS = parallel sql niceload parcat parset +bin_SCRIPTS = $(PERL_BINS) env_parallel \ env_parallel.ash env_parallel.bash env_parallel.csh \ env_parallel.dash env_parallel.fish env_parallel.ksh \ @@ -730,11 +683,11 @@ index 0a97ec2..936e327 100644 # Build documentation file if the tool to build exists. # Otherwise: Use the distributed version -diff --git a/src/niceload b/src/niceload -index d0b479f..3a9aa42 100755 ---- a/src/niceload -+++ b/src/niceload -@@ -146,11 +146,8 @@ exit($::exitstatus); +diff --git old/src/niceload 001/src/niceload +index f628030..485e9b2 100644 +--- old/src/niceload ++++ 001/src/niceload +@@ -148,11 +148,8 @@ exit($::exitstatus); if(not %pid_parentpid_cmd) { # Filter for SysV-style `ps` @@ -747,7 +700,7 @@ index d0b479f..3a9aa42 100755 # BSD-style `ps` my $bsd = q(ps -o pid,ppid,command -ax); %pid_parentpid_cmd = -@@ -165,7 +162,7 @@ exit($::exitstatus); +@@ -167,7 +164,7 @@ exit($::exitstatus); 'hpux' => $sysv, 'linux' => $sysv, 'mirbsd' => $bsd, @@ -756,7 +709,7 @@ index d0b479f..3a9aa42 100755 'MSWin32' => $sysv, 'netbsd' => $bsd, 'nto' => $sysv, -@@ -589,7 +586,7 @@ sub netsensor_script { +@@ -591,7 +588,7 @@ sub netsensor_script { $self->{'remedian'} = (sort @{$rref->[2]})[$#{$rref->[2]}/2]; } }; @@ -765,20 +718,20 @@ index d0b479f..3a9aa42 100755 } -diff --git a/src/parallel b/src/parallel -index 1e45108..ead451d 100755 ---- a/src/parallel -+++ b/src/parallel -@@ -418,7 +418,7 @@ sub cat_partial { +diff --git old/src/parallel 001/src/parallel +index 98062d6..563e698 100644 +--- old/src/parallel ++++ 001/src/parallel +@@ -442,7 +442,7 @@ sub cat_partial { } }); return "<". shell_quote_scalar($file) . -- " perl -e '$script' @start_len"; -+ " $^X -e '$script' @start_len"; +- " perl -e '$script' @start_len |"; ++ " $^X -e '$script' @start_len |"; } sub spreadstdin { -@@ -4608,11 +4608,8 @@ sub which { +@@ -4868,11 +4868,8 @@ sub which { if(not %pid_parentpid_cmd) { # Filter for SysV-style `ps` @@ -791,7 +744,7 @@ index 1e45108..ead451d 100755 # BSD-style `ps` my $bsd = q(ps -o pid,ppid,command -ax); %pid_parentpid_cmd = -@@ -4628,7 +4625,7 @@ sub which { +@@ -4888,7 +4885,7 @@ sub which { 'hpux' => $sysv, 'linux' => $sysv, 'mirbsd' => $bsd, @@ -800,7 +753,7 @@ index 1e45108..ead451d 100755 'MSWin32' => $sysv, 'netbsd' => $bsd, 'nto' => $sysv, -@@ -5135,7 +5132,7 @@ sub memfree_recompute { +@@ -5395,7 +5392,7 @@ sub memfree_recompute { $perlscript .= 'if($^O eq "'.$os.'") { '.$script_of{$os}.'}'; } $perlscript =~ s/[\t\n ]+/ /g; @@ -809,7 +762,7 @@ index 1e45108..ead451d 100755 } return $script; } -@@ -5158,7 +5155,7 @@ sub limit { +@@ -5418,7 +5415,7 @@ sub limit { (tmp=$(tempfile); LANG=C iostat -x 1 2 > $tmp; mv $tmp $io_file) & @@ -818,16 +771,16 @@ index 1e45108..ead451d 100755 for(reverse <>) { /Device:/ and last; /(\S+)$/ and $max = $max > $1 ? $max : $1; } -@@ -5185,7 +5182,7 @@ sub limit { +@@ -5445,7 +5442,7 @@ sub limit { ps ax -o state,command | grep -E '^[DOR].[^[]' | wc -l | - perl -ne 'exit ('$limit' < $_)'; -+ !.$^X.q! -ne 'exit ('$limit' < $_)'; ++ !.$^X.q! -ne 'exit ('$limit' < $_)'; }; export -f load; load %s; -@@ -5391,7 +5388,7 @@ sub swap_activity { +@@ -5651,7 +5648,7 @@ sub swap_activity { $perlscript .= 'if($^O eq "'.$os.'") { print `'.$vmstat{$os}[0].' | awk "{print ' . $vmstat{$os}[1] . '}"` }'; } @@ -836,7 +789,7 @@ index 1e45108..ead451d 100755 } return $script; } -@@ -5438,7 +5435,7 @@ sub loadavg_too_high { +@@ -5698,7 +5695,7 @@ sub loadavg_too_high { # aix => "ps -ae -o state,command" # state wrong # bsd => "ps ax -o state,command" # sysv => "ps -ef -o s -o comm" @@ -845,7 +798,7 @@ index 1e45108..ead451d 100755 # /(Name|Pid|Ppid|State):\s+(\S+)/ and print "$2\t";' /proc/*/status | # awk '{print $2,$1}' # dec_osf => bsd -@@ -5456,14 +5453,14 @@ sub loadavg_too_high { +@@ -5716,14 +5713,14 @@ sub loadavg_too_high { # svr5 => sysv # ultrix => ps -ax | awk '{print $3,$5}' # unixware => ps -el|awk '{print $2,$14,$15}' @@ -862,16 +815,7 @@ index 1e45108..ead451d 100755 /(Name|Pid|Ppid|State):\s+(\S+)/ and print "$2\t";' /proc/*/status | awk '{print $2,$1}' }; $dummy="echo S COMMAND;echo R dummy"; -@@ -5481,7 +5478,7 @@ sub loadavg_too_high { - 'linux' => $bsd2, - 'minix' => "ps el|awk '{print \$1,\$11}'", - 'mirbsd' => $bsd, -- 'msys' => $sysv, -+ 'msys' => $cygwin, - 'MSWin32' => $sysv, - 'netbsd' => $bsd, - 'nto' => $dummy, -@@ -5491,7 +5488,7 @@ sub loadavg_too_high { +@@ -5751,7 +5748,7 @@ sub loadavg_too_high { 'ultrix' => "ps -ax | awk '{print \$3,\$5}'", ); print `$ps{$^O}`; @@ -880,18 +824,7 @@ index 1e45108..ead451d 100755 # The command is too long for csh, so base64_wrap the command $cmd = Job::base64_wrap($ps); } -@@ -5708,8 +5705,8 @@ sub compute_number_of_processes { - # The child takes one process slot - # It will be killed later - $SIG{'TERM'} = $Global::original_sig{'TERM'}; -- if($^O eq "cygwin") { -- # The exec does not work on Cygwin -+ if($^O =~ /^(?:cygwin|msys)/) { -+ # The exec does not work on Cygwin/MSys2 - sleep 10101010; - } else { - # 'exec sleep' takes less RAM than sleeping in perl -@@ -6407,7 +6404,7 @@ sub no_of_cores_hpux { +@@ -6668,7 +6665,7 @@ sub no_of_cores_hpux { # Number of CPU cores on HP-UX # undef if not HP-UX my $no_of_cores = @@ -900,7 +833,7 @@ index 1e45108..ead451d 100755 return $no_of_cores; } -@@ -7103,19 +7100,19 @@ sub empty_input_wrapper { +@@ -7383,19 +7380,19 @@ sub empty_input_wrapper { exit ($?&127 ? 128+($?&127) : 1+$?>>8) } }); @@ -924,7 +857,7 @@ index 1e45108..ead451d 100755 $Global::shell." -c ".::shell_quote_scalar($command); } } -@@ -7408,7 +7405,7 @@ sub total_failed { +@@ -7688,7 +7685,7 @@ sub total_failed { # Command to remove files and dirs (given as args) without # affecting the exit value in $?/$status. if(not $script) { @@ -933,7 +866,7 @@ index 1e45108..ead451d 100755 ::spacefree(0,q{ $bash=shift; $csh=shift; -@@ -7442,7 +7439,7 @@ sub total_failed { +@@ -7722,7 +7719,7 @@ sub total_failed { # * cat > fifo # * waitpid to get the exit code from $command # * be less than 1000 chars long @@ -942,7 +875,7 @@ index 1e45108..ead451d 100755 (::spacefree (0, q{ ($s,$c,$f) = @ARGV; -@@ -7557,7 +7554,7 @@ sub wrapped { +@@ -7837,7 +7834,7 @@ sub wrapped { $command = $self->sshlogin_wrap($command); if(@Global::cat_prepends) { # --pipepart: prepend: @@ -951,7 +884,7 @@ index 1e45108..ead451d 100755 # sysseek(STDIN,shift,0) || die; $left = shift; # while($read = sysread(STDIN,$buf, ($left > 131072 ? 131072 : $left))){ # $left -= $read; syswrite(STDOUT,$buf); -@@ -7582,7 +7579,7 @@ sub wrapped { +@@ -7863,7 +7860,7 @@ sub wrapped { and length $command > 499) { # csh does not like words longer than 1000 (499 quoted) @@ -960,7 +893,7 @@ index 1e45108..ead451d 100755 # join" ",string_zip_base64( # 'exec "'.::perl_quote_scalar($command).'"'); $command = base64_wrap("exec \"$Global::shell\",'-c',\"". -@@ -7704,7 +7701,7 @@ sub base64_wrap { +@@ -7985,7 +7982,7 @@ sub base64_wrap { # $shell_command = shell command that runs $eval_string my $eval_string = shift; return @@ -969,7 +902,7 @@ index 1e45108..ead451d 100755 ::shell_quote_scalar(base64_zip_eval())." ". join" ",::shell_quote(string_zip_base64($eval_string)); } -@@ -7905,7 +7902,7 @@ sub sshlogin_wrap { +@@ -8186,7 +8183,7 @@ sub sshlogin_wrap { # csh does not deal well with $ENV with \n $self->{'sshlogin_wrap'} = base64_wrap($perl_code); } else { @@ -978,7 +911,7 @@ index 1e45108..ead451d 100755 } } else { $self->{'sshlogin_wrap'} = $command; -@@ -7922,7 +7919,7 @@ sub sshlogin_wrap { +@@ -8203,7 +8200,7 @@ sub sshlogin_wrap { my $remote_command = $pwd.$envset.$bashfuncset. '@ARGV="'.::perl_quote_scalar($command).'";'. monitor_parent_sshd_script(); @@ -987,7 +920,7 @@ index 1e45108..ead451d 100755 ::shell_quote_scalar($remote_command); my $dq_remote_command = ::shell_quote_scalar($quoted_remote_command); -@@ -7934,7 +7931,7 @@ sub sshlogin_wrap { +@@ -8215,7 +8212,7 @@ sub sshlogin_wrap { # csh does not deal well with > 1000 chars in one word # csh does not deal well with $ENV with \n $quoted_remote_command = @@ -996,7 +929,7 @@ index 1e45108..ead451d 100755 ::shell_quote_scalar(::shell_quote_scalar(base64_zip_eval()))." ". join" ",::shell_quote(::shell_quote(string_zip_base64($remote_command))); } else { -@@ -8261,7 +8258,7 @@ sub start { +@@ -8543,7 +8540,7 @@ sub start { my $bash = ::shell_quote_scalar_default( "testfun() { rm $name; }; export -f testfun; ". @@ -1005,7 +938,7 @@ index 1e45108..ead451d 100755 ::shell_quote_scalar_default($script) ); # Redirect STDERR temporarily, -@@ -8493,14 +8490,14 @@ sub print_dryrun_and_verbose { +@@ -8755,14 +8752,14 @@ sub interactive_start { ( "(".$actual_command.');'. # The triple print is needed - otherwise the testsuite fails @@ -1022,6 +955,3 @@ index 1e45108..ead451d 100755 } } --- -2.15.1.433.g936d1b989.dirty - diff --git a/parallel/PKGBUILD b/parallel/PKGBUILD index 6ac2a64a..ea25fddc 100644 --- a/parallel/PKGBUILD +++ b/parallel/PKGBUILD @@ -2,7 +2,7 @@ # Maintainer: David Mott pkgname=parallel -pkgver=20171222 +pkgver=20180522 pkgrel=1 pkgdesc='A shell tool for executing jobs in parallel' arch=('any') @@ -13,10 +13,8 @@ source=( https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2 0001-support-MSys2.patch ) -sha1sums=( - 'e8632264794c3408cf58502bdc187205638de7a2' - 'd341977c3565e0cc8bc9c703ae1adfd874219aa7' -) +sha1sums=('e148aebb83dd5d2fa462cb04f7274a45ff93eb92' + '19a51783dd9c2f50e6aee167a6c70ca05bad99e8') build() { cd "$pkgname-$pkgver"