tar: fix path to /tmp

This commit is contained in:
Leonid Pliushch 2019-03-02 14:53:02 +02:00
parent 568a0b755a
commit d2b17988da
2 changed files with 36 additions and 0 deletions

View File

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/tar/
TERMUX_PKG_DESCRIPTION="GNU tar for manipulating tar archives"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.32
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=d0d3ae07f103323be809bc3eac0dcc386d52c5262499fe05511ac4788af1fdd8
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/tar/tar-${TERMUX_PKG_VERSION}.tar.xz
# Allow xz compression (busybox only provides xz decompression):

View File

@ -0,0 +1,35 @@
diff -uNr tar-1.31/gnu/tempname.c tar-1.31.mod/gnu/tempname.c
--- tar-1.31/gnu/tempname.c 2019-01-02 20:16:01.000000000 +0200
+++ tar-1.31.mod/gnu/tempname.c 2019-03-01 18:31:05.035530338 +0200
@@ -32,7 +32,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
@@ -147,8 +147,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 tar-1.31/src/xheader.c tar-1.31.mod/src/xheader.c
--- tar-1.31/src/xheader.c 2019-01-02 20:07:48.000000000 +0200
+++ tar-1.31.mod/src/xheader.c 2019-03-01 18:31:18.538927987 +0200
@@ -387,7 +387,7 @@
size_t len;
const char *tmp = getenv ("TMPDIR");
if (!tmp)
- tmp = "/tmp";
+ tmp = "@TERMUX_PREFIX@/tmp";
len = strlen (tmp) + sizeof (GLOBAL_HEADER_TEMPLATE); /* Includes nul */
globexthdr_name = xmalloc (len);
strcpy(globexthdr_name, tmp);