bash: more patches for path fixing

This commit is contained in:
Leonid Pliushch 2019-02-20 14:30:48 +02:00 committed by Fredrik Fornwall
parent 5c9deb6879
commit 7d5e36354d
11 changed files with 121 additions and 6 deletions

View File

@ -1,5 +1,6 @@
--- a/config-top.h
+++ b/config-top.h
diff -uNr bash-5.0/config-top.h bash-5.0.mod/config-top.h
--- bash-5.0/config-top.h 2018-10-12 22:35:23.000000000 +0300
+++ bash-5.0.mod/config-top.h 2019-02-20 14:15:53.266802311 +0200
@@ -63,7 +63,7 @@
/* The default value of the PATH variable. */
#ifndef DEFAULT_PATH_VALUE

View File

@ -0,0 +1,12 @@
diff -uNr bash-5.0/error.c bash-5.0.mod/error.c
--- bash-5.0/error.c 2018-10-08 22:16:07.000000000 +0300
+++ bash-5.0.mod/error.c 2019-02-20 14:19:39.265261705 +0200
@@ -430,7 +430,7 @@
static FILE *tracefp = (FILE *)NULL;
if (tracefp == NULL)
- tracefp = fopen("/tmp/bash-trace.log", "a+");
+ tracefp = fopen("@TERMUX_PREFIX@/tmp/bash-trace.log", "a+");
if (tracefp == NULL)
tracefp = stderr;

View File

@ -0,0 +1,12 @@
diff -uNr bash-5.0/lib/malloc/stats.c bash-5.0.mod/lib/malloc/stats.c
--- bash-5.0/lib/malloc/stats.c 2018-06-19 22:24:52.000000000 +0300
+++ bash-5.0.mod/lib/malloc/stats.c 2019-02-20 14:17:52.094412438 +0200
@@ -142,7 +142,7 @@
_print_malloc_stats (s, fp);
}
-#define TRACEROOT "/var/tmp/maltrace/stats."
+#define TRACEROOT "@TERMUX_PREFIX@/var/tmp/maltrace/stats."
void
trace_malloc_stats (s, fn)

View File

@ -0,0 +1,12 @@
diff -uNr bash-5.0/lib/malloc/table.c bash-5.0.mod/lib/malloc/table.c
--- bash-5.0/lib/malloc/table.c 2016-01-15 15:47:26.000000000 +0200
+++ bash-5.0.mod/lib/malloc/table.c 2019-02-20 14:18:05.854521552 +0200
@@ -390,7 +390,7 @@
_location_dump_table (stderr);
}
-#define LOCROOT "/var/tmp/maltrace/locations."
+#define LOCROOT "@TERMUX_PREFIX@/var/tmp/maltrace/locations."
void
mlocation_write_table ()

View File

@ -0,0 +1,12 @@
diff -uNr bash-5.0/lib/malloc/trace.c bash-5.0.mod/lib/malloc/trace.c
--- bash-5.0/lib/malloc/trace.c 2016-01-15 15:48:23.000000000 +0200
+++ bash-5.0.mod/lib/malloc/trace.c 2019-02-20 14:17:59.184468664 +0200
@@ -108,7 +108,7 @@
#endif
}
-#define TRACEROOT "/var/tmp/maltrace/trace."
+#define TRACEROOT "@TERMUX_PREFIX@/var/tmp/maltrace/trace."
void
malloc_set_tracefn (s, fn)

View File

@ -1,5 +1,6 @@
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
diff -uNr bash-5.0/lib/readline/complete.c bash-5.0.mod/lib/readline/complete.c
--- bash-5.0/lib/readline/complete.c 2017-07-05 02:43:20.000000000 +0300
+++ bash-5.0.mod/lib/readline/complete.c 2019-02-20 14:15:49.683440481 +0200
@@ -2231,7 +2231,7 @@
char *
rl_username_completion_function (const char *text, int state)

View File

@ -0,0 +1,12 @@
diff -uNr bash-5.0/lib/readline/rlconf.h bash-5.0.mod/lib/readline/rlconf.h
--- bash-5.0/lib/readline/rlconf.h 2017-02-21 17:25:30.000000000 +0200
+++ bash-5.0.mod/lib/readline/rlconf.h 2019-02-20 14:16:17.230326111 +0200
@@ -43,7 +43,7 @@
#define DEFAULT_INPUTRC "~/.inputrc"
/* The ultimate last-ditch filename for an init file -- system-wide. */
-#define SYS_INPUTRC "/etc/inputrc"
+#define SYS_INPUTRC "@TERMUX_PREFIX@/etc/inputrc"
/* If defined, expand tabs to spaces. */
#define DISPLAY_TABS

View File

@ -0,0 +1,12 @@
diff -uNr bash-5.0/lib/readline/util.c bash-5.0.mod/lib/readline/util.c
--- bash-5.0/lib/readline/util.c 2017-06-15 23:27:17.000000000 +0300
+++ bash-5.0.mod/lib/readline/util.c 2019-02-20 14:18:24.271334221 +0200
@@ -506,7 +506,7 @@
if (x == 0)
x = ".";
#else
- x = "/var/tmp";
+ x = "@TERMUX_PREFIX@/var/tmp";
#endif
snprintf (fnbuf, sizeof (fnbuf), "%s/rltrace.%ld", x, (long)getpid());
unlink(fnbuf);

View File

@ -0,0 +1,21 @@
diff -uNr bash-5.0/lib/sh/tmpfile.c bash-5.0.mod/lib/sh/tmpfile.c
--- bash-5.0/lib/sh/tmpfile.c 2016-08-11 18:05:58.000000000 +0300
+++ bash-5.0.mod/lib/sh/tmpfile.c 2019-02-20 14:17:08.270731426 +0200
@@ -74,15 +74,11 @@
return sys_tmpdir;
#endif
- sys_tmpdir = "/tmp";
+ sys_tmpdir = "@TERMUX_PREFIX@/tmp";
if (file_iswdir (sys_tmpdir))
return sys_tmpdir;
- sys_tmpdir = "/var/tmp";
- if (file_iswdir (sys_tmpdir))
- return sys_tmpdir;
-
- sys_tmpdir = "/usr/tmp";
+ sys_tmpdir = "@TERMUX_PREFIX@/var/tmp";
if (file_iswdir (sys_tmpdir))
return sys_tmpdir;

View File

@ -1,5 +1,6 @@
--- a/pathnames.h.in
+++ b/pathnames.h.in
diff -uNr bash-5.0/pathnames.h.in bash-5.0.mod/pathnames.h.in
--- bash-5.0/pathnames.h.in 2009-01-04 21:32:40.000000000 +0200
+++ bash-5.0.mod/pathnames.h.in 2019-02-20 14:15:56.880164371 +0200
@@ -22,10 +22,10 @@
#define _PATHNAMES_H_

View File

@ -0,0 +1,19 @@
diff -uNr bash-5.0/shell.c bash-5.0.mod/shell.c
--- bash-5.0/shell.c 2018-12-06 18:28:21.000000000 +0200
+++ bash-5.0.mod/shell.c 2019-02-20 14:19:29.808520144 +0200
@@ -339,12 +339,12 @@
{
struct stat sb;
- if (stat ("/tmp", &sb) < 0)
- internal_warning (_("could not find /tmp, please create!"));
+ if (stat ("@TERMUX_PREFIX@/tmp", &sb) < 0)
+ internal_warning (_("could not find @TERMUX_PREFIX@/tmp, please create!"));
else
{
if (S_ISDIR (sb.st_mode) == 0)
- internal_warning (_("/tmp must be a valid directory name"));
+ internal_warning (_("@TERMUX_PREFIX@/tmp must be a valid directory name"));
}
}
#endif /* __CYGWIN__ */