Skip to content

Commit d342dd0

Browse files
committed
add small shell script wrapping port from local sources
1 parent 46b45b9 commit d342dd0

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/Doxyfile
55
/setupenv.bash
66
/autom4te.cache
7+
/port.sh
78

89
doc/*.gz
910
doc/*.mtree

configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9123,6 +9123,8 @@ $as_echo "yes" >&6; }
91239123
ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/Makefile doc/base.mtree doc/macosx.mtree doc/macports.conf doc/prefix.mtree doc/pubkeys.conf portmgr/dmg/postflight setupenv.bash src/Makefile src/cregistry/Makefile src/compat/Makefile src/darwintracelib1.0/Makefile src/machista1.0/Makefile src/macports1.0/Makefile src/macports1.0/macports_autoconf.tcl src/macports1.0/macports_test_autoconf.tcl src/mpcommon1.0/Makefile src/package1.0/Makefile src/package1.0/package_test_autoconf.tcl src/pextlib1.0/Makefile src/port/Makefile src/port1.0/Makefile src/port1.0/port_autoconf.tcl src/port1.0/port_test_autoconf.tcl src/programs/Makefile src/registry2.0/Makefile src/registry2.0/registry_autoconf.tcl tests/Makefile tests/test.tcl tests/test/library.tcl tests/test/trace/test.tcl vendor/Makefile"
91249124

91259125

9126+
ac_config_files="$ac_config_files port.sh"
9127+
91269128
ac_config_files="$ac_config_files vendor/tclsh"
91279129

91289130
ac_config_files="$ac_config_files src/cxx_stdlib_overridden.tcl"
@@ -9863,6 +9865,7 @@ do
98639865
"tests/test/library.tcl") CONFIG_FILES="$CONFIG_FILES tests/test/library.tcl" ;;
98649866
"tests/test/trace/test.tcl") CONFIG_FILES="$CONFIG_FILES tests/test/trace/test.tcl" ;;
98659867
"vendor/Makefile") CONFIG_FILES="$CONFIG_FILES vendor/Makefile" ;;
9868+
"port.sh") CONFIG_FILES="$CONFIG_FILES port.sh" ;;
98669869
"vendor/tclsh") CONFIG_FILES="$CONFIG_FILES vendor/tclsh" ;;
98679870
"src/cxx_stdlib_overridden.tcl") CONFIG_FILES="$CONFIG_FILES src/cxx_stdlib_overridden.tcl" ;;
98689871
"src/dedup_portfiles.tcl") CONFIG_FILES="$CONFIG_FILES src/dedup_portfiles.tcl" ;;
@@ -10421,6 +10424,7 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
1042110424
1042210425
1042310426
case $ac_file$ac_mode in
10427+
"port.sh":F) chmod +x port.sh ;;
1042410428
"vendor/tclsh":F) chmod +x vendor/tclsh ;;
1042510429
"src/cxx_stdlib_overridden.tcl":F) chmod +x src/cxx_stdlib_overridden.tcl ;;
1042610430
"src/dedup_portfiles.tcl":F) chmod +x src/dedup_portfiles.tcl ;;

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ AC_CONFIG_FILES([
467467
vendor/Makefile
468468
])
469469

470+
AC_CONFIG_FILES([port.sh], [chmod +x port.sh])
470471
AC_CONFIG_FILES([vendor/tclsh], [chmod +x vendor/tclsh])
471472
AC_CONFIG_FILES([src/cxx_stdlib_overridden.tcl], [chmod +x src/cxx_stdlib_overridden.tcl])
472473
AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])

port.sh.in

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
#
3+
# Simple shell script to invoke MacPorts from the source directory
4+
#
5+
6+
# force the locally built, vendored Tcl
7+
export TCL_LIBRARY="@abs_srcdir@/@VENDOR_DESTROOT@@TCL_PACKAGE_PATH@/tcl@TCL_VERSION@"
8+
9+
# tell it about the location of the MacPorts source files
10+
export TCLLIBPATH="@abs_srcdir@/src"
11+
12+
# a small sandbox profile that denies access to the installed sources
13+
sandbox_profile="
14+
(version 1)
15+
16+
(allow default)
17+
(deny file* (subpath \"@TCL_PREFIX@\"))
18+
"
19+
20+
# give a nice error if the source isn't built
21+
if ! [ -d "$TCL_LIBRARY" ] || ! [ -f "@abs_srcdir@/src/port/port" ]
22+
then
23+
echo "please build MacPorts before running this script!" 1>&2
24+
exit 1
25+
else
26+
exec /usr/bin/sandbox-exec -p "$sandbox_profile" \
27+
"@INTREE_TCLSH@" "@abs_srcdir@/src/port/port" "$@"
28+
fi

0 commit comments

Comments
 (0)