Skip to content

Commit

Permalink
add small shell script wrapping port from local sources
Browse files Browse the repository at this point in the history
  • Loading branch information
danchr committed Aug 20, 2020
1 parent 46b45b9 commit 2447a82
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/Doxyfile
/setupenv.bash
/autom4te.cache
/port.sh

doc/*.gz
doc/*.mtree
Expand Down
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9123,6 +9123,8 @@ $as_echo "yes" >&6; }
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"


ac_config_files="$ac_config_files port.sh"

ac_config_files="$ac_config_files vendor/tclsh"

ac_config_files="$ac_config_files src/cxx_stdlib_overridden.tcl"
Expand Down Expand Up @@ -9863,6 +9865,7 @@ do
"tests/test/library.tcl") CONFIG_FILES="$CONFIG_FILES tests/test/library.tcl" ;;
"tests/test/trace/test.tcl") CONFIG_FILES="$CONFIG_FILES tests/test/trace/test.tcl" ;;
"vendor/Makefile") CONFIG_FILES="$CONFIG_FILES vendor/Makefile" ;;
"port.sh") CONFIG_FILES="$CONFIG_FILES port.sh" ;;
"vendor/tclsh") CONFIG_FILES="$CONFIG_FILES vendor/tclsh" ;;
"src/cxx_stdlib_overridden.tcl") CONFIG_FILES="$CONFIG_FILES src/cxx_stdlib_overridden.tcl" ;;
"src/dedup_portfiles.tcl") CONFIG_FILES="$CONFIG_FILES src/dedup_portfiles.tcl" ;;
Expand Down Expand Up @@ -10421,6 +10424,7 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
case $ac_file$ac_mode in
"port.sh":F) chmod +x port.sh ;;
"vendor/tclsh":F) chmod +x vendor/tclsh ;;
"src/cxx_stdlib_overridden.tcl":F) chmod +x src/cxx_stdlib_overridden.tcl ;;
"src/dedup_portfiles.tcl":F) chmod +x src/dedup_portfiles.tcl ;;
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ AC_CONFIG_FILES([
vendor/Makefile
])

AC_CONFIG_FILES([port.sh], [chmod +x port.sh])
AC_CONFIG_FILES([vendor/tclsh], [chmod +x vendor/tclsh])
AC_CONFIG_FILES([src/cxx_stdlib_overridden.tcl], [chmod +x src/cxx_stdlib_overridden.tcl])
AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])
Expand Down
24 changes: 24 additions & 0 deletions port.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
#
# Simple shell script to invoke MacPorts from the source directory
#

export TCL_LIBRARY="@abs_srcdir@/@VENDOR_DESTROOT@@TCL_PACKAGE_PATH@/tcl@TCL_VERSION@"
export TCLLIBPATH="@abs_srcdir@/src"

# a small sandbox profile that denies access to installed sources
sandbox_profile="
(version 1)
(allow default)
(deny file* (subpath \"@TCL_PACKAGE_PATH@\"))
"

if ! [ -d "$TCL_LIBRARY" ] || ! [ -f "@abs_srcdir@/src/port/port" ]
then
echo "please build MacPorts before running this script!" 1>&2
exit 1
else
exec sandbox-exec -p "$sandbox_profile" \
"@INTREE_TCLSH@" "@abs_srcdir@/src/port/port" "$@"
fi

0 comments on commit 2447a82

Please sign in to comment.