/
parallel.patch
51 lines (49 loc) · 1.79 KB
/
parallel.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
@@ -2241,7 +2241,7 @@
## Shell
#
$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.");
wait_and_exit(255);
@@ -2917,14 +2917,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';
@@ -4972,7 +4972,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>;
@@ -8632,7 +8632,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($) {