Changeset 118559


Ignore:
Timestamp:
Apr 4, 2014, 10:02:44 PM (6 years ago)
Author:
cal@…
Message:

base: remove macports_fastload.tcl, use correct Tcl, install port-tclsh for contrib software, specify LD_LIBRARY_PATH for intree Tcl for Linux, see #43208

macports_fastload.tcl contained two blocks of code: The first one was dead
because it was only used with Tcl < 8.5, the second one sourced the pkgIndex.tcl
files of all MacPorts Tcl packages. That was previously necessary to ensure
package require macports 1.0 would load the code from the correct prefix and
might also have improved performance because $auto_path of /usr/bin/tclsh
contains 10 entries. With our local copy of Tcl, the number of files read is
around 100 at most, so I think that's a non-issue from a performance POV. We
don't need the preloading to select the correct MacPorts prefix, because the
selection of the Tcl interpreter now does that for us correctly.

For this to work correctly, every Tcl file must now be executed with the correct
Tcl interpreter -- that replaces sourcing macports_fastload.tcl from the correct
prefix. Some of our install scripts still used /usr/bin/env tclsh.

This change also solves a potential build problem on Linux in src/pkg_mkindex.sh
because the Tcl library matching the in-tree Tcl interpreter might not be found
without LD_LIBRARY_PATH.

Furthermore, this adds a $prefix/bin/port-tclsh wrapper script that should be
used by contrib tools that need to use the MacPorts API. The shebang line should
be

#!/usr/bin/env port-tclsh

which will cause the contrib script to automatically work on the port
installation currently first in $PATH.

Location:
trunk/base
Files:
1 added
1 deleted
32 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/base/configure.ac

    r118297 r118559  
    418418        src/macports1.0/Makefile
    419419        src/macports1.0/macports_autoconf.tcl
    420         src/macports1.0/macports_fastload.tcl
    421420        src/macports1.0/macports_test_autoconf.tcl
    422421        src/package1.0/Makefile
     
    434433])
    435434
     435AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])
     436AC_CONFIG_FILES([src/images_to_archives.tcl], [chmod +x src/images_to_archives.tcl])
    436437AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
     438AC_CONFIG_FILES([src/upgrade_sources_conf_default.tcl], [chmod +x src/upgrade_sources_conf_default.tcl])
    437439
    438440AC_OUTPUT
  • trunk/base/src

    • Property svn:ignore
      •  

        old new  
        22Makefile
        33pkg_mkindex.sh
         4dedup_portfiles.tcl
         5images_to_archives.tcl
         6upgrade_sources_conf_default.tcl
  • trunk/base/src/Makefile.in

    r117621 r118559  
    2121        rm -f Makefile
    2222        rm -f pkg_mkindex.sh
     23        rm -f dedup_portfiles.tcl images_to_archives.tcl
    2324
    2425test::
  • trunk/base/src/dedup_portfiles.tcl.in

    r118558 r118559  
    1 #!/usr/bin/env tclsh
     1#!@TCLSH@
    22# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
    33# $Id$
     
    66# Takes one argument, which should be TCL_PACKAGE_DIR.
    77
    8 source [file join [lindex $argv 0] macports1.0 macports_fastload.tcl]
    98package require macports 1.0
    109package require registry2 2.0
  • trunk/base/src/images_to_archives.tcl.in

    r118296 r118559  
    1 #!/usr/bin/env tclsh
     1#!@TCLSH@
    22# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
    33# $Id$
     
    66# Takes one argument, which should be TCL_PACKAGE_DIR.
    77
    8 source [file join [lindex $argv 0] macports1.0 macports_fastload.tcl]
    98package require macports 1.0
    109package require registry 1.0
  • trunk/base/src/macports1.0/Makefile.in

    r118264 r118559  
    33
    44SRCS=           macports.tcl macports_dlist.tcl macports_util.tcl \
    5                 macports_autoconf.tcl macports_fastload.tcl
     5                macports_autoconf.tcl
    66OBJS=           macports.o get_systemconfiguration_proxies.o sysctl.o
    77SHLIB_NAME=     MacPorts${SHLIB_SUFFIX}
     
    2323
    2424distclean:: clean
    25         rm -f macports_autoconf.tcl macports_fastload.tcl macports_test_autoconf.tcl ${SHLIB_NAME}
     25        rm -f macports_autoconf.tcl macports_test_autoconf.tcl ${SHLIB_NAME}
    2626        rm -f Makefile
    2727
  • trunk/base/src/macports1.0/tests/macports.test

    r117407 r118559  
    88
    99source ../macports_test_autoconf.tcl
    10 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    1110package require macports 1.0
    1211
  • trunk/base/src/macports1.0/tests/macports_dlist.test

    r112325 r118559  
    55
    66source ../macports_test_autoconf.tcl
    7 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    87package require macports 1.0
    98
  • trunk/base/src/macports1.0/tests/macports_util.test

    r111469 r118559  
    55
    66source ../macports_test_autoconf.tcl
    7 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    87package require macports 1.0
    98
  • trunk/base/src/package1.0/tests/portarchivefetch.test

    r111455 r118559  
    77
    88source ../package_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/package1.0/tests/portdmg.test

    r111455 r118559  
    77
    88source ../package_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/package1.0/tests/portdpkg.test

    r111455 r118559  
    77
    88source ../package_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/package1.0/tests/portmdmg.test

    r111455 r118559  
    77
    88source ../package_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/package1.0/tests/portmpkg.test

    r111455 r118559  
    77
    88source ../package_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/package1.0/tests/portpkg.test

    r111455 r118559  
    77
    88source ../package_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/pkg_mkindex.sh.in

    r118056 r118559  
    3131TCLSH=@INTREE_TCLSH@
    3232GREP=@GREP@
     33LIB_PATH=`dirname $TCLSH`
    3334
    3435if [ $# = 0 ]; then
     
    3839
    3940for dir in $@; do
    40     echo "pkg_mkIndex -verbose -- $dir *.tcl *.dylib *.so" | env DYLD_LIBRARY_PATH=`dirname $TCLSH` $TCLSH 2>&1 \
     41    echo "pkg_mkIndex -verbose -- $dir *.tcl *.dylib *.so" \
     42                | env DYLD_LIBRARY_PATH=$LIB_PATH LD_LIBRARY_PATH=$LIB_PATH $TCLSH 2>&1 \
    4143        | $GREP "^warning: " && exit 1
    4244done
  • trunk/base/src/port

    • Property svn:ignore
      •  

        old new  
        44portindex
        55portmirror
         6port-tclsh
  • trunk/base/src/port/Makefile.in

    r118264 r118559  
    44INSTALLDIR=     ${DESTDIR}${prefix}
    55TOPSRCDIR=      ../..
    6 SCRIPTS=        portmirror portindex port
     6SCRIPTS=        portmirror portindex port port-tclsh
    77
    88edit = sed \
     
    2525        ${edit} $(srcdir)/port.tcl > $@
    2626
     27port-tclsh: port-tclsh.in ../../Mk/macports.autoconf.mk
     28        ${edit} $(srcdir)/port-tclsh.in > $@
     29
    2730mkdirs:
    2831        < ../../doc/prefix.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
     
    4043        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/bin
    4144        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/var/macports
    42         $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 555 port portindex portmirror ${INSTALLDIR}/bin/
     45        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 555 port portindex portmirror port-tclsh ${INSTALLDIR}/bin/
    4346        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $(srcdir)/port-help.tcl  ${INSTALLDIR}/var/macports/
    4447        cd ${INSTALLDIR}/bin && $(LN_S) -f port portf
  • trunk/base/src/port/port.tcl

    r118305 r118559  
    4444}
    4545
    46 source [file join "@macports_tcl_dir@" macports1.0 macports_fastload.tcl]
    4746package require macports
    4847package require Pextlib 1.0
  • trunk/base/src/port/portindex.tcl

    r117617 r118559  
    55# $Id$
    66
    7 source [file join "@macports_tcl_dir@" macports1.0 macports_fastload.tcl]
    87package require macports
    98package require Pextlib
  • trunk/base/src/port/portmirror.tcl

    r117617 r118559  
    99# Uses the database.
    1010
    11 source [file join "@macports_tcl_dir@" macports1.0 macports_fastload.tcl]
    1211package require macports
    1312package require Pextlib
  • trunk/base/src/port1.0/tests/portactivate.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portchecksum.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portclean.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portdeactivate.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portdepends.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portdistcheck.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portinstall.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portload.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portmain.test

    r113705 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portpatch.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/porttest.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portuninstall.test

    r111471 r118559  
    77
    88source ../port_test_autoconf.tcl
    9 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    109package require macports 1.0
    1110
  • trunk/base/src/port1.0/tests/portutil.test

    r113705 r118559  
    44namespace import tcltest::*
    55
    6 source ../../macports1.0/macports_fastload.tcl
    76
    87set pwd [file dirname [file normalize $argv0]]
    98
    109source ../port_test_autoconf.tcl
    11 source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    1210package require macports 1.0
    1311
  • trunk/base/src/upgrade_sources_conf_default.tcl.in

    r118296 r118559  
    1 #!/usr/bin/env tclsh
     1#!@TCLSH@
    22#
    33# $Id$
Note: See TracChangeset for help on using the changeset viewer.