You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
src/port: Replace port-tclsh with binary
It seems like using scripts as interpreters in shebangs leads to
unexpected effects on macOS, so let's just use a binary instead, which
seems to work fine. Fortunately, this particular binary is very simple,
too.
Closes: https://trac.macports.org/ticket/72530
(cherry picked from commit 92bae5a245)
This commit is contained in:
+3
-3
@@ -431,8 +431,8 @@ AC_CONFIG_FILES([
|
||||
portmgr/dmg/postflight
|
||||
setupenv.bash
|
||||
src/Makefile
|
||||
src/cregistry/Makefile
|
||||
src/compat/Makefile
|
||||
src/cregistry/Makefile
|
||||
src/darwintracelib1.0/Makefile
|
||||
src/darwintracelib1.0/tests/Makefile
|
||||
src/machista1.0/Makefile
|
||||
@@ -443,11 +443,12 @@ AC_CONFIG_FILES([
|
||||
src/package1.0/Makefile
|
||||
src/package1.0/package_test_autoconf.tcl
|
||||
src/pextlib1.0/Makefile
|
||||
src/portlist1.0/Makefile
|
||||
src/port/Makefile
|
||||
src/port/port-tclsh.c
|
||||
src/port1.0/Makefile
|
||||
src/port1.0/port_autoconf.tcl
|
||||
src/port1.0/port_test_autoconf.tcl
|
||||
src/portlist1.0/Makefile
|
||||
src/programs/Makefile
|
||||
src/registry2.0/Makefile
|
||||
src/registry2.0/registry_autoconf.tcl
|
||||
@@ -465,6 +466,5 @@ AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])
|
||||
AC_CONFIG_FILES([src/images_to_archives.tcl], [chmod +x src/images_to_archives.tcl])
|
||||
AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
|
||||
AC_CONFIG_FILES([src/upgrade_sources_conf_default.tcl], [chmod +x src/upgrade_sources_conf_default.tcl])
|
||||
AC_CONFIG_FILES([src/port/port-tclsh], [chmod +x src/port/port-tclsh])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -5,7 +5,7 @@ include ../../Mk/macports.autoconf.mk
|
||||
|
||||
INSTALLDIR= ${prefix}
|
||||
TOPSRCDIR= ../..
|
||||
SCRIPTS= portmirror portindex port
|
||||
SCRIPTS= portmirror portindex port port-tclsh
|
||||
|
||||
edit = sed -e 's,@TCLSH\@,$(TCLSH),g'
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#define _XOPEN_SOURCE 600
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc > 0) {
|
||||
char *newname = strdup("@TCLSH@");
|
||||
if (newname != NULL) {
|
||||
argv[0] = newname;
|
||||
}
|
||||
/* Ignore errors and just leave argv[0] the same, hoping that the
|
||||
* executed program will still work fine. */
|
||||
}
|
||||
execvp("@TCLSH@", argv);
|
||||
perror("execvp('@TCLSH@', argv)");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
exec "@TCLSH@" "$@"
|
||||
Reference in New Issue
Block a user