0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-12 14:13:36 +00:00
2024-10-04 19:15:38 +08:00

57 lines
2.0 KiB
Diff

diff -uNr parallel/src/parallel parallel.mod/src/parallel
--- parallel/src/parallel 2023-09-28 21:55:48.803300511 +0800
+++ parallel.mod/src/parallel 2023-09-28 21:58:17.203300520 +0800
@@ -2335,10 +2335,10 @@
## Shell
#
if($opt::fast) {
- $Global::shell = $ENV{'PARALLEL_SHELL'} || which("dash") || "/bin/sh";
+ $Global::shell = $ENV{'PARALLEL_SHELL'} || which("dash") || "@TERMUX_PREFIX@/bin/sh";
} else {
$Global::shell = $ENV{'PARALLEL_SHELL'} || parent_shell($$)
- || $ENV{'SHELL'} || "/bin/sh";
+ || $ENV{'SHELL'} || "@TERMUX_PREFIX@/bin/sh";
}
if(not -x $Global::shell and not which($Global::shell)) {
::error("Shell '$Global::shell' not found.");
@@ -3009,14 +3009,14 @@
$Global::trim = 'n';
$Global::max_jobs_running = 0;
$Global::job_already_run = '';
- $ENV{'TMPDIR'} ||= "/tmp";
- $ENV{'PARALLEL_REMOTE_TMPDIR'} ||= "/tmp";
+ $ENV{'TMPDIR'} ||= "@TERMUX_PREFIX@/tmp";
+ $ENV{'PARALLEL_REMOTE_TMPDIR'} ||= "@TERMUX_PREFIX@/tmp";
# bug #55398: set $OLDPWD when using --wd
$ENV{'OLDPWD'} = $ENV{'PWD'};
if(not $ENV{HOME}) {
# $ENV{HOME} is sometimes not set if called from PHP
- ::warning("\$HOME not set. Using /tmp.");
- $ENV{HOME} = "/tmp";
+ ::warning("\$HOME not set. Using @TERMUX_PREFIX@/tmp.");
+ $ENV{HOME} = "@TERMUX_PREFIX@/tmp";
}
# no warnings to allow for undefined $XDG_*
no warnings 'uninitialized';
@@ -5152,7 +5152,7 @@
unlink $stderrname;
my $pid = ::open3($stdin_fh,$stdout_fh,$stderr_fh,
- $0,qw(--plain --shell /bin/sh --will-cite), @args);
+ $0,qw(--plain --shell @TERMUX_PREFIX@/bin/sh --will-cite), @args);
if(my $writerpid = fork()) {
close $stdin_fh;
@stdout = <$stdout_fh>;
@@ -8949,7 +8949,9 @@
# 'threads' => #threads
# 'active' => #taskset_threads }
# Use GNU/Linux
- return sct_gnu_linux($_[0]);
+ #return sct_gnu_linux($_[0]);
+ # Use Hurd which uses nproc
+ return sct_hurd($_[0]);
}
sub sct_freebsd($) {