termux-packages/packages/coreutils/fix-paths.patch

97 lines
3.5 KiB
Diff

diff -uNr coreutils-8.32/lib/getusershell.c coreutils-8.32.mod/lib/getusershell.c
--- coreutils-8.32/lib/getusershell.c 2020-01-01 16:14:23.000000000 +0200
+++ coreutils-8.32.mod/lib/getusershell.c 2020-05-05 14:13:10.980279936 +0300
@@ -56,7 +56,7 @@
static char const* const default_shells[] =
{
ADDITIONAL_DEFAULT_SHELLS
- "/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
+ "@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/bash", "@TERMUX_PREFIX@/bin/ash", "@TERMUX_PREFIX@/bin/csh", NULL
};
/* Index of the next shell in 'default_shells' to return.
diff -uNr coreutils-8.32/lib/tempname.c coreutils-8.32.mod/lib/tempname.c
--- coreutils-8.32/lib/tempname.c 2020-01-01 16:19:26.000000000 +0200
+++ coreutils-8.32.mod/lib/tempname.c 2020-05-05 14:13:10.984279966 +0300
@@ -33,7 +33,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -149,8 +149,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr coreutils-8.32/src/mktemp.c coreutils-8.32.mod/src/mktemp.c
--- coreutils-8.32/src/mktemp.c 2020-01-01 16:13:12.000000000 +0200
+++ coreutils-8.32.mod/src/mktemp.c 2020-05-05 14:13:10.984279966 +0300
@@ -270,7 +270,7 @@
else if (dest_dir_arg && *dest_dir_arg)
dest_dir = dest_dir_arg;
else
- dest_dir = "/tmp";
+ dest_dir = "@TERMUX_PREFIX@/tmp";
if (last_component (template) != template)
die (EXIT_FAILURE, 0,
@@ -284,7 +284,7 @@
else
{
char *env = getenv ("TMPDIR");
- dest_dir = (env && *env ? env : "/tmp");
+ dest_dir = (env && *env ? env : "@TERMUX_PREFIX@/tmp");
}
if (IS_ABSOLUTE_FILE_NAME (template))
die (EXIT_FAILURE, 0,
diff -uNr coreutils-8.32/src/sort.c coreutils-8.32.mod/src/sort.c
--- coreutils-8.32/src/sort.c 2020-01-01 16:33:34.000000000 +0200
+++ coreutils-8.32.mod/src/sort.c 2020-05-05 14:14:09.200728018 +0300
@@ -92,9 +92,7 @@
#define UCHAR_LIM (UCHAR_MAX + 1)
-#ifndef DEFAULT_TMPDIR
-# define DEFAULT_TMPDIR "/tmp"
-#endif
+#define DEFAULT_TMPDIR "@TERMUX_PREFIX@/tmp"
/* Maximum number of lines to merge every time a NODE is taken from
the merge queue. Node is at LEVEL in the binary merge tree,
diff -uNr coreutils-8.32/src/split.c coreutils-8.32.mod/src/split.c
--- coreutils-8.32/src/split.c 2020-01-01 16:13:12.000000000 +0200
+++ coreutils-8.32.mod/src/split.c 2020-05-05 14:13:10.984279966 +0300
@@ -482,7 +482,7 @@
pid_t child_pid;
char const *shell_prog = getenv ("SHELL");
if (shell_prog == NULL)
- shell_prog = "/bin/sh";
+ shell_prog = "@TERMUX_PREFIX@/bin/sh";
if (setenv ("FILE", name, 1) != 0)
die (EXIT_FAILURE, errno,
_("failed to set FILE environment variable"));
diff -uNr coreutils-8.32/src/tac.c coreutils-8.32.mod/src/tac.c
--- coreutils-8.32/src/tac.c 2020-01-01 16:13:12.000000000 +0200
+++ coreutils-8.32.mod/src/tac.c 2020-05-05 14:14:18.384798638 +0300
@@ -66,9 +66,7 @@
#endif
-#ifndef DEFAULT_TMPDIR
-# define DEFAULT_TMPDIR "/tmp"
-#endif
+#define DEFAULT_TMPDIR "@TERMUX_PREFIX@/tmp"
/* The number of bytes per atomic read. */
#define INITIAL_READSIZE 8192