Browse Source

perl: fix perlio.c.patch

See issue https://github.com/termux/termux-packages/issues/4738.
build-on-device
Leonid Plyushch 5 years ago
parent
commit
24856a6d68
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 1
      packages/perl/build.sh
  2. 20
      packages/perl/perlio.c.patch

1
packages/perl/build.sh

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language"
TERMUX_PKG_LICENSE="Artistic-License-2.0"
TERMUX_PKG_VERSION=(5.30.1
1.3.1)
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=(bf3d25571ff1ee94186177c2cdef87867fd6a14aa5a84f0b1fb7bf798f42f964
edce0b0c2f725e2db3f203d6d8e9f3f7161256f5d1590551e40694f21200141d)
TERMUX_PKG_SRCURL=(http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz

20
packages/perl/perlio.c.patch

@ -1,12 +1,20 @@
diff -uNr perl-5.26.2/perlio.c perl-5.26.2.mod/perlio.c
--- perl-5.26.2/perlio.c 2018-03-23 21:34:37.000000000 +0200
+++ perl-5.26.2.mod/perlio.c 2018-06-19 17:56:36.691181671 +0300
@@ -5061,7 +5061,7 @@
#else /* WIN32 */
# if defined(HAS_MKSTEMP) && ! defined(VMS) && ! defined(OS2)
diff -uNr perl-5.30.1/perlio.c perl-5.30.1.mod/perlio.c
--- perl-5.30.1/perlio.c 2019-10-25 00:27:56.000000000 +0300
+++ perl-5.30.1.mod/perlio.c 2020-01-04 01:38:31.311705529 +0200
@@ -5059,14 +5059,14 @@
f = PerlIO_fdopen(fd, "w+b");
#elif ! defined(VMS) && ! defined(OS2)
int fd = -1;
- char tempname[] = "/tmp/PerlIO_XXXXXX";
+ char tempname[] = "@TERMUX_PREFIX@/tmp/PerlIO_XXXXXX";
const char * const tmpdir = TAINTING_get ? NULL : PerlEnv_getenv("TMPDIR");
SV * sv = NULL;
int old_umask = umask(0177);
if (tmpdir && *tmpdir) {
/* if TMPDIR is set and not empty, we try that first */
sv = newSVpv(tmpdir, 0);
- sv_catpv(sv, tempname + 4);
+ sv_catpv(sv, tempname + sizeof("@TERMUX_PREFIX@/tmp") - 1);
fd = Perl_my_mkstemp_cloexec(SvPVX(sv));
}
if (fd < 0) {

Loading…
Cancel
Save