Ignore:
Timestamp:
Jun 23, 2011, 4:00:37 AM (9 years ago)
Author:
derek@…
Message:

Merged latest trunk changes to gsoc11-statistics

Location:
branches/gsoc11-statistics/base
Files:
144 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-statistics/base

  • branches/gsoc11-statistics/base/ChangeLog

    r76920 r79672  
    44###
    55
    6 Unreleased changes:
     6Release 2.0.0 (unreleased):
     7
     8    - Multiple ports can now be defined in one Portfile using the 'subport'
     9      procedure. This reduces code duplication when several ports use very
     10      similar code. (jmr in r78062)
     11
     12    - Privilege dropping is now on by default. The runtime user can be changed
     13      when building from source but defaults to 'macports'; this user is
     14      created at install time. (jmr in r79025)
     15
     16    - Fetching from some extremely slow or partially unresponsive servers
     17      should now time out as expected. (raimue in r71038)
     18
     19    - The registry is now "vacuumed" (compacted/defragmented) after
     20      uninstalling ports. (jmr in r70608)
     21
     22    - Downloaded archives are now checked for integrity using digital
     23      signatures. Sync and selfupdate can also use a signed tarball. New
     24      pubkeys.conf file allows configuring keys to trust.
     25      (jmr in r68996, r79093)
     26
     27    - Added 'actinact' pseudo-portname that expands to installed ports with an
     28      active version and at least one inactive version.
     29      (#27666, jmr in r79421, based on patch from gmail.com:ww.galen)
     30
     31    - Added --size option for 'contents' action that makes it print the size
     32      of each file. (#27245, jmr in r79365, based on patch from
     33      gmail.com:ww.galen)
     34
     35    - Added 'space' action to show the disk space used by ports' active files.
     36      (#27244, jmr in r79349, based on patch from gmail.com:ww.galen)
     37
     38    - Actions can be abbreviated to an unambiguous prefix of the full name.
     39      (#27242, patch from gmail.com:ww.galen committed in r79259)
     40
     41    - Fixed error when activating ports whose version contains an underscore
     42      followed by an integer and a dash. (#28084, jmr in r79167)
     43
     44    - Deactivating a port that has dependents no longer needs to be forced
     45      when the dependents are all inactive. (#29505, jmr in r78086)
     46
     47    - New option 'add_users' has been added. Setting it will ensure that the
     48      listed users are created before all operations that may require them to
     49      exist. (#11563, jmr in r78660)
     50
     51    - 'port info --index' should be much faster and will work with the
     52      'current' pseudo-port provided the port has been indexed.
     53      (#13673, jmr in r78621)
     54
     55    - Relocation is explicitly disabled when building pkgs on 10.6, so Apple's
     56      Installer won't attempt to overwrite other copies of the same software
     57      not installed by MacPorts. (#25174, jmr in r78178)
     58
     59    - Non-Darwin platforms can once again build base against OpenSSL for
     60      checksum support. (#26813, afb in r77865)
     61
     62    - It is now safe to set svn.post_args, rather than that option being
     63      reserved for svn.url. (#27454, jmr in r73825)
     64
     65    - Variants specified when running 'port mpkg' are now set in the
     66      dependencies as well. (#27231, jmr in r73303)
     67
     68    - Fixed various issues with privilege dropping.
     69      (#26899, jmr in r69453 etc.)
     70
     71    - Trace mode no longer fails on 10.6. (#21582, jmr in r74318, r74369)
     72
     73    - Ports that create StartupItems (aka launchd plists) should now be
     74      installable by unprivileged users. (#10879, jmr in r66700, r75143)
     75
     76    - Fixed incorrect output from 'port dependents' when using newer SQLite
     77      versions. (#27506, patch from gmail.com:mmpestorich committed in r76827)
     78
     79    - The flat registry format is no longer available. Setting portdbformat to
     80      'flat' in macports.conf will result in the sqlite registry being used.
     81      (jmr in r77681)
     82
     83    - Port images are now stored as archives. Archive mode is now effectively
     84      always on. Among other benefits, this fixes some bugs with the handling
     85      of hard links installed by ports (e.g. #13601).
     86
     87      Direct mode is no longer available. Existing port image directories, and
     88      installed files for direct mode, will be converted to archives when
     89      upgrading.
     90
     91      (#19458, branch by blb, merged by jmr in r77511)
     92
     93    - master_site_local, patch_site_local, and archive_site_local can be set
     94      in macports.conf, with the same effects as the corresponding environment
     95      variables. (jmr in r74924)
     96
     97    - Added 'logfile' action that prints the path to a port's log file.
     98      (jmr in r74655)
     99
     100    - Computing large dependency trees that contain the same port(s) multiple
     101      times should be considerably faster. (jmr in r73133)
     102
     103    - configure.compiler can now be set to macports-llvm-gcc-4.2 or
     104      macports-clang (mfeiri in r72936, r72937)
    7105
    8106    - Add '-n' option to reinplace (#26406, ryandesign in r73227)
  • branches/gsoc11-statistics/base/LICENSE

    r67278 r79672  
    11Copyright (c) 2002 - 2003, Apple Inc.
    2 Copyright (c) 2004 - 2010, The MacPorts Project.
     2Copyright (c) 2004 - 2011, The MacPorts Project.
    33All rights reserved.
    44
  • branches/gsoc11-statistics/base/Makefile.in

    r79659 r79672  
    99DISTARCTAG      = ${DISTTAG}-archive
    1010DISTARCNAME     = ${DISTNAME}-archive
    11 SVNURL          = http://svn.macports.org/repository/macports
     11SVNURL          = https://svn.macports.org/repository/macports
    1212
    1313
     
    4242# Only run these scripts when not building in a destroot
    4343ifeq ($(DESTDIR),)
     44# create run user if it doesn't exist
     45        @if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then \
     46        if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then \
     47            if test $$USER = root; then \
     48                echo "Creating group \"${RUNUSR}\"" ; \
     49                ${DSEDITGROUP} -q -o create -n . ${RUNUSR} ; \
     50            else \
     51                echo "Not creating group \"${RUNUSR}\" (not root)" ; \
     52            fi ; \
     53        fi ; \
     54        if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then \
     55            if test $$USER = root; then \
     56                echo "Creating user \"${RUNUSR}\"" ; \
     57                ${DSCL} -q . -create /Users/${RUNUSR} Password \* ; \
     58                ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $$(($$(${DSCL} -q . -list /Users UniqueID | /usr/bin/awk '{print $$2}' | sort -ug | tail -1)+1)) ; \
     59                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}') ; \
     60                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /dev/null ; \
     61                ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false ; \
     62            else \
     63                echo "Not creating user \"${RUNUSR}\" (not root)" ; \
     64            fi ; \
     65        fi ; \
     66    else \
     67        echo "Can't find ${DSCL} / ${DSEDITGROUP}, not creating user \"${RUNUSR}\"" ; \
     68    fi
    4469# Add [default] tag to the central MacPorts repository, if it isn't already
    4570        $(TCLSH) src/upgrade_sources_conf_default.tcl "${prefix}"
     
    4974        @echo ""; echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, add ${prefix}/bin to your PATH and run:"; echo ""
    5075        @echo "sudo port -v selfupdate"; echo ""
    51         @echo "Please read \"man port\", the MacPorts guide at http://guide.macports.org/ and Wiki at http://trac.macports.org/ for full documentation."; echo ""
     76        @echo "Please read \"man port\", the MacPorts guide at http://guide.macports.org/ and Wiki at https://trac.macports.org/ for full documentation."; echo ""
    5277
    5378group::
     
    76101        cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | bzip2 > ${PKGNAME}.tar.bz2
    77102        cd ${DISTDIR}; for tarball in ${PKGNAME}.tar.*; do { \
    78                 for type in -md5 -sha1 -ripemd160; do { \
     103                for type in -md5 -sha1 -ripemd160 -sha256; do { \
    79104                        openssl dgst $$type $$tarball; \
    80105                }; done >> ${DISTNAME}.chk.txt; \
  • branches/gsoc11-statistics/base/Mk/macports.autoconf.mk.in

    r65055 r79672  
    5353macports_tcl_dir        = @macports_tcl_dir@
    5454
     55DSCL                    = @DSCL@
     56DSEDITGROUP             = @DSEDITGROUP@
    5557DSTUSR                  = @DSTUSR@
    5658DSTGRP                  = @DSTGRP@
    5759DSTMODE                 = @DSTMODE@
    58 
     60RUNUSR                  = @RUNUSR@
    5961
    6062prefix                  = @prefix@
  • branches/gsoc11-statistics/base/NEWS

    r68676 r79672  
     1== Overview of changes from MacPorts 1.9.2 to 2.0.0 ==
     2
     3# For regular users:
     4
     5*) Downloaded archives are now checked for integrity using digital signatures.
     6   New pubkeys.conf file allows configuring keys to trust.
     7
     8*) Actions can be abbreviated to an unambiguous prefix of the full name.
     9
     10*) Ports that create StartupItems (aka launchd plists) should now be
     11   installable by unprivileged users.
     12
     13*) Port images are now stored as archives. Archive mode is now effectively
     14   always on. Direct mode and the flat registry format are no longer
     15   available. Conversion will happen automatically.
     16
     17# For Portfile writers:
     18
     19*) Multiple ports can now be defined in one Portfile using the 'subport'
     20   procedure.
     21
     22*) New option 'add_users' can be set to ensure that the listed users are
     23   created at the right times during the install process.
     24
     25*) SHA256 checksums are now supported.
     26
    127== Overview of changes from MacPorts 1.8.2 to 1.9.0 ==
    228
  • branches/gsoc11-statistics/base/aclocal.m4

    r77864 r79672  
    328328                AC_SUBST(DSTGRP)
    329329
     330                # Set run-user to current user
     331                AC_MSG_CHECKING([for macports user])
     332                RUNUSR=`id -un`
     333                AC_MSG_RESULT([$RUNUSR])
     334                AC_SUBST(RUNUSR)
     335
    330336                # Set Tcl package directory to ~/Library/Tcl
    331337            AC_MSG_CHECKING(for Tcl package directory)
     
    355361        AC_MSG_CHECKING([for macports user])
    356362        if test "x$RUNUSR" = "x" ; then
    357            RUNUSR=nobody
     363           RUNUSR=macports
    358364        fi
    359365
  • branches/gsoc11-statistics/base/config/RELEASE_URL

    r73224 r79672  
    1 http://svn.macports.org/repository/macports/tags/release_1_9_2/base
     1https://svn.macports.org/repository/macports/tags/release_1_9_2/base
  • branches/gsoc11-statistics/base/configure

    r79661 r79672  
    648648MPAPPLICATIONSDIR
    649649DSTMODE
     650TCL_PACKAGE_DIR
    650651RUNUSR
    651 TCL_PACKAGE_DIR
    652652DSTGRP
    653653DSTUSR
     
    710710BZR
    711711FILE
     712DSEDITGROUP
    712713DSCL
    713714DIFF
     
    794795with_objc_runtime
    795796with_objc_foundation
     797with_unsupported_prefix
    796798with_ports_dir
    797799with_no_root_privileges
     
    14671469  --with-objc-runtime     Specify either "GNU" or "apple"
    14681470  --with-objc-foundation  Specify either "GNUstep" or "apple"
     1471  --with-unsupported-prefix
     1472                          Acknowledge that you accept the consequences of
     1473                          using an unsupported prefix.
    14691474  --with-ports-dir=DIR    Specify alternate ports directory
    14701475  --with-no-root-privileges
     
    29192924                  Please upgrade at http://store.apple.com/" "$LINENO" 5
    29202925    ;;
    2921   10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-3])
     2926  10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-6])
    29222927    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This version of Mac OS X is out of date" >&5
    29232928$as_echo "$as_me: WARNING: This version of Mac OS X is out of date" >&2;}
     
    29252930$as_echo "$as_me: WARNING: Please run Software Update to update it" >&2;}
    29262931    ;;
    2927   10.4*|10.5*|10.6*)
     2932  10.4*|10.5*|10.6*|10.7*)
    29282933        ;;
    29292934  *)
     
    29692974$as_echo "$as_me: WARNING: Please consider upgrading as some ports fail compiling" >&2;}
    29702975    ;;
    2971   2.*|3.*)
     2976  2.*|3.*|4.*)
    29722977        ;;
    29732978  *)
     
    43984403
    43994404
     4405# Extract the first word of "dseditgroup", so it can be a program name with args.
     4406set dummy dseditgroup; ac_word=$2
     4407{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
     4408$as_echo_n "checking for $ac_word... " >&6; }
     4409if ${ac_cv_path_DSEDITGROUP+:} false; then :
     4410  $as_echo_n "(cached) " >&6
     4411else
     4412  case $DSEDITGROUP in
     4413  [\\/]* | ?:[\\/]*)
     4414  ac_cv_path_DSEDITGROUP="$DSEDITGROUP" # Let the user override the test with a path.
     4415  ;;
     4416  *)
     4417  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4418for as_dir in $PATH
     4419do
     4420  IFS=$as_save_IFS
     4421  test -z "$as_dir" && as_dir=.
     4422    for ac_exec_ext in '' $ac_executable_extensions; do
     4423  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4424    ac_cv_path_DSEDITGROUP="$as_dir/$ac_word$ac_exec_ext"
     4425    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     4426    break 2
     4427  fi
     4428done
     4429  done
     4430IFS=$as_save_IFS
     4431
     4432  ;;
     4433esac
     4434fi
     4435DSEDITGROUP=$ac_cv_path_DSEDITGROUP
     4436if test -n "$DSEDITGROUP"; then
     4437  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSEDITGROUP" >&5
     4438$as_echo "$DSEDITGROUP" >&6; }
     4439else
     4440  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
     4441$as_echo "no" >&6; }
     4442fi
     4443
     4444
    44004445# Extract the first word of "file", so it can be a program name with args.
    44014446set dummy file; ac_word=$2
     
    75987643# Check for paths
    75997644
    7600 if test x$prefix = x/usr/local; then
    7601     as_fn_error $? "Installing MacPorts into /usr/local is not supported" "$LINENO" 5
     7645
     7646# Check whether --with-unsupported-prefix was given.
     7647if test "${with_unsupported_prefix+set}" = set; then :
     7648  withval=$with_unsupported_prefix; with_unsupported_prefix=$withval
     7649else
     7650  with_unsupported_prefix=no
     7651fi
     7652
     7653if test x$prefix = x/usr/local -a x$with_unsupported_prefix != xyes; then
     7654    as_fn_error $? "Installing MacPorts into /usr/local is not supported. If \
     7655you understand this and wish to do so anyway, pass --with-unsupported-prefix \
     7656to configure." "$LINENO" 5
    76027657fi
    76037658
     
    76827737
    76837738
     7739                # Set run-user to current user
     7740                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for macports user" >&5
     7741$as_echo_n "checking for macports user... " >&6; }
     7742                RUNUSR=`id -un`
     7743                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUNUSR" >&5
     7744$as_echo "$RUNUSR" >&6; }
     7745
     7746
    76847747                # Set Tcl package directory to ~/Library/Tcl
    76857748            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl package directory" >&5
     
    77687831$as_echo_n "checking for macports user... " >&6; }
    77697832        if test "x$RUNUSR" = "x" ; then
    7770            RUNUSR=nobody
     7833           RUNUSR=macports
    77717834        fi
    77727835
     
    95929655
    95939656# Output
    9594 ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/prefix.mtree doc/macosx.mtree doc/macports.conf doc/pubkeys.conf portmgr/freebsd/Makefile src/Makefile src/macports1.0/macports_autoconf.tcl src/port1.0/port_autoconf.tcl src/registry2.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl setupenv.bash"
     9657ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/base.mtree doc/prefix.mtree doc/macosx.mtree doc/macports.conf doc/pubkeys.conf portmgr/freebsd/Makefile src/Makefile src/macports1.0/macports_autoconf.tcl src/port1.0/port_autoconf.tcl src/registry2.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl setupenv.bash"
    95959658
    95969659
     
    1030510368    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
    1030610369    "Mk/macports.autoconf.mk") CONFIG_FILES="$CONFIG_FILES Mk/macports.autoconf.mk" ;;
     10370    "doc/base.mtree") CONFIG_FILES="$CONFIG_FILES doc/base.mtree" ;;
    1030710371    "doc/prefix.mtree") CONFIG_FILES="$CONFIG_FILES doc/prefix.mtree" ;;
    1030810372    "doc/macosx.mtree") CONFIG_FILES="$CONFIG_FILES doc/macosx.mtree" ;;
  • branches/gsoc11-statistics/base/configure.ac

    r79661 r79672  
    3333                  Please upgrade at http://store.apple.com/])
    3434    ;;
    35   10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-3]])
     35  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-6]])
    3636    AC_MSG_WARN([This version of Mac OS X is out of date])
    3737    AC_MSG_WARN([Please run Software Update to update it])
    3838    ;;
    39   10.4*|10.5*|10.6*)
     39  10.4*|10.5*|10.6*|10.7*)
    4040    dnl Supported version
    4141    ;;
     
    7474    AC_MSG_WARN([Please consider upgrading as some ports fail compiling])
    7575    ;;
    76   2.*|3.*)
     76  2.*|3.*|4.*)
    7777    dnl Supported version
    7878    ;;
     
    9797AC_PATH_PROG(DIFF, [diff], [])
    9898AC_PATH_PROG(DSCL, [dscl], [])
     99AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [])
    99100AC_PATH_PROG(FILE, [file], [])
    100101AC_PATH_PROG(BZR, [bzr], [])
     
    174175# Check for paths
    175176AC_PREFIX_DEFAULT(/opt/local)
    176 if test x$prefix = x/usr/local; then
    177     AC_MSG_ERROR([Installing MacPorts into /usr/local is not supported])
     177AC_ARG_WITH(
     178                unsupported-prefix,
     179                AS_HELP_STRING([--with-unsupported-prefix],
     180                [Acknowledge that you accept the consequences of using an unsupported prefix.]),
     181                [with_unsupported_prefix=$withval],
     182                [with_unsupported_prefix=no])
     183if test x$prefix = x/usr/local -a x$with_unsupported_prefix != xyes; then
     184    AC_MSG_ERROR([Installing MacPorts into /usr/local is not supported. If \
     185you understand this and wish to do so anyway, pass --with-unsupported-prefix \
     186to configure.])
    178187fi
    179188MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
     
    351360        Makefile
    352361        Mk/macports.autoconf.mk
     362        doc/base.mtree
    353363        doc/prefix.mtree
    354364        doc/macosx.mtree
  • branches/gsoc11-statistics/base/doc

    • Property svn:ignore
      •  

        old new  
        11macports.conf
        22pubkeys.conf
         3base.mtree
        34prefix.mtree
        45macosx.mtree
  • branches/gsoc11-statistics/base/doc/Makefile

    r71035 r79672  
    1818
    1919distclean: clean
    20         rm -f macports.conf macosx.mtree prefix.mtree pubkeys.conf
     20        rm -f macports.conf base.mtree macosx.mtree prefix.mtree pubkeys.conf
    2121
    2222%.1.gz: %.1
     
    3333        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${DESTDIR}${mpconfigdir}
    3434
    35         <prefix.mtree $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
     35        < prefix.mtree $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
     36        < base.mtree $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
    3637        if test -L "${INSTALLDIR}/man" ; then \
    3738                rm -f "${INSTALLDIR}/man"; \
     
    5657
    5758        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/share/macports/install
     59        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 base.mtree ${INSTALLDIR}/share/macports/install/
    5860        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${INSTALLDIR}/share/macports/install/
    5961        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macosx.mtree ${INSTALLDIR}/share/macports/install/
  • branches/gsoc11-statistics/base/doc/macports.conf.5

    r78933 r79672  
    11.\" Copyright (c) 2005 Matt Anton <matt@opendarwin.org>
    22.\" Copyright (c) 2007 Juan Manuel Palacios <jmpp@macports.org>
     3.\" Copyright (c) 2007-2011 The MacPorts Project
    34.\" All rights reserved.
    45.\"
  • branches/gsoc11-statistics/base/doc/macports.conf.in

    r79661 r79672  
    7979# Rsync server to fetch MacPorts sources from. Note that this is only used
    8080# for selfupdate. The source(s) for the ports tree are set in sources.conf.
    81 # Known mirrors at time of writing (see http://trac.macports.org/wiki/Mirrors
     81# Known mirrors at time of writing (see https://trac.macports.org/wiki/Mirrors
    8282# for the current list):
    8383#   rsync.macports.org        - California, USA (master)
     
    8686
    8787# Rsync directory from which to pull the base/ component (infrastructure) of MacPorts
    88 #rsync_dir                      release/base/
     88# If this points to a .tar file, a signed .rmd160 must exist next to it
     89# on the server and will be used to verify its integrity.
     90#rsync_dir                      release/tarballs/base.tar
    8991
    9092# Rsync options
  • branches/gsoc11-statistics/base/doc/port.1

    r77511 r79672  
    11.\" port.1
    22.\"
    3 .\" Copyright (c) 2002 Apple Computer, Inc.
     3.\" Copyright (c) 2004-2011 The MacPorts Project
     4.\" Copyright (c) 2002-2003 Apple Inc.
    45.\" All rights reserved.
    56.\"
     
    1213.\"    notice, this list of conditions and the following disclaimer in the
    1314.\"    documentation and/or other materials provided with the distribution.
    14 .\" 3. Neither the name of Apple Computer, Inc. nor the names of its
     15.\" 3. Neither the name of Apple Inc. nor the names of its
    1516.\"    contributors may be used to endorse or promote products derived from
    1617.\"    this software without specific prior written permission.
     
    103104.Ar inactive :
    104105set of installed but inactive ports.
     106.Pp
     107.It
     108.Ar actinact :
     109set of installed ports that have both an active version and one or more inactive versions.
    105110.Pp
    106111.It
     
    378383.Dl "port -u uninstall"
    379384.Dl "port uninstall --follow-dependents python24"
     385.Ss select
     386For a given
     387.Ar group ,
     388selects a
     389.Ar version
     390to be the default by creating appropriate symbolic links.
     391For instance,
     392.Ic "python"
     393might be linked to
     394.Ic "python2.6" .
     395Available select groups are installed as subdirectories of
     396.Ar ${prefix}/etc/select/ .
     397To list the available versions in a group, use
     398.Fl -list .
     399To see which version is currently selected for a group, use
     400.Fl -show .
     401To change the selected version for a group, use
     402.Fl -set .
     403.Pp
     404For example:
     405.Pp
     406.Dl "port select --list python"
     407.Dl "port select --show gcc"
     408.Dl "port select --set gcc mp-gcc44"
     409.Pp
    380410.Ss activate
    381411Activate the installed
  • branches/gsoc11-statistics/base/doc/portfile.7

    r78662 r79672  
    11.\" portfile.7
    22.\"
    3 .\" Copyright (c) 2002 Apple Computer, Inc.
     3.\" Copyright (c) 2004-2011 The MacPorts Project
     4.\" Copyright (c) 2002-2003 Apple Inc.
    45.\" All rights reserved.
    56.\"
     
    1213.\"    notice, this list of conditions and the following disclaimer in the
    1314.\"    documentation and/or other materials provided with the distribution.
    14 .\" 3. Neither the name of Apple Computer, Inc. nor the names of its
     15.\" 3. Neither the name of Apple Inc. nor the names of its
    1516.\"    contributors may be used to endorse or promote products derived from
    1617.\"    this software without specific prior written permission.
     
    402403.sp
    403404.Dl add_users user1 group=mygroup user2 group=mygroup
     405.It Ic installs_libs
     406By default, it is assumed that ports may install libraries or headers that can
     407be incorporated into their dependents. If this is not the case, set
     408.Cm installs_libs
     409to
     410.Em no .
     411This means that this port's dependents need not check that it is installed
     412for the same architectures as them; that it is permissible to distribute
     413binaries of the dependents even if their licenses conflict with the license
     414of this port; and that updates to this port can never result in broken dynamic
     415linking in its dependents.
     416.br
     417.Sy Type:
     418.Em optional
     419.br
     420.Sy Default:
     421.Em none
     422.br
     423.Sy Example:
     424.Dl installs_libs no
    404425.El
    405426.Sh TARGET HOOKS
  • branches/gsoc11-statistics/base/doc/portgroup.7

    r51891 r79672  
    1212.\"    notice, this list of conditions and the following disclaimer in the
    1313.\"    documentation and/or other materials provided with the distribution.
    14 .\" 3. Neither the name of Apple Computer, Inc. nor the names of its
     14.\" 3. Neither the name of The MacPorts Project nor the names of its
    1515.\"    contributors may be used to endorse or promote products derived from
    1616.\"    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/doc/prefix.mtree.in

    r66775 r79672  
    241241    ..
    242242    var
    243         macports
    244             build
    245             ..
    246             distfiles
    247             ..
    248             logs
    249             ..
    250             packages
    251             ..
    252             receipts
    253             ..
    254             registry
    255             ..
    256         ..
    257243    ..
    258244    www
  • branches/gsoc11-statistics/base/doc/sources.conf

    r42662 r79672  
    2424#  To get it from the mirror in Trondheim, Norway use:
    2525#      rsync://trd.no.rsync.macports.org/release/ports/
    26 #  A current list of mirrors is available at http://trac.macports.org/wiki/Mirrors
    27 rsync://rsync.macports.org/release/ports/ [default]
     26#  A current list of mirrors is available at https://trac.macports.org/wiki/Mirrors
     27
     28# If an rsync URL points to a .tar file, a signed .rmd160 must exist next to
     29# it on the server and will be used to verify its integrity.
     30
     31rsync://rsync.macports.org/release/tarballs/ports.tar [default]
  • branches/gsoc11-statistics/base/m4/tcl.m4

    r62340 r79672  
    11# This file is based on the tcl.m4 file distributed with Tcl 8.4
    2 # Portions Copyright (2003) Apple Computer, Inc.
     2# Portions Copyright (2003) Apple Inc.
    33#
    44# Copyright and License for this file, copied verbatim from the official
  • branches/gsoc11-statistics/base/macports-pubkey.pem

    r68996 r79672  
    11-----BEGIN PUBLIC KEY-----
    2 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPlw2FSMEavmtuHq5O+f
    3 XPUXndBnUyoX8iJvQ7NlsNY+hleE307kOAly79WFq2aAGIyKB/Ob8V+qCLW4FGOO
    4 4NfvOnte1WxQP8oVxOM9ai3CeN6AnUxDWUTYVJ1R+a5ZQVnJyGBKkV+jLlj0PD/z
    5 d8PCJ/j7Wzizw3d4s9uBIR1zpLY8lVgTivsj5FM3RP6hS7ww7I47goQshoL+YFVg
    6 NhE9I63oZXqFF130l9jJI9axHUqza7a42WCv04J8iv8SQhgv6fY9ZQnIBMQ4hPDH
    7 klGusdf4HlCbUViKhxmUpfj6FJabh2jV48ymaoTZB767GJyACF4mvnNDkenEXf41
    8 /wIDAQAB
     2MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAv2bUqZgZmQNtkInIcery
     3c/DQIbGdKgrdJ2+x45jOCITEf7QubgNmJAtw4OSNt30EXWGOrJXGD5Vb81o4ycEr
     4f+bdTgCAG9fOipMxxDhT8AbSkAzYx9vGIcEwQP6VX5QhPlFxJJweeefEINNHkrm5
     5KdmGpGxwe5AtTzxJiabWmJookKuoPxdy+5Am/EaCOIU6+HyM8i163L+DYDT+MF+e
     6LFUVtpoZ4xVzvHhLMDwIsZWdpBrJcj9MVv3TOL0PQDAjyo/Gp2TWWRbiMaQ8vkfO
     7NVSDAfvtOUlTBFcdt0oeLYL0F5Yj8wt5HYdL9GE6u+JOl+ee/dEUUhcmoFew9x9W
     8YznHujitbmbQVPV1IYi4qIE4MyZPlmPmSyVg1bnt9UIgSTccqwUV6VzxF2fpwjvP
     9tTo/sNLdtI3S/mprvzxTgv/gaB//1JAHXDKgUAtsgUyb6+RREjF2mFnAJb99H7sN
     105E89dIbI9v9CW5gJr0BoPYiDIZ1+HTUhW3+FCw+eNvPET+p8H5b9E+VXG/ctjac2
     117Lkexo4TOVJCN0p9kTdgCNzHrsJpyMkvsP8sR1SVvv94uC1X7sspIgFNcf/+YQ9t
     12hzq+5L7GZgAyYy06xi+DYL4xR4oAOkirp/va1Yu4PaYGqly/Fbuw8ibJH1lmnu0G
     13u3jRn1M2GBkVDNlb9oUHiecCAwEAAQ==
    914-----END PUBLIC KEY-----
  • branches/gsoc11-statistics/base/portmgr/ReleaseProcess

    r68280 r79672  
    4040   (the 'base' directory level *needs* to exist in each release branch, otherwise selfupdate breaks):
    4141
    42  svn mkdir -m "commit-message" http://svn.macports.org/repository/macports/branches/release_1_6
    43  svn cp [-r<rev>] -m "commit-message" http://svn.macports.org/repository/macports/trunk/base \
    44      http://svn.macports.org/repository/macports/branches/release_1_6
     42 svn mkdir -m "commit-message" https://svn.macports.org/repository/macports/branches/release_1_6
     43 svn cp [-r<rev>] -m "commit-message" https://svn.macports.org/repository/macports/trunk/base \
     44     https://svn.macports.org/repository/macports/branches/release_1_6
    4545
    4646The actual release, alpha or beta releases, release candidates, and any point releases will all
     
    8989We first tag the branched base directory to make up the final release:
    9090
    91  svn cp -m "commit-message" http://svn.macports.org/repository/macports/branches/release_1_6 \
    92      http://svn.macports.org/repository/macports/tags/release_1_6_0
     91 svn cp -m "commit-message" https://svn.macports.org/repository/macports/branches/release_1_6 \
     92     https://svn.macports.org/repository/macports/tags/release_1_6_0
    9393
    9494Although only the base subdirectory is branched and tagged for a given major release, we also create a
     
    102102tag URL. For instance:
    103103
    104  svn co [-r<rev>] http://svn.macports.org/repository/macports/trunk release_1.6.0-archive
     104 svn co [-r<rev>] https://svn.macports.org/repository/macports/trunk release_1.6.0-archive
    105105 cd release_1.6.0-archive/base
    106  svn switch http://svn.macports.org/repository/macports/tags/release_1_6_0/base
     106 svn switch https://svn.macports.org/repository/macports/tags/release_1_6_0/base
    107107
    108108And finally we tag the entire directory as release_1_6_0-archive:
    109109
    110110 cd ../../
    111  svn cp -m "commit-message" release_1.6.0-archive http://svn.macports.org/repository/macports/tags/release_1_6_0-archive
     111 svn cp -m "commit-message" release_1.6.0-archive https://svn.macports.org/repository/macports/tags/release_1_6_0-archive
    112112
    113113
     
    158158 cd work
    159159 mv MacPorts-1.6.0.dmg MacPorts-1.6.0-10.5-Leopard.dmg
    160  for dmg in MacPorts-1.6.0-*.dmg; do for type in -md5 -sha1 -ripemd160; do openssl dgst $type $dmg; done >> MacPorts-1.6.0.chk.txt; done
     160 for dmg in MacPorts-1.6.0-*.dmg; do for type in -md5 -sha1 -ripemd160 -sha256; do openssl dgst $type $dmg; done >> MacPorts-1.6.0.chk.txt; done
    161161
    162162These new products, along with the new checksums, also have to be posted to the appropriate
     
    218218 * The macports-announce@, macports-users@ and macports-dev@ mailing lists.
    219219 * The MacPorts website, by adapting the $macports_version_major and $macports_version_latest variables as appropriate in the trunk/www/includes/common.inc file.
    220  * [http://trac.macports.org/news/] The MacOSforge news section (submitter: portmgr@)
     220 * [https://trac.macports.org/news/] The MacOSforge news section (submitter: portmgr@)
    221221 * [http://www.apple.com/downloads/macosx/unix_open_source/macports.html Apple's downloads page] (submitter: jmpp@)
    222222 * [http://freshmeat.net/projects/macports/ Freshmeat] (submitter: mww@)
  • branches/gsoc11-statistics/base/portmgr/dmg/License.html

    r67305 r79672  
    1616    <body>
    1717   
    18         <p>Copyright (c) 2002 - 2003, Apple Computer, Inc.<br>Copyright (c) 2004 - 2010, The MacPorts Project.</p>
     18        <p>Copyright (c) 2002 - 2003, Apple Inc.<br>Copyright (c) 2004 - 2011, The MacPorts Project.</p>
    1919        <p>All rights reserved.</p>
    2020        <p><br></p>
     
    2727            <li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
    2828            in the documentation and/or other materials provided with the distribution.</li>
    29             <li>Neither the name of Apple Computer, Inc., The MacPorts Project nor the names of its contributors may be used to endorse or
     29            <li>Neither the name of Apple Inc., The MacPorts Project nor the names of its contributors may be used to endorse or
    3030            promote products derived from this software without specific prior written permission.</li>
    3131        </ol>
  • branches/gsoc11-statistics/base/portmgr/dmg/postflight

    r77680 r79672  
    22# -*- coding: utf-8; mode: shell-script-mode; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=sh:et:sw=4:ts=4:sts=4
    33#
     4# Copyright (c) 2008-2011 The MacPorts Project
    45# Copyright (c) 2002-2007 Juan Manuel Palacios <jmpp@macports.org>, The MacPorts Project.
    56# All rights reserved.
     
    1314#    notice, this list of conditions and the following disclaimer in the
    1415#    documentation and/or other materials provided with the distribution.
    15 # 3. Neither the name of Apple, Inc., The MacPorts Project nor the
     16# 3. Neither the name of The MacPorts Project nor the
    1617#    names of its contributors may be used to endorse or promote products
    1718#    derived from this software without specific prior written permission.
     
    4647MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl
    4748REG1DIR=${MACPORTS_TCL_DIR}/registry1.0
     49DSCL=/usr/bin/dscl
     50RUNUSR=macports
    4851TCLSH=/usr/bin/tclsh
    4952TCL_PACKAGE_DIR=/Library/Tcl
     
    5457# Create config files from defaults if not present
    5558function setup_configs {
    56     for f in macports.conf sources.conf variants.conf ; do
     59    for f in macports.conf pubkeys.conf sources.conf variants.conf ; do
    5760        if [ ! -f ${CONFIGPATH}/${f} ]; then
    5861            echo "Copying ${f}.default to ${f}"
     
    6568# Command to update the MacPorts installation through "selfupdate":
    6669function update_macports {
     70    # Add [default] tag to the central MacPorts repository, if it isn't already
     71    echo "Adding [default] tag to sources.conf if needed..."
     72    ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/upgrade_sources_conf_default.tcl ${PREFIX}
     73    # Convert image directories (and direct mode installs) to image archives
     74    echo "Updating port image format..."
     75    ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/images_to_archives.tcl ${MACPORTS_TCL_DIR}
     76
    6777    echo "Synchronizing the MacPorts installation with the project's rsync server..."
    6878    if ! ${BINPATH}/port -v selfupdate; then
     
    7282        echo "Successful!"
    7383    fi
    74    
    75     # Add [default] tag to the central MacPorts repository, if it isn't already
    76     ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/upgrade_sources_conf_default.tcl ${PREFIX}
    77     # Convert image directories (and direct mode installs) to image archives
    78     ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/images_to_archives.tcl ${MACPORTS_TCL_DIR}
    7984}
    8085
     
    129134}
    130135
     136# create the user to use for privilege dropping
     137function create_run_user {
     138    DSEDITGROUP=/usr/sbin/dseditgroup
     139    if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then
     140        if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then
     141            echo "Creating group \"${RUNUSR}\""
     142            ${DSEDITGROUP} -q -o create -n . ${RUNUSR}
     143        fi
     144        if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then
     145            echo "Creating user \"${RUNUSR}\""
     146            ${DSCL} -q . -create /Users/${RUNUSR} Password *
     147            ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $(($(${DSCL} . -list /Users UniqueID | /usr/bin/awk '{print $2}' | sort -ug | tail -1)+1))
     148            ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $2}')
     149            ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /dev/null
     150            ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false
     151        fi
     152    else
     153        echo "Can't find ${DSCL} / ${DSEDITGROUP}, unable to create user \"${RUNUSR}\""
     154        exit 1
     155    fi
     156}
     157
    131158echo "The MacPorts Project, postflight script version ${VERSION}: checking the shell environment for user \"${USER}\"."
    132159
     
    142169# Determine the user's shell, in order to choose an appropriate configuration file we'll be tweaking.
    143170# Exit nicely if the shell is any other than bash or tcsh, as that's considered non-standard.
    144 USHELL=$(dscl . -read /users/${USER} shell | awk -F'/' '{print $NF}') || {
     171USHELL=$(${DSCL} . -read /Users/${USER} shell | awk -F'/' '{print $NF}') || {
    145172    echo "An attempt to determine your shell name failed! Please set your MacPorts compatible environment manually."
    146173    update_macports
  • branches/gsoc11-statistics/base/portmgr/fedora/macports.spec

    r60372 r79672  
    55License: BSD
    66Group: System Environment/Base
    7 URL: http://www.macports.org
    8 Source: http://svn.macosforge.org/repository/macports/distfiles/MacPorts/MacPorts-%{version}.tar.bz2
     7URL: http://www.macports.org/
     8Source: https://svn.macports.org/repository/macports/distfiles/MacPorts/MacPorts-%{version}.tar.bz2
    99Prefix: /opt/local
    1010BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  • branches/gsoc11-statistics/base/portmgr/jobs/GuideRegen.sh

    r44179 r79672  
    1818# Other settings (probably don't need to be changed).
    1919SVN_CONFIG_DIR=${ROOT}/svnconfig
    20 REPO_BASE=http://svn.macports.org/repository/macports
     20REPO_BASE=https://svn.macports.org/repository/macports
    2121SVN="/opt/local/bin/svn -q --non-interactive --config-dir $SVN_CONFIG_DIR"
    2222# Where to checkout the source code. This needs to exist!
  • branches/gsoc11-statistics/base/portmgr/jobs/PortIndex2MySQL.tcl

    r65055 r79672  
    1010#
    1111# Copyright (c) 2007 Juan Manuel Palacios, The MacPorts Project.
    12 # Copyright (c) 2003 Apple Computer, Inc.
     12# Copyright (c) 2003 Apple Inc.
    1313# Copyright (c) 2002 Kevin Van Vechten.
    1414# All rights reserved.
     
    2222#    notice, this list of conditions and the following disclaimer in the
    2323#    documentation and/or other materials provided with the distribution.
    24 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     24# 3. Neither the name of Apple Inc. nor the names of its contributors
    2525#    may be used to endorse or promote products derived from this software
    2626#    without specific prior written permission.
  • branches/gsoc11-statistics/base/portmgr/jobs/mprsyncup

    r68639 r79672  
    2121# Lastly, it is required of every 3rd party mirrors to keep track of this script
    2222# and the base/portmgr/rsync.repos file and always maintain local copies in as
    23 # close sync as possible. 
     23# close sync as possible.
    2424#
    2525#
     
    3939MKDIR="/bin/mkdir"
    4040LN="/bin/ln"
     41TAR="/usr/bin/tar"
     42OPENSSL="/usr/bin/openssl"
    4143
    4244# Paths we'll work on:
     
    5557
    5658# platforms we generate indexes for
    57 PLATFORMS="8_ppc 8_i386 9_ppc 9_i386 10_i386"
     59PLATFORMS="8_powerpc 8_i386 9_powerpc 9_i386 10_i386 11_i386"
    5860# copy new index of this platform to old index location for MP v1.8 compatability
    5961OLD_INDEX_PLATFORM="9_i386"
     
    6365
    6466# Sources information:
    65 SVNURL=http://svn.macports.org/repository/macports
     67SVNURL=https://svn.macports.org/repository/macports
    6668RELEASE_URL_FILE=config/RELEASE_URL
     69
     70# private key to use for signing
     71# XXX set real path
     72PRIVKEY=""
    6773
    6874# cleanup up the working copy if it is locked
     
    98104    ${MKDIR} -p ${RSYNCROOT}/release/base
    99105fi
    100 ${RSYNC} -aIC --delete ${RBASE}/ ${RSYNCROOT}/release/base 
     106${RSYNC} -aIC --delete ${RBASE}/ ${RSYNCROOT}/release/base
    101107
    102108# clean up the working copy if it is locked
     
    107113# Update/checkout the ports tree, export it and rsync it to ${RSYNCROOT}/release/ports:
    108114if [ -d ${PORTS}/.svn ]; then
    109     ${SVN} update ${PORTS} 
     115    ${SVN} update ${PORTS}
    110116else
    111117    ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
     
    116122# build MP trunk in a private location for indexing
    117123pushd ${ROOT}/${TMPDIR} >> /dev/null
    118 mkdir -p ${TCLPKG}
     124${MKDIR} -p ${TCLPKG}
    119125./configure \
    120126    --prefix=${PREFIX} \
    121127    --with-tclpackage=${TCLPKG} \
    122128    --with-install-user=${MP_USER} \
    123     --with-install-group=${MP_GROUP} 
    124 make clean 
     129    --with-install-group=${MP_GROUP}
     130make clean
    125131make
    126 make install 
     132make install
    127133popd
    128134
     
    147153fi
    148154
     155# generate and sign tarballs of base and dports
     156# the signature always needs to match, so we try to make this look atomic to
     157# clients by switching a symlink target
     158
     159TAR_CURDIR=${RSYNCROOT}/release/tarballs_current
     160${MKDIR} -p ${TAR_CURDIR}
     161cp -pR ${TAR_CURDIR} ${RSYNCROOT}/release/tarballs_old
     162${LN} -sfh tarballs_old ${RSYNCROOT}/release/tarballs
     163${TAR} -C ${RSYNCROOT}/release/ -cf ${TAR_CURDIR}/base.tar base
     164${TAR} --exclude 'PortIndex*' -C ${RSYNCROOT}/release/ -cf ${TAR_CURDIR}/ports.tar ports
     165cp -pR ${RSYNCROOT}/release/ports/PortIndex_* ${TAR_CURDIR}
     166# XXX needs PRIVKEY to be set above
     167#${OPENSSL} dgst -ripemd160 -sign ${PRIVKEY} -out ${TAR_CURDIR}/base.tar.rmd160 ${TAR_CURDIR}/base.tar
     168#${OPENSSL} dgst -ripemd160 -sign ${PRIVKEY} -out ${TAR_CURDIR}/ports.tar.rmd160 ${TAR_CURDIR}/ports.tar
     169for index in ${TAR_CURDIR}/PortIndex_*/PortIndex; do
     170    #${OPENSSL} dgst -ripemd160 -sign ${PRIVKEY} -out ${index}.rmd160 ${index}
     171done
     172${LN} -sfh tarballs_current ${RSYNCROOT}/release/tarballs
     173${RM} -rf ${RSYNCROOT}/release/tarballs_old
  • branches/gsoc11-statistics/base/portmgr/jobs/port_binary_distributable.tcl

    r78062 r79672  
    66# Check that binaries of a port are distributable by looking at its license
    77# and the licenses of its dependencies.
     8#
     9# Expected format: A {B C} means the license is A plus either B or C.
    810#
    911# Exit status:
     
    2022
    2123set good_licenses {agpl apache apsl artistic boost bsd cecill cpl curl \
    22                    fontconfig freebsd gfdl gpl ibmpl ijg jasper lgpl libpng \
    23                    mit mpl openssl php psf qpl public-domain ruby sleepycat \
    24                    ssleay x11 zlib zpl}
     24                   fontconfig freebsd freetype gfdl gpl ibmpl ijg jasper \
     25                   lgpl libpng mit mpl openssl php psf qpl public-domain \
     26                   ruby sleepycat ssleay x11 zlib zpl}
    2527foreach lic $good_licenses {
    2628    set license_good($lic) 1
     
    8183    }
    8284
    83     return [list $dependencyList $portInfo(license)]
     85    set ret [list $dependencyList $portInfo(license)]
     86    if {[info exists portInfo(installs_libs)]} {
     87        lappend ret $portInfo(installs_libs)
     88    } else {
     89        # when in doubt, assume code from the dep is incorporated
     90        lappend ret yes
     91    }
     92    return $ret
    8493}
    8594
     
    101110    set top_license_names {}
    102111    # check that top-level port's license(s) are good
    103     foreach full_lic $top_license {
    104         # chop off any trailing version number
    105         set lic [remove_version [string tolower $full_lic]]
    106         # add name to the list for later
    107         lappend top_license_names $lic
    108         if {![info exists license_good($lic)]} {
     112    foreach sublist $top_license {
     113        # each element may be a list of alternatives (i.e. only one need apply)
     114        set any_good 0
     115        set sub_names {}
     116        foreach full_lic $sublist {
     117            # chop off any trailing version number
     118            set lic [remove_version [string tolower $full_lic]]
     119            # add name to the list for later
     120            lappend sub_names $lic
     121            if {[info exists license_good($lic)]} {
     122                set any_good 1
     123            }
     124        }
     125        lappend top_license_names $sub_names
     126        if {!$any_good} {
    109127            if {$verbose} {
    110128                puts "'$portName' has license '$lic' which is not known to be distributable"
     
    113131        }
    114132    }
     133
    115134    # start with deps of top-level port
    116135    set portList [lindex $top_info 0]
    117136    while {[llength $portList] > 0} {
    118137        set aPort [lindex $portList 0]
     138        # mark as seen and remove from the list
     139        set portSeen($aPort) 1
     140        set portList [lreplace $portList 0 0]
     141
    119142        set aPortInfo [infoForPort $aPort $variantInfo]
    120143        set aPortLicense [lindex $aPortInfo 1]
    121         foreach full_lic $aPortLicense {
     144        set installs_libs [lindex $aPortInfo 2]
     145        if {!$installs_libs} {
     146            continue
     147        }
     148        foreach sublist $aPortLicense {
     149            set any_good 0
     150            set any_compatible 0
    122151            # check that this dependency's license(s) are good
    123             set lic [remove_version [string tolower $full_lic]]
    124             if {![info exists license_good($lic)]} {
     152            foreach full_lic $sublist {
     153                set lic [remove_version [string tolower $full_lic]]
     154                if {[info exists license_good($lic)]} {
     155                    set any_good 1
     156                } else {
     157                    # no good being compatible with other licenses if it's not distributable itself
     158                    continue
     159                }
     160
     161                # ... and that they don't conflict with the top-level port's
     162                set any_conflict 0
     163                foreach top_sublist [concat $top_license $top_license_names] {
     164                    set any_sub_compatible 0
     165                    foreach top_lic $top_sublist {
     166                        if {![info exists license_conflicts([string tolower $top_lic])]
     167                            || ([lsearch -sorted $license_conflicts([string tolower $top_lic]) $lic] == -1
     168                            && [lsearch -sorted $license_conflicts([string tolower $top_lic]) [string tolower $full_lic]] == -1)} {
     169                            set any_sub_compatible 1
     170                            break
     171                        }
     172                    }
     173                    if {!$any_sub_compatible} {
     174                        set any_conflict 1
     175                        break
     176                    }
     177                }
     178                if {!$any_conflict} {
     179                    set any_compatible 1
     180                    break
     181                }
     182            }
     183
     184            if {!$any_good} {
    125185                if {$verbose} {
    126186                    puts "dependency '$aPort' has license '$lic' which is not known to be distributable"
     
    128188                return 1
    129189            }
    130             # ... and that they don't conflict with the top-level port's
    131             foreach top_lic [concat $top_license $top_license_names] {
    132                 if {[info exists license_conflicts([string tolower $top_lic])]
    133                     && ([lsearch -sorted $license_conflicts([string tolower $top_lic]) $lic] != -1
    134                     || [lsearch -sorted $license_conflicts([string tolower $top_lic]) [string tolower $full_lic]] != -1)} {
    135                     if {$verbose} {
    136                         puts "dependency '$aPort' has license '$full_lic' which conflicts with license '$top_lic' from '$portName'"
    137                     }
    138                     return 1
    139                 }
    140             }
    141         }
    142 
    143         # mark it seen and add its deps to the list
    144         set portSeen($aPort) 1
    145         set portList [lreplace $portList 0 0]
     190            if {!$any_compatible} {
     191                if {$verbose} {
     192                    puts "dependency '$aPort' has license '$full_lic' which conflicts with license '$top_lic' from '$portName'"
     193                }
     194                return 1
     195            }
     196        }
     197
     198        # add its deps to the list
    146199        foreach possiblyNewPort [lindex $aPortInfo 0] {
    147200            if {![info exists portSeen($possiblyNewPort)]} {
  • branches/gsoc11-statistics/base/portmgr/jobs/portfile_lint.pl

    r75281 r79672  
    1515
    1616my $REPOPATH = "/svn/repositories/macports/";
    17 my $REPOHOST = "http://svn.macosforge.org/repository/macports";
     17my $REPOHOST = "https://svn.macports.org/repository/macports";
    1818my $SVNLOOK = "/opt/local/bin/svnlook";
    1919
     
    9797             From => 'noreply@macports.org',
    9898             Subject => "[$rev] $port Lint Report",
    99              Message => "Change: http://trac.macports.org/changeset/$rev\nPortfile: $port\n\n$errors \n\n",
     99             Message => "Change: https://trac.macports.org/changeset/$rev\nPortfile: $port\n\n$errors \n\n",
    100100             smtp => 'relay.apple.com',
    101101             );
  • branches/gsoc11-statistics/base/portmgr/jobs/portfile_mirror.pl

    r53280 r79672  
    1212
    1313my $REPOPATH = "/svn/repositories/macports/";
    14 my $REPOHOST = "http://svn.macosforge.org/repository/macports";
     14my $REPOHOST = "https://svn.macports.org/repository/macports";
    1515my $SVNLOOK = "/opt/local/bin/svnlook";
    1616my $PORTCMD = "/opt/local/bin/port";
  • branches/gsoc11-statistics/base/portmgr/packaging/dpkgall.tcl

    r78062 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2009-2011 The MacPorts Project
    56# Copyright (c) 2004 Landon Fuller <landonf@macports.org>
    67# Copyright (c) 2003 Kevin Van Vechten <kevin@opendarwin.org>
    7 # Copyright (c) 2002 Apple Computer, Inc.
     8# Copyright (c) 2002 Apple Inc.
    89# All rights reserved.
    910#
     
    1617#    notice, this list of conditions and the following disclaimer in the
    1718#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     19# 3. Neither the name of Apple Inc. nor the names of its contributors
    1920#    may be used to endorse or promote products derived from this software
    2021#    without specific prior written permission.
     
    709710
    710711                        ui_msg "Uninstalling $port."
    711                         if { [catch {registry_uninstall::uninstall $portname $portversion} result] } {
     712                        if { [catch {registry_uninstall::uninstall $portname $portversion "" 0 [array get options]} result] } {
    712713                                global errorInfo
    713714                                ui_debug "$errorInfo"
  • branches/gsoc11-statistics/base/portmgr/packaging/mpkgall.tcl

    r49059 r79672  
    44#
    55# Copyright (c) 2003 Kevin Van Vechten <kevin@opendarwin.org>
    6 # Copyright (c) 2002 Apple Computer, Inc.
     6# Copyright (c) 2002 Apple Inc.
    77# All rights reserved.
    88#
     
    1515#    notice, this list of conditions and the following disclaimer in the
    1616#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1818#    may be used to endorse or promote products derived from this software
    1919#    without specific prior written permission.
  • branches/gsoc11-statistics/base/portmgr/packaging/packageall.tcl

    r78062 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2009-2011 The MacPorts Project
    56# Copyright (c) 2003 Kevin Van Vechten <kevin@opendarwin.org>
    6 # Copyright (c) 2002 Apple Computer, Inc.
     7# Copyright (c) 2002 Apple Inc.
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
  • branches/gsoc11-statistics/base/portmgr/packaging/rpmall.tcl

    r78062 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2009-2011 The MacPorts Project
    56# Copyright (c) 2003 Benjamin Reed <ranger@befunk.com>
    67# Copyright (c) 2003 Kevin Van Vechten <kevin@opendarwin.org>
    7 # Copyright (c) 2002 Apple Computer, Inc.
     8# Copyright (c) 2002 Apple Inc.
    89# All rights reserved.
    910#
     
    1617#    notice, this list of conditions and the following disclaimer in the
    1718#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     19# 3. Neither the name of Apple Inc. nor the names of its contributors
    1920#    may be used to endorse or promote products derived from this software
    2021#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/cregistry/entry.c

    r78229 r79672  
    33 * $Id$
    44 *
     5 * Copyright (c) 2010-2011 The MacPorts Project
    56 * Copyright (c) 2007 Chris Pickel <sfiera@macports.org>
    67 * All rights reserved.
  • branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c

    r74369 r79672  
    11/*
    2  * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
     2 * Copyright (c) 2005 Apple Inc. All rights reserved.
    33 * Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>,
    44 * All rights reserved.
     
    1717 *     notice, this list of conditions and the following disclaimer in the
    1818 *     documentation and/or other materials provided with the distribution.
    19  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
     19 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    2020 *     its contributors may be used to endorse or promote products derived
    2121 *     from this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/images_to_archives.tcl

    r78144 r79672  
    99package require macports 1.0
    1010package require registry 1.0
     11package require registry2 2.0
     12package require Pextlib 1.0
     13
     14umask 022
    1115
    1216mportinit
     
    2428
    2529puts "This could take a while..."
     30
     31# list of ports we successfully create an archive of, to be used to update
     32# the registry only after we know all creation attempts were successful.
     33set archived_list {}
    2634
    2735foreach installed $ilist {
     
    8088            set targetdir [file join ${macports::registry.path} software ${iname}]
    8189            file mkdir $targetdir
    82             if {${macports::registry.format} == "receipt_sqlite"} {
    83                 set contents [$iref imagefiles]
    84             } else {
    85                 set contents {}
    86                 set rawcontents [registry::property_retrieve $iref contents]
    87                 foreach entry $rawcontents {
    88                     lappend contents [lindex $entry 0]
    89                 }
    90             }
     90            set contents [$iref imagefiles]
    9191        }
    9292        set newlocation [file join $targetdir $archivename]
     
    110110        }
    111111
     112        lappend archived_list [list $installtype $iref $location $newlocation]
     113    }
     114}
     115
     116registry::write {
     117    foreach archived $archived_list {
     118        set installtype [lindex $archived 0]
     119        set iref [lindex $archived 1]
     120        set newlocation [lindex $archived 3]
     121   
    112122        if {$installtype == "direct"} {
    113123            # change receipt to image
    114             if {${macports::registry.format} == "receipt_sqlite"} {
    115                 $iref installtype image
    116                 $iref state imaged
    117                 $iref activate [$iref imagefiles]
    118                 $iref state installed
    119             } else {
    120                 registry::property_store $iref installtype image
    121                 foreach entry $contents {
    122                     registry::register_file $entry $iname
    123                 }
    124                 registry::property_store $iref active 1
    125             }
     124            $iref installtype image
     125            $iref state imaged
     126            $iref activate [$iref imagefiles]
     127            $iref state installed
    126128        }
     129   
     130        # set the new location in the registry and delete the old dir
     131        $iref location $newlocation
     132    }
     133}
    127134
    128         if {${macports::registry.format} == "flat" && $installtype == "image"} {
    129             # flat receipts also need file paths in contents trimmed to exclude image dir
    130             set loclen [string length $location]
    131             set locend [expr $loclen - 1]
    132             set oldcontents [registry::property_retrieve $iref contents]
    133             set newcontents {}
    134             foreach fe $contents {
    135                 set oldfilepath [lindex $fe 0]
    136                 if {[string range $oldfilepath 0 $locend] == $location} {
    137                     set newfilepath [string range $oldfilepath $loclen end]
    138                     set newentry [list $newfilepath]
    139                     foreach other [lrange $fe 1 end] {
    140                         lappend newentry $other
    141                     }
    142                     lappend newcontents $newentry
    143                 } else {
    144                     lappend newcontents $fe
    145                 }
    146             }
    147             registry::property_store $iref contents $newcontents
    148         }
    149         # set the new location in the registry and delete the old dir
    150         registry::property_store $iref location $newlocation
    151         if {${macports::registry.format} == "flat"} {
    152             registry::write_entry $iref
    153         }
    154         if {$location != "" && [file isdirectory $location]} {
    155             file delete -force $location
     135foreach archived $archived_list {
     136    set location [lindex $archived 2]
     137    if {$location != "" && [file isdirectory $location]} {
     138        if {[catch {file delete -force $location} result]} {
     139            ui_warn "Failed to delete ${location}: $result"
    156140        }
    157141    }
  • branches/gsoc11-statistics/base/src/macports1.0/Makefile

    r67293 r79672  
    3333
    3434        echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
    35         if test -z "${DESTDIR}" && test "${INSTALLPKGLINK}" != "${INSTALLDIR}" && test -w "${TCL_PACKAGE_DIR}"; then \
    36                 if ! test -L "${INSTALLPKGLINK}" && test -d "${INSTALLPKGLINK}"; then \
    37                         rm -rf "${INSTALLPKGLINK}" || true; \
     35        if test -z "${DESTDIR}" -a "${INSTALLPKGLINK}" != "${INSTALLDIR}"; then \
     36                if test ! -d "${TCL_PACKAGE_DIR}"; then \
     37                        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
    3838                fi; \
    39                 if ! test -e "${INSTALLPKGLINK}"; then \
    40                         ln -s "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
     39                if test -w "${TCL_PACKAGE_DIR}"; then \
     40                        if test ! -L "${INSTALLPKGLINK}" && test -d "${INSTALLPKGLINK}"; then \
     41                                rm -rf "${INSTALLPKGLINK}" || true; \
     42                        fi; \
     43                        if test ! -e "${INSTALLPKGLINK}"; then \
     44                                ln -s "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
     45                        fi; \
    4146                fi; \
    4247        fi
  • branches/gsoc11-statistics/base/src/macports1.0/macports.tcl

    r79662 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 Apple Computer, Inc.
     5# Copyright (c) 2002 - 2003 Apple Inc.
    66# Copyright (c) 2004 - 2005 Paul Guyot, <pguyot@kallisys.net>.
    77# Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb@opendarwin.org>.
    88# Copyright (c) 2004 - 2005 Robert Shaw <rshaw@opendarwin.org>
     9# Copyright (c) 2004 - 2011 The MacPorts Project
    910# All rights reserved.
    1011#
     
    1718#    notice, this list of conditions and the following disclaimer in the
    1819#    documentation and/or other materials provided with the distribution.
    19 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     20# 3. Neither the name of Apple Inc. nor the names of its contributors
    2021#    may be used to endorse or promote products derived from this software
    2122#    without specific prior written permission.
     
    130131    global ::debuglog ::debuglogname
    131132
    132     set portname [_mportkey $mport name]
     133    set portname [_mportkey $mport subport]
    133134    set portpath [_mportkey $mport portpath]
    134135
     
    370371                    set macports::xcodeversion $xcode_v
    371372                } elseif {[regexp "DevToolsCore-(.*);" $xcodebuildversion - devtoolscore_v] == 1} {
    372                     if {$devtoolscore_v >= 921.0} {
     373                    if {$devtoolscore_v >= 1809.0} {
     374                        set macports::xcodeversion "3.2.6"
     375                    } elseif {$devtoolscore_v >= 1204.0} {
     376                        set macports::xcodeversion "3.1.4"
     377                    } elseif {$devtoolscore_v > 921.0} {
     378                        # XXX find actual version corresponding to 3.1
     379                        set macports::xcodeversion "3.1"
     380                    } elseif {$devtoolscore_v >= 921.0} {
    373381                        set macports::xcodeversion "3.0"
    374382                    } elseif {$devtoolscore_v >= 798.0} {
     
    745753    }
    746754    if {![info exists rsync_dir]} {
    747         set macports::rsync_dir release/base/
     755        set macports::rsync_dir release/tarballs/base.tar
    748756        global macports::rsync_dir
    749757    }
     
    981989    }
    982990   
    983     # init registry if needed
    984     if {${registry.format} == "receipt_sqlite"} {
    985         set db_path [file join ${registry.path} registry registry.db]
    986         set db_exists [file exists $db_path]
    987         registry::open $db_path
    988         # for the benefit of the portimage code that is called from multiple interpreters
    989         global registry_open
    990         set registry_open yes
    991         # convert any flat receipts if we just created a new db
    992         if {$db_exists == 0 && [file writable $db_path]} {
    993             ui_warn "Converting your registry to sqlite format, this might take a while..."
    994             if {[catch {registry::convert_to_sqlite}]} {
    995                 ui_debug "$::errorInfo"
    996                 file delete -force $db_path
    997                 error "Failed to convert your registry to sqlite!"
    998             } else {
    999                 ui_warn "Successfully converted your registry to sqlite!"
    1000             }
     991    # init registry
     992    set db_path [file join ${registry.path} registry registry.db]
     993    set db_exists [file exists $db_path]
     994    registry::open $db_path
     995    # for the benefit of the portimage code that is called from multiple interpreters
     996    global registry_open
     997    set registry_open yes
     998    # convert any flat receipts if we just created a new db
     999    if {$db_exists == 0 && [file writable $db_path]} {
     1000        ui_warn "Converting your registry to sqlite format, this might take a while..."
     1001        if {[catch {registry::convert_to_sqlite}]} {
     1002            ui_debug "$::errorInfo"
     1003            file delete -force $db_path
     1004            error "Failed to convert your registry to sqlite!"
     1005        } else {
     1006            ui_warn "Successfully converted your registry to sqlite!"
    10011007        }
    10021008    }
     
    10051011# call this just before you exit
    10061012proc mportshutdown {} {
    1007     global macports::registry.format
    1008     if {${registry.format} == "receipt_sqlite"} {
    1009         # close it down so the cleanup stuff is called, e.g. vacuuming the db
    1010         registry::close
    1011     }
     1013    # close it down so the cleanup stuff is called, e.g. vacuuming the db
     1014    registry::close
    10121015}
    10131016
     
    10821085    $workername alias registry_activate portimage::activate
    10831086    $workername alias registry_deactivate portimage::deactivate
     1087    $workername alias registry_deactivate_composite portimage::deactivate_composite
    10841088    $workername alias registry_uninstall registry_uninstall::uninstall
    10851089    $workername alias registry_register_deps registry::register_dependencies
     
    11651169}
    11661170
    1167 proc macports::fetch_port {url} {
     1171proc macports::get_tar_flags {suffix} {
     1172    switch -- $suffix {
     1173        .tbz -
     1174        .tbz2 {
     1175            return "-j"
     1176        }
     1177        .tgz {
     1178            return "-z"
     1179        }
     1180        .txz {
     1181            return "--use-compress-program [findBinary xz {}] -"
     1182        }
     1183        .tlz {
     1184            return "--use-compress-program [findBinary lzma {}] -"
     1185        }
     1186        default {
     1187            return "-"
     1188        }
     1189    }
     1190}
     1191
     1192proc macports::fetch_port {url {local 0}} {
    11681193    global macports::portdbpath
    11691194    set fetchdir [file join $portdbpath portdirs]
    1170     set fetchfile [file tail $url]
    11711195    file mkdir $fetchdir
    11721196    if {![file writable $fetchdir]} {
    11731197        return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
    11741198    }
    1175     if {[catch {curl fetch $url [file join $fetchdir $fetchfile]} result]} {
    1176         return -code error "Port remote fetch failed: $result"
    1177     }
     1199    if {$local} {
     1200        set fetchfile $url
     1201    } else {
     1202        set fetchfile [file tail $url]
     1203        if {[catch {curl fetch $url [file join $fetchdir $fetchfile]} result]} {
     1204            return -code error "Port remote fetch failed: $result"
     1205        }
     1206    }
     1207    set oldpwd [pwd]
    11781208    cd $fetchdir
    1179     if {[catch {exec [findBinary tar $macports::autoconf::tar_path] -zxf $fetchfile} result]} {
     1209    # check if this is a binary archive or just the port dir
     1210    set tarcmd [findBinary tar $macports::autoconf::tar_path]
     1211    set tarflags [get_tar_flags [file extension $fetchfile]]
     1212    set qflag ${macports::autoconf::tar_q}
     1213    set cmdline "$tarcmd ${tarflags}${qflag}xOf {$fetchfile} +CONTENTS"
     1214    ui_debug "$cmdline"
     1215    set contents [eval exec $cmdline]
     1216    if {![catch {set contents [eval exec $cmdline]}]} {
     1217        set binary 1
     1218        ui_debug "getting port name from binary archive"
     1219        # get the portname from the contents file
     1220        foreach line [split $contents "\n"] {
     1221            if {[lindex $line 0] == "@name"} {
     1222                # actually ${name}-${version}_${revision}
     1223                set portname [lindex $line 1]
     1224            }
     1225        }
     1226        ui_debug "port name is '$portname'"
     1227        file mkdir $portname
     1228        cd $portname
     1229    } else {
     1230        set binary 0
     1231        set portname [file rootname $fetchfile]
     1232    }
     1233
     1234    # extract the portfile (and possibly files dir if not a binary archive)
     1235    ui_debug "extracting port archive to [pwd]"
     1236    if {$binary} {
     1237        set cmdline "$tarcmd ${tarflags}${qflag}xOf {$fetchfile} +PORTFILE > Portfile"
     1238    } else {
     1239        set cmdline "$tarcmd ${tarflags}xf {$fetchfile}"
     1240    }
     1241    ui_debug "$cmdline"
     1242    if {[catch {eval exec $cmdline} result]} {
    11801243        return -code error "Port extract failed: $result"
    11811244    }
    1182     if {[regexp {(.+).tgz} $fetchfile match portdir] != 1} {
    1183         return -code error "Can't decipher portdir from $fetchfile"
    1184     }
    1185     return [file join $fetchdir $portdir]
     1245
     1246    cd $oldpwd
     1247    return [file join $fetchdir $portname]
    11861248}
    11871249
     
    11991261# mports:// sources).
    12001262proc macports::getportdir {url {destdir "."}} {
     1263    global macports::extracted_portdirs
    12011264    set protocol [macports::getprotocol $url]
    12021265    switch ${protocol} {
    12031266        file {
    1204             return [file normalize [string range $url [expr [string length $protocol] + 3] end]]
     1267            set path [file normalize [string range $url [expr [string length $protocol] + 3] end]]
     1268            if {[file isdirectory $path]} {
     1269                return $path
     1270            } else {
     1271                # need to create a local dir for the exracted port, but only once
     1272                if {![info exists macports::extracted_portdirs($url)]} {
     1273                    set macports::extracted_portdirs($url) [macports::fetch_port $path 1]
     1274                }
     1275                return $macports::extracted_portdirs($url)
     1276            }
    12051277        }
    12061278        mports {
     
    12101282        http -
    12111283        ftp {
    1212             return [macports::fetch_port $url]
     1284            if {![info exists macports::extracted_portdirs($url)]} {
     1285                set macports::extracted_portdirs($url) [macports::fetch_port $url 0]
     1286            }
     1287            return $macports::extracted_portdirs($url)
    12131288        }
    12141289        default {
     
    13381413    }
    13391414
    1340     ditem_key $mport provides [$workername eval return \$name]
     1415    ditem_key $mport provides [$workername eval return \$subport]
    13411416
    13421417    return $mport
     
    13461421# opens a portfile stored in the registry
    13471422proc mportopen_installed {name version revision variants options} {
    1348     global macports::registry.format macports::registry.path
    1349     if {${registry.format} != "receipt_sqlite"} {
    1350         return -code error "mportopen_installed requires sqlite registry"
    1351     }
     1423    global macports::registry.path
    13521424    set regref [lindex [registry::entry imaged $name $version $revision $variants] 0]
    13531425    set portfile_dir [file join ${registry.path} registry portfiles $name "${version}_${revision}${variants}"]
     
    13751447proc mportclose_installed {mport} {
    13761448    global macports::registry.path
    1377     foreach key {name version revision portvariants} {
     1449    foreach key {subport version revision portvariants} {
    13781450        set $key [_mportkey $mport $key]
    13791451    }
    13801452    mportclose $mport
    1381     set portfiles_dir [file join ${registry.path} registry portfiles $name]
     1453    set portfiles_dir [file join ${registry.path} registry portfiles $subport]
    13821454    set portfile [file join $portfiles_dir "${version}_${revision}${portvariants}" Portfile]
    13831455    file delete -force $portfile [file dirname $portfile]
     
    14741546    # Check for the presence of the port in the registry
    14751547    set workername [ditem_key $mport workername]
    1476     return [$workername eval registry_exists_for_name \${name}]
     1548    return [$workername eval registry_exists_for_name \${subport}]
    14771549}
    14781550
     
    14801552proc _mportactive {mport} {
    14811553    set workername [ditem_key $mport workername]
    1482     if {![catch {set reslist [$workername eval registry_active \${name}]}] && [llength $reslist] > 0} {
     1554    if {![catch {set reslist [$workername eval registry_active \${subport}]}] && [llength $reslist] > 0} {
    14831555        set i [lindex $reslist 0]
    14841556        set name [lindex $i 0]
     
    15451617    set conflictlist {}
    15461618    if {[llength $conflictinfo] > 0} {
    1547         ui_debug "Checking for conflicts against [_mportkey $mport name]"
     1619        ui_debug "Checking for conflicts against [_mportkey $mport subport]"
    15481620        foreach conflictport ${conflictinfo} {
    15491621            if {[_mportispresent $mport port:${conflictport}]} {
     
    15521624        }
    15531625    } else {
    1554         ui_debug "[_mportkey $mport name] has no conflicts"
     1626        ui_debug "[_mportkey $mport subport] has no conflicts"
    15551627    }
    15561628
     
    15621634
    15631635proc _mportexec {target mport} {
    1564     set portname [_mportkey $mport name]
     1636    set portname [_mportkey $mport subport]
    15651637    macports::push_log $mport
    15661638    # xxx: set the work path?
     
    16051677        return 1
    16061678    }
    1607     set portname [_mportkey $mport name]
     1679    set portname [_mportkey $mport subport]
    16081680    if {$target != "clean"} {
    16091681        macports::push_log $mport
     
    16161688        # see if we actually need to build this port
    16171689        if {($target != "activate" && $target != "install") ||
    1618             ![$workername eval registry_exists \$name \$version \$revision \$portvariants]} {
     1690            ![$workername eval registry_exists \$subport \$version \$revision \$portvariants]} {
    16191691            # possibly warn or error out depending on how old xcode is
    16201692            if {[$workername eval _check_xcode_version] != 0} {
     
    16321704        }
    16331705
    1634         ui_msg -nonewline "--->  Computing dependencies for [_mportkey $mport name]"
     1706        ui_msg -nonewline "--->  Computing dependencies for [_mportkey $mport subport]"
    16351707        if {[macports::ui_isset ports_debug]} {
    16361708            # play nice with debug messages
     
    17471819                        array unset dep_portinfo
    17481820                        array set dep_portinfo [lindex $res 1]
     1821                        if {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
     1822                            set missing {}
     1823                        }
     1824                    }
     1825                    if {[llength $missing] > 0} {
    17491826                        if {[info exists dep_portinfo(variants)] && [lsearch $dep_portinfo(variants) universal] != -1} {
    17501827                            # dep offers a universal variant
     
    17581835                                }
    17591836                                if {[llength $missing] > 0} {
    1760                                     ui_error "Cannot install [_mportkey $mport name] for the arch(s) '$required_archs' because"
     1837                                    ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
    17611838                                    ui_error "its dependency $dep_portname is only installed for the arch '$active_archs'"
    17621839                                    ui_error "and the configured universal_archs '$macports::universal_archs' are not sufficient."
     
    17701847                            } else {
    17711848                                # already universal
    1772                                 ui_error "Cannot install [_mportkey $mport name] for the arch(s) '$required_archs' because"
     1849                                ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
    17731850                                ui_error "its dependency $dep_portname is only installed for the archs '$active_archs'."
    17741851                                return -code error "architecture mismatch"
    17751852                            }
    17761853                        } else {
    1777                             ui_error "Cannot install [_mportkey $mport name] for the arch(s) '$required_archs' because"
     1854                            ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
    17781855                            ui_error "its dependency $dep_portname is only installed for the arch '$active_archs'"
    17791856                            ui_error "and does not have a universal variant."
     
    18281905    upvar $extension myextension
    18291906
    1830     if {[regexp {^(?:https?|ftp)://.+/(.+\.(tar\.gz|tar\.bz2))$} $url -> f e]} {
     1907    if {[regexp {^(?:https?|ftp|rsync)://.+/(.+\.(tar\.gz|tar\.bz2|tar))$} $url -> f e]} {
    18311908        set myfilename $f
    18321909        set myextension $e
     
    18721949    global macports::sources macports::portdbpath macports::rsync_options tcl_platform
    18731950    global macports::portverbose
    1874     global macports::autoconf::rsync_path
     1951    global macports::autoconf::rsync_path macports::autoconf::tar_path macports::autoconf::openssl_path
    18751952    array set options $optionslist
    18761953
     
    19242001                set indexfile [macports::getindex $source]
    19252002                set destdir [file dirname $indexfile]
     2003                set is_tarball [_source_is_snapshot $source]
    19262004                file mkdir $destdir
    1927                 # Keep rsync happy with a trailing slash
    1928                 if {[string index $source end] != "/"} {
    1929                     append source "/"
    1930                 }
    1931                 # don't sync PortIndex yet; we grab the platform specific one afterwards
    1932                 set exclude_option "'--exclude=/PortIndex*'"
     2005
     2006                if {$is_tarball} {
     2007                    set exclude_option ""
     2008                    # need to do a few things before replacing the ports tree in this case
     2009                    set destdir [file dirname $destdir]
     2010                } else {
     2011                    # Keep rsync happy with a trailing slash
     2012                    if {[string index $source end] != "/"} {
     2013                        append source "/"
     2014                    }
     2015                    # don't sync PortIndex yet; we grab the platform specific one afterwards
     2016                    set exclude_option "'--exclude=/PortIndex*'"
     2017                }
    19332018                # Do rsync fetch
    19342019                set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${exclude_option} ${source} ${destdir}"
     
    19392024                    continue
    19402025                }
     2026
     2027                if {$is_tarball} {
     2028                    # verify signature for tarball
     2029                    global macports::archivefetch_pubkeys
     2030                    set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${exclude_option} ${source}.rmd160 ${destdir}"
     2031                    ui_debug $rsync_commandline
     2032                    if {[catch {system $rsync_commandline}]} {
     2033                        ui_error "Synchronization of the ports tree signature failed doing rsync"
     2034                        incr numfailed
     2035                        continue
     2036                    }
     2037                    set tarball "${destdir}/[file tail $source]"
     2038                    set signature "${tarball}.rmd160"
     2039                    set openssl [macports::findBinary openssl $macports::autoconf::openssl_path]
     2040                    set verified 0
     2041                    foreach pubkey ${macports::archivefetch_pubkeys} {
     2042                        if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature $tarball} result]} {
     2043                            set verified 1
     2044                            ui_debug "successful verification with key $pubkey"
     2045                            break
     2046                        } else {
     2047                            ui_debug "failed verification with key $pubkey"
     2048                            ui_debug "openssl output: $result"
     2049                        }
     2050                    }
     2051                    if {!$verified} {
     2052                        ui_error "Failed to verify signature for ports tree!"
     2053                        incr numfailed
     2054                        continue
     2055                    }
     2056
     2057                    # extract tarball and move into place
     2058                    set tar [macports::findBinary tar $macports::autoconf::tar_path]
     2059                    file mkdir ${destdir}/tmp
     2060                    set tar_cmd "$tar -C ${destdir}/tmp -xf ${tarball}"
     2061                    ui_debug $tar_cmd
     2062                    if {[catch {system $tar_cmd}]} {
     2063                        ui_error "Failed to extract ports tree from tarball!"
     2064                        incr numfailed
     2065                        continue
     2066                    }
     2067                    # save the local PortIndex data
     2068                    if {[file isfile $indexfile]} {
     2069                        file copy -force $indexfile ${destdir}/
     2070                        file rename -force $indexfile ${destdir}/tmp/ports/
     2071                        if {[file isfile ${indexfile}.quick]} {
     2072                            file rename -force ${indexfile}.quick ${destdir}/tmp/ports/
     2073                        }
     2074                    }
     2075                    file delete -force ${destdir}/ports
     2076                    file rename ${destdir}/tmp/ports ${destdir}/ports
     2077                    file delete -force ${destdir}/tmp
     2078                }
     2079
    19412080                # now sync the index if the local file is missing or older than a day
    19422081                if {![file isfile $indexfile] || [expr [clock seconds] - [file mtime $indexfile]] > 86400} {
    1943                     set remote_indexfile "${source}PortIndex_${macports::os_platform}_${macports::os_major}_${macports::os_arch}/PortIndex"
     2082                    if {$is_tarball} {
     2083                        # chop ports.tar off the end
     2084                        set index_source [string range $source 0 end-[string length [file tail $source]]]
     2085                    } else {
     2086                        set index_source $source
     2087                    }
     2088                    set remote_indexfile "${index_source}PortIndex_${macports::os_platform}_${macports::os_major}_${macports::os_arch}/PortIndex"
    19442089                    set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} $remote_indexfile ${destdir}"
    19452090                    ui_debug $rsync_commandline
     
    19472092                        ui_debug "Synchronization of the PortIndex failed doing rsync"
    19482093                    } else {
    1949                         mports_generate_quickindex $indexfile
     2094                        set ok 1
     2095                        if {$is_tarball} {
     2096                            set ok 0
     2097                            # verify signature for PortIndex
     2098                            set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${remote_indexfile}.rmd160 ${destdir}"
     2099                            ui_debug $rsync_commandline
     2100                            if {![catch {system $rsync_commandline}]} {
     2101                                foreach pubkey ${macports::archivefetch_pubkeys} {
     2102                                    if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature ${destdir}/PortIndex.rmd160 ${destdir}/PortIndex} result]} {
     2103                                        set ok 1
     2104                                        ui_debug "successful verification with key $pubkey"
     2105                                        break
     2106                                    } else {
     2107                                        ui_debug "failed verification with key $pubkey"
     2108                                        ui_debug "openssl output: $result"
     2109                                    }
     2110                                }
     2111                                if {$ok} {
     2112                                    # move PortIndex into place
     2113                                    file rename -force ${destdir}/PortIndex ${destdir}/ports/
     2114                                }
     2115                            }
     2116                        }
     2117                        if {$ok} {
     2118                            mports_generate_quickindex $indexfile
     2119                        }
    19502120                    }
    19512121                }
     
    25332703                    ui_error "Dependency '$dep_portname' not found."
    25342704                    return 1
     2705                } elseif {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
     2706                    set check_archs 0
    25352707                }
    25362708                lappend options subport $dep_portname
     
    25692741                }
    25702742                if {$arch_mismatch} {
    2571                     macports::_explain_arch_mismatch [_mportkey $mport name] $dep_portname $required_archs $supported_archs $has_universal
     2743                    macports::_explain_arch_mismatch [_mportkey $mport subport] $dep_portname $required_archs $supported_archs $has_universal
    25722744                    return -code error "architecture mismatch"
    25732745                }
     
    27372909        activate    -
    27382910        ""          {
    2739             if {[$workername eval registry_exists \$name \$version \$revision \$portvariants]
     2911            if {[$workername eval registry_exists \$subport \$version \$revision \$portvariants]
    27402912                || [$workername eval _archive_available]} {
    27412913                return "depends_lib depends_run"
     
    27522924    global macports::prefix macports::portdbpath macports::libpath macports::rsync_server macports::rsync_dir macports::rsync_options
    27532925    global macports::autoconf::macports_version macports::autoconf::rsync_path tcl_platform
     2926    global macports::autoconf::openssl_path macports::autoconf::tar_path
    27542927    array set options $optionslist
    27552928   
     
    27682941    }
    27692942
     2943    # are we syncing a tarball? (implies detached signature)
     2944    set is_tarball 0
     2945    if {[string range ${rsync_dir} end-3 end] == ".tar"} {
     2946        set is_tarball 1
     2947        set mp_source_path [file join $portdbpath sources ${rsync_server} [file dirname ${rsync_dir}]]
     2948    } else {
     2949        if {[string index $rsync_dir end] != "/"} {
     2950            append rsync_dir "/"
     2951        }
     2952        set mp_source_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}]
     2953    }
    27702954    # create the path to the to be downloaded sources if it doesn't exist
    2771     set mp_source_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}/]
    27722955    if {![file exists $mp_source_path]} {
    27732956        file mkdir $mp_source_path
     
    27792962    if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir} $mp_source_path" } result ] } {
    27802963       return -code error "Error synchronizing MacPorts sources: $result"
     2964    }
     2965
     2966    if {$is_tarball} {
     2967        # verify signature for tarball
     2968        global macports::archivefetch_pubkeys
     2969        if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir}.rmd160 $mp_source_path" } result ] } {
     2970            return -code error "Error synchronizing MacPorts source signature: $result"
     2971        }
     2972        set openssl [findBinary openssl $macports::autoconf::openssl_path]
     2973        set tarball "${mp_source_path}/[file tail $rsync_dir]"
     2974        set signature "${tarball}.rmd160"
     2975        set verified 0
     2976        foreach pubkey ${macports::archivefetch_pubkeys} {
     2977            if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature $tarball} result]} {
     2978                set verified 1
     2979                ui_debug "successful verification with key $pubkey"
     2980                break
     2981            } else {
     2982                ui_debug "failed verification with key $pubkey"
     2983                ui_debug "openssl output: $result"
     2984            }
     2985        }
     2986        if {!$verified} {
     2987            return -code error "Failed to verify signature for MacPorts source!"
     2988        }
     2989       
     2990        # extract tarball and move into place
     2991        set tar [macports::findBinary tar $macports::autoconf::tar_path]
     2992        file mkdir ${mp_source_path}/tmp
     2993        set tar_cmd "$tar -C ${mp_source_path}/tmp -xf ${tarball}"
     2994        ui_debug $tar_cmd
     2995        if {[catch {system $tar_cmd}]} {
     2996            return -code error "Failed to extract MacPorts sources from tarball!"
     2997        }
     2998        file delete -force ${mp_source_path}/base
     2999        file rename ${mp_source_path}/tmp/base ${mp_source_path}/base
     3000        file delete -force ${mp_source_path}/tmp
     3001        # set the final extracted source path
     3002        set mp_source_path ${mp_source_path}/base
    27813003    }
    27823004
     
    28393061            } else {
    28403062                ui_warn "Disabling readline support due to readline in /usr/local"
     3063            }
     3064
     3065            if {$prefix == "/usr/local"} {
     3066                append configure_args " --with-unsupported-prefix"
    28413067            }
    28423068
     
    32513477    }
    32523478
    3253     global macports::registry.format
    32543479    # are we installing an existing version due to force or epoch override?
    32553480    if {[registry::entry_exists $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]
     
    32633488        if {$is_dryrun eq "yes"} {
    32643489            ui_msg "Skipping uninstall $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
    3265         } elseif {!(${registry.format} == "receipt_sqlite" && [registry::run_target $newregref uninstall [array get options]])
    3266                   && [catch {registry_uninstall::uninstall $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) [array get options]} result]} {
     3490        } elseif {![registry::run_target $newregref uninstall [array get options]]
     3491                  && [catch {registry_uninstall::uninstall $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) [array get options]} result]} {
    32673492            global errorInfo
    32683493            ui_debug "$errorInfo"
     
    32873512            ui_msg "Skipping deactivate $portname @${version_active}_${revision_active}${variant_active} (dry run)"
    32883513        } elseif {![catch {registry::active $portname}] &&
    3289                   !(${registry.format} == "receipt_sqlite" && [registry::run_target $regref deactivate [array get options]])
    3290                   && [catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} [array get options]} result]} {
     3514                  ![registry::run_target $regref deactivate [array get options]]
     3515                  && [catch {portimage::deactivate $portname $version_active $revision_active $variant_active [array get options]} result]} {
    32913516            global errorInfo
    32923517            ui_debug "$errorInfo"
     
    33633588            if {$is_dryrun eq "yes"} {
    33643589                ui_msg "Skipping uninstall $portname @${version}_${revision}${variant} (dry run)"
    3365             } elseif {!(${registry.format} == "receipt_sqlite" && [registry::run_target $regref uninstall $optionslist])
    3366                       && [catch {registry_uninstall::uninstall $portname ${version}_${revision}${variant} $optionslist} result]} {
     3590            } elseif {![registry::run_target $regref uninstall $optionslist]
     3591                      && [catch {registry_uninstall::uninstall $portname $version $revision $variant $optionslist} result]} {
    33673592                global errorInfo
    33683593                ui_debug "$errorInfo"
  • branches/gsoc11-statistics/base/src/macports1.0/macports_autoconf.tcl.in

    r77511 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2006 - 2009, 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
     
    4142    variable macportsuser "@RUNUSR@"
    4243    variable open_path "@OPEN@"
     44    variable openssl_path "@OPENSSL@"
    4345    variable pax_path "@PAX@"
    4446    variable rsync_path "@RSYNC@"
    4547    variable tar_command "@TAR_CMD@"
    4648    variable tar_path "@TAR@"
     49    variable tar_q "@TAR_Q@"
    4750    variable unzip_path "@UNZIP@"
    4851    variable xar_path "@XAR@"
  • branches/gsoc11-statistics/base/src/macports1.0/macports_dlist.tcl

    r78396 r79672  
    22# $Id$
    33#
     4# Copyright (c) 2004-2005, 2007, 2009, 2011 The MacPorts Project
    45# Copyright (c) 2003 Kevin Van Vechten <kevin@opendarwin.org>
    5 # Copyright (c) 2002 Apple Computer, Inc.
     6# Copyright (c) 2002 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/macports1.0/macports_fastload.tcl.in

    r66607 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2004 Paul Guyot, The MacPorts Project.
     5# Copyright (c) 2005-2007, 2009-2010 The MacPorts Project
     6# Copyright (c) 2004-2005 Paul Guyot, The MacPorts Project.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of The MacPorts Project nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/macports1.0/macports_index.tcl

    r26177 r79672  
    22# $Id$
    33#
    4 # Copyright (c) 2004 Apple Computer, Inc.
     4# Copyright (c) 2004 Apple Inc.
    55# All rights reserved.
    66#
     
    1313#    notice, this list of conditions and the following disclaimer in the
    1414#    documentation and/or other materials provided with the distribution.
    15 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     15# 3. Neither the name of Apple Inc. nor the names of its contributors
    1616#    may be used to endorse or promote products derived from this software
    1717#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/macports1.0/macports_util.tcl

    r26177 r79672  
    1313#    notice, this list of conditions and the following disclaimer in the
    1414#    documentation and/or other materials provided with the distribution.
    15 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     15# 3. Neither the name of The MacPorts Project nor the names of its contributors
    1616#    may be used to endorse or promote products derived from this software
    1717#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/macports1.0/tests/macports_dlist.tcl

    r26721 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2007 The MacPorts Project
    56# Copyright (c) 2003 Kevin Van Vechten <kevin@opendarwin.org>
    67
     
    7172
    7273# Replicate Shantonu's Bug #354 to test dlist functionality.
    73 # http://trac.macports.org/projects/macports/ticket/354
     74# https://trac.macports.org/ticket/354
    7475# A depends on B, C.
    7576# B depends on C.
  • branches/gsoc11-statistics/base/src/package1.0/package.tcl

    r77511 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 Apple Computer, Inc.
     5# Copyright (c) 2004, 2007-2008, 2010 The MacPorts Project
     6# Copyright (c) 2002-2004 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portarchivefetch.tcl

    r78062 r79672  
    33#
    44# Copyright (c) 2002 - 2003 Apple Inc.
    5 # Copyright (c) 2004-2010 The MacPorts Project
     5# Copyright (c) 2004 - 2011 The MacPorts Project
    66# All rights reserved.
    77#
     
    6060default archivefetch.pubkeys {$archivefetch_pubkeys}
    6161
    62 default archive_sites macports_archives
     62default archive_sites {[portarchivefetch::filter_sites]}
    6363default archive_sites.listfile {"archive_sites.tcl"}
    6464default archive_sites.listpath {"port1.0/fetch"}
    6565default archive.subdir {${subport}}
     66
     67proc portarchivefetch::filter_sites {} {
     68    global prefix porturl
     69    set ret {}
     70    foreach site [array names portfetch::mirror_sites::archive_prefix] {
     71        if {$portfetch::mirror_sites::archive_prefix($site) == $prefix} {
     72            lappend ret $site
     73        }
     74    }
     75    if {[file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]]} {
     76        lappend ret [string range $porturl 0 end-[string length [file tail $porturl]]]
     77    }
     78    return $ret
     79}
    6680
    6781set_ui_prefix
     
    205219                    return -code error "Failed to fetch signature for archive: $result"
    206220                }
     221                set openssl [findBinary openssl $portutil::autoconf::openssl_path]
    207222                set verified 0
    208223                foreach pubkey [option archivefetch.pubkeys] {
    209                     set openssl [findBinary openssl $portutil::autoconf::openssl_path]
    210224                    if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature "${incoming_path}/${archive}.TMP"} result]} {
    211225                        set verified 1
     
    247261# Initialize archivefetch target and call checkfiles.
    248262proc portarchivefetch::archivefetch_init {args} {
     263    global porturl portarchivetype
     264    # installing straight from a binary archive
     265    if {[file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]] && [file extension $porturl] != ""} {
     266        set portarchivetype [string range [file extension $porturl] 1 end]
     267    }
    249268    return 0
    250269}
  • branches/gsoc11-statistics/base/src/package1.0/portdmg.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2003 Apple Computer, Inc.
     5# Copyright (c) 2007, 2009-2011  The MacPorts Project
     6# Copyright (c) 2003, 2005 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portdpkg.tcl

    r78062 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2005, 2007, 2009, 2011 The MacPorts Project
    56# Copyright (c) 2004 Landon Fuller <landonf@macports.org>
    6 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     7# Copyright (c) 2002 - 2003 Apple Inc.
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portmdmg.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2003 Apple Computer, Inc.
     5# Copyright (c) 2005, 2007-2011 The MacPorts Project
     6# Copyright (c) 2003-2004 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portmpkg.tcl

    r78390 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2005, 2007 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2004 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portpkg.tcl

    r78178 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2005, 2007 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portportpkg.tcl

    r53280 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2004 Apple Computer, Inc.
     5# Copyright (c) 2002 - 2004 Apple Inc.
    66# All rights reserved.
    77#
     
    1414#    notice, this list of conditions and the following disclaimer in the
    1515#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16# 3. Neither the name of Apple Inc. nor the names of its contributors
    1717#    may be used to endorse or promote products derived from this software
    1818#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portrpm.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2005 - 2007, 2009 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portsrpm.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2007, 2009, 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/package1.0/portunarchive.tcl

    r78660 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2005, 2007-2011 The MacPorts Project
    56# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
    6 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     7# Copyright (c) 2002 - 2003 Apple Inc.
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
     
    6263
    6364proc portunarchive::unarchive_init {args} {
    64     global target_state_fd unarchive.skip \
     65    global target_state_fd unarchive.skip destroot \
    6566           ports_force ports_source_only ports_binary_only \
    6667           subport version revision portvariants \
     
    7475        ui_debug "Skipping unarchive ($subport) since source-only is set"
    7576        set skipped 1
    76     } elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
     77    } elseif {[check_statefile target org.macports.destroot $target_state_fd]
     78              && [file isdirectory $destroot]} {
    7779        ui_debug "Skipping unarchive ($subport) since destroot completed"
    7880        set skipped 1
  • branches/gsoc11-statistics/base/src/pextlib1.0/Pextlib.c

    r74010 r79672  
    33 * $Id$
    44 *
    5  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5 * Copyright (c) 2002 - 2003 Apple Inc.
    66 * Copyright (c) 2004 - 2005 Paul Guyot <pguyot@kallisys.net>
    77 * Copyright (c) 2004 Landon Fuller <landonf@macports.org>
     
    1616 *    notice, this list of conditions and the following disclaimer in the
    1717 *    documentation and/or other materials provided with the distribution.
    18  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1919 *    may be used to endorse or promote products derived from this software
    2020 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/base32cmd.c

    r74007 r79672  
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/base32cmd.h

    r74001 r79672  
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.c

    r65785 r79672  
    66 * Author: Jordan K. Hubbard, Kevin Ballard, Rainer Mueller
    77 *
    8  * Copyright (c) 2004 Apple Computer, Inc.
     8 * Copyright (c) 2004 Apple Inc.
    99 * Copyright (c) 2010 The MacPorts Project
    1010 * All rights reserved.
     
    1818 *    notice, this list of conditions and the following disclaimer in the
    1919 *    documentation and/or other materials provided with the distribution.
    20  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     20 * 3. Neither the name of Apple Inc. nor the names of its contributors
    2121 *    may be used to endorse or promote products derived from this software
    2222 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.h

    r24112 r79672  
    33 * $Id$
    44 *
    5  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5 * Copyright (c) 2002 - 2003 Apple Inc.
    66 * All rights reserved.
    77 *
     
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/md5cmd.c

    r77865 r79672  
    33 * $Id$
    44 *
    5  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5 * Copyright (c) 2004 - 2005, 2009, 2011 The MacPorts Project
     6 * Copyright (c) 2002 - 2003 Apple Inc.
    67 * All rights reserved.
    78 *
     
    1415 *    notice, this list of conditions and the following disclaimer in the
    1516 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1718 *    may be used to endorse or promote products derived from this software
    1819 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/md5cmd.h

    r19376 r79672  
    33 * $Id$
    44 *
    5  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5 * Copyright (c) 2002 - 2003 Apple Inc.
    66 * All rights reserved.
    77 *
     
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/md_wrappers.h

    r53201 r79672  
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/rmd160cmd.c

    r77865 r79672  
    33 * $Id$
    44 *
     5 * Copyright (c) 2006, 2009-2011 The MacPorts Project
    56 * Copyright (c) 2005 Paul Guyot <pguyot@kallisys.net>.
    67 * All rights reserved.
     
    1415 *    notice, this list of conditions and the following disclaimer in the
    1516 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1718 *    may be used to endorse or promote products derived from this software
    1819 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/rmd160cmd.h

    r26177 r79672  
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha1cmd.c

    r77865 r79672  
    44 * Copied from md5cmd.c 20040903 EH
    55 *
    6  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     6 * Copyright (c) 2004 - 2005, 2009 - 2011 The MacPorts Project
     7 * Copyright (c) 2002 - 2003 Apple Inc.
    78 * All rights reserved.
    89 *
     
    1516 *    notice, this list of conditions and the following disclaimer in the
    1617 *    documentation and/or other materials provided with the distribution.
    17  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1819 *    may be used to endorse or promote products derived from this software
    1920 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha1cmd.h

    r19376 r79672  
    44 * Copied from md5cmd.h 20040903 EH
    55 *
    6  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     6 * Copyright (c) 2002 - 2003 Apple Inc.
    77 * All rights reserved.
    88 *
     
    1515 *    notice, this list of conditions and the following disclaimer in the
    1616 *    documentation and/or other materials provided with the distribution.
    17  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1818 *    may be used to endorse or promote products derived from this software
    1919 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha2.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha2.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha256cmd.c

    r77865 r79672  
    33 * $Id$
    44 *
    5  * Copyright (c) 2009 The MacPorts Project
     5 * Copyright (c) 2009, 2011 The MacPorts Project
    66 * All rights reserved.
    77 *
     
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha256cmd.h

    r60372 r79672  
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16 * 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717 *    may be used to endorse or promote products derived from this software
    1818 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/tty.c

    r61670 r79672  
    66 * Author: Rainer Mueller <raimue@macports.org>
    77 *
     8 * Copyright (c) 2009 The MacPorts Project
    89 * Copyright (c) 2008 Rainer Mueller <raimue@macports.org>
    910 * All rights reserved.
     
    1718 *    notice, this list of conditions and the following disclaimer in the
    1819 *    documentation and/or other materials provided with the distribution.
    19  * 3. Neither the name of Apple Computer, Inc. nor the names of its
     20 * 3. Neither the name of The MacPorts Project nor the names of its
    2021 *    contributors may be used to endorse or promote products derived from
    2122 *    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/tty.h

    r51280 r79672  
    1717 *    notice, this list of conditions and the following disclaimer in the
    1818 *    documentation and/or other materials provided with the distribution.
    19  * 3. Neither the name of Apple Computer, Inc. nor the names of its
     19 * 3. Neither the name of The MacPorts Project nor the names of its
    2020 *    contributors may be used to endorse or promote products derived from
    2121 *    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.c

    r51280 r79672  
    66 * Author: Landon Fuller <landonf@macports.org>
    77 *
    8  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     8 * Copyright (c) 2002 - 2003 Apple Inc.
    99 * Copyright (c) 2004 Landon Fuller <landonf@macports.org>
    1010 * All rights reserved.
     
    1818 *    notice, this list of conditions and the following disclaimer in the
    1919 *    documentation and/or other materials provided with the distribution.
    20  * 3. Neither the name of Apple Computer, Inc. nor the names of its
     20 * 3. Neither the name of Apple Inc. nor the names of its
    2121 *    contributors may be used to endorse or promote products derived from
    2222 *    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.h

    r26177 r79672  
    44 * Author: Landon Fuller <landonf@macports.org>
    55 *
    6  * Copyright (c) 2002 - 2003 Apple Computer, Inc.
     6 * Copyright (c) 2002 - 2003 Apple Inc.
    77 * Copyright (c) 2004 Landon Fuller
    88 * All rights reserved.
     
    1616 *    notice, this list of conditions and the following disclaimer in the
    1717 *    documentation and/or other materials provided with the distribution.
    18  * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18 * 3. Neither the name of Apple Inc. nor the names of its contributors
    1919 *    may be used to endorse or promote products derived from this software
    2020 *    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/pkg_mkindex.sh.in

    r77867 r79672  
    1313#    notice, this list of conditions and the following disclaimer in the
    1414#    documentation and/or other materials provided with the distribution.
    15 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     15# 3. Neither the name of The MacPorts Project nor the names of its contributors
    1616#    may be used to endorse or promote products derived from this software
    1717#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port/Makefile

    r71035 r79672  
    2323
    2424mkdirs:
    25         <../../doc/prefix.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
     25        < ../../doc/prefix.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
     26        < ../../doc/base.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
    2627
    2728clean:
  • branches/gsoc11-statistics/base/src/port/port-help.tcl

    r78937 r79672  
    278278
    279279One example is the set of python ports, where there are (among others)
    280 python25, python26, and python30.  The select action lets you set which
     280python25, python26, and python31.  The select action lets you set which
    281281of these becomes the version run when you simply use 'python'.
    282282
     
    292292set porthelp(selfupdate) {
    293293Upgrade MacPorts itself and run the sync target
     294}
     295
     296set porthelp(space) {
     297Show the disk space used by the given ports
     298
     299--units <units> Specify units to use. Accepted units are: B, kB, KiB, MB, MiB,
     300                GB, GiB. The 'B' may be omitted.
    294301}
    295302
  • branches/gsoc11-statistics/base/src/port/port.tcl

    r79663 r79672  
    66# $Id$
    77#
    8 # Copyright (c) 2002-2007 The MacPorts Project.
     8# Copyright (c) 2004-2011 The MacPorts Project
    99# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
    10 # Copyright (c) 2002 Apple Computer, Inc.
     10# Copyright (c) 2002-2003 Apple Inc.
    1111# All rights reserved.
    1212#
     
    1919#    notice, this list of conditions and the following disclaimer in the
    2020#    documentation and/or other materials provided with the distribution.
    21 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     21# 3. Neither the name of Apple Inc. nor the names of its contributors
    2222#    may be used to endorse or promote products derived from this software
    2323#    without specific prior written permission.
     
    8888Pseudo-portnames are words that may be used in place of a portname, and
    8989which expand to some set of ports. The common pseudo-portnames are:
    90 all, current, active, inactive, installed, uninstalled, outdated, obsolete,
    91 requested, unrequested and leaves.
     90all, current, active, inactive, actinact, installed, uninstalled, outdated,
     91obsolete, requested, unrequested and leaves.
    9292These pseudo-portnames expand to the set of ports named.
    9393
     
    155155
    156156
     157# Format an integer representing bytes using given units
     158proc bytesize {siz {unit {}}} {
     159    if {$unit == {}} {
     160        if {$siz > 0x40000000} {
     161            set unit "GiB"
     162        } elseif {$siz > 0x100000} {
     163            set unit "MiB"
     164        } elseif {$siz > 0x400} {
     165            set unit "KiB"
     166        } else {
     167            set unit "B"
     168        }
     169    }
     170    switch -- $unit {
     171        KiB {
     172            set siz [expr $siz / 1024.0]
     173        }
     174        kB {
     175            set siz [expr $siz / 1000.0]
     176        }
     177        MiB {
     178            set siz [expr $siz / 1048576.0]
     179        }
     180        MB {
     181            set siz [expr $siz / 1000000.0]
     182        }
     183        GiB {
     184            set siz [expr $siz / 1073741824.0]
     185        }
     186        GB {
     187            set siz [expr $siz / 1000000000.0]
     188        }
     189        B { }
     190        default {
     191            ui_warn "Unknown file size unit '$unit' specified"
     192            set unit "B"
     193        }
     194    }
     195    if {[expr round($siz)] != $siz} {
     196        set siz [format {%.3f} $siz]
     197    }
     198    return "$siz $unit"
     199}
     200
     201proc filesize {fil {unit {}}} {
     202    set siz {@}
     203    catch {
     204        set siz [bytesize [file size $fil] $unit]
     205    }
     206    return $siz
     207}
    157208
    158209# Produce an error message, and exit, unless
     
    714765}
    715766
     767proc get_actinact_ports {} {
     768    set inactive_ports [get_inactive_ports]
     769    set active_ports [get_active_ports]
     770    set results {}
     771
     772    foreach port $inactive_ports {
     773        array set portspec $port
     774        set portname $portspec(name)
     775        lappend inact($portname) $port
     776    }
     777
     778    foreach port $active_ports {
     779        array set portspec $port
     780        set portname $portspec(name)
     781
     782        if {[info exists inact($portname)]} {
     783            if {![info exists added_inact($portname)]} {
     784                foreach inact_spec $inact($portname) {
     785                    lappend results $inact_spec
     786                }
     787                set added_inact($portname) 1
     788            }
     789            lappend results $port
     790        }
     791    }
     792    return $results
     793}
     794
    716795
    717796proc get_outdated_ports {} {
     
    11641243        ^active(@.*)?$      -
    11651244        ^inactive(@.*)?$    -
     1245        ^actinact(@.*)?$    -
    11661246        ^leaves(@.*)?$      -
    11671247        ^outdated(@.*)?$    -
     
    22182298
    22192299proc action_activate { action portlist opts } {
    2220     global macports::registry.format
    22212300    set status 0
    22222301    if {[require_portlist portlist] || [prefix_unwritable]} {
     
    22252304    foreachport $portlist {
    22262305        set composite_version [composite_version $portversion [array get variations]]
    2227         if {${macports::registry.format} == "receipt_sqlite"
    2228             && ![info exists options(ports_activate_no-exec)]
     2306        if {![info exists options(ports_activate_no-exec)]
    22292307            && ![catch {set ilist [registry::installed $portname $composite_version]}]
    22302308            && [llength $ilist] == 1} {
     
    22372315        }
    22382316        if {![macports::global_option_isset ports_dryrun]} {
    2239             if { [catch {portimage::activate $portname $composite_version [array get options]} result] } {
     2317            if { [catch {portimage::activate_composite $portname $composite_version [array get options]} result] } {
    22402318                global errorInfo
    22412319                ui_debug "$errorInfo"
     
    22522330
    22532331proc action_deactivate { action portlist opts } {
    2254     global macports::registry.format
    22552332    set status 0
    22562333    if {[require_portlist portlist] || [prefix_unwritable]} {
     
    22592336    foreachport $portlist {
    22602337        set composite_version [composite_version $portversion [array get variations]]
    2261         if {${macports::registry.format} == "receipt_sqlite"
    2262             && ![info exists options(ports_deactivate_no-exec)]
     2338        if {![info exists options(ports_deactivate_no-exec)]
    22632339            && ![catch {set ilist [registry::active $portname]}]} {
    22642340
     
    22752351        }
    22762352        if {![macports::global_option_isset ports_dryrun]} {
    2277             if { [catch {portimage::deactivate $portname $composite_version [array get options]} result] } {
     2353            if { [catch {portimage::deactivate_composite $portname $composite_version [array get options]} result] } {
    22782354                global errorInfo
    22792355                ui_debug "$errorInfo"
     
    24132489
    24142490proc action_setrequested { action portlist opts } {
    2415     global macports::registry.format
    24162491    set status 0
    24172492    if {[require_portlist portlist] || [prefix_unwritable]} {
     
    24272502                set regref [registry::open_entry $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
    24282503                registry::property_store $regref requested $val
    2429                 if {${macports::registry.format} != "receipt_sqlite"} {
    2430                     registry::write_entry $regref
    2431                 }
    24322504            }
    24332505        } else {
     
    26562728           
    26572729            set json [json_encode_stats ${macports::stats_id} os ports]
    2658             curl post "data=$json" ${macports::stats_url} 
     2730            curl post "submit\[data\]=$json" ${macports::stats_url} 
    26592731        }
    26602732        default {
     
    29973069
    29983070proc action_uninstall { action portlist opts } {
    2999     global macports::registry.format
    30003071    set status 0
    30013072    if {[macports::global_option_isset port_uninstall_old]} {
     
    30193090        }
    30203091        set composite_version [composite_version $portversion [array get variations]]
    3021         if {${macports::registry.format} == "receipt_sqlite"
    3022             && ![info exists options(ports_uninstall_no-exec)]
     3092        if {![info exists options(ports_uninstall_no-exec)]
    30233093            && ![catch {set ilist [registry::installed $portname $composite_version]}]
    30243094            && [llength $ilist] == 1} {
     
    30323102        }
    30333103
    3034         if { [catch {registry_uninstall::uninstall $portname $composite_version [array get options]} result] } {
     3104        if { [catch {registry_uninstall::uninstall_composite $portname $composite_version [array get options]} result] } {
    30353105            global errorInfo
    30363106            ui_debug "$errorInfo"
     
    32563326
    32573327proc action_contents { action portlist opts } {
    3258     set status 0
     3328    global global_options
    32593329    if {[require_portlist portlist]} {
    32603330        return 1
    32613331    }
     3332    if {[info exists global_options(ports_contents_size)]} {
     3333        set units {}
     3334        if {[info exists global_options(ports_contents_units)]} {
     3335            set units [complete_size_units $global_options(ports_contents_units)]
     3336        }
     3337        set outstring {[format "%12s $file" [filesize $file $units]]}
     3338    } else {
     3339        set outstring {  $file}
     3340    }
     3341
    32623342    foreachport $portlist {
    32633343        if { ![catch {set ilist [registry::installed $portname]} result] } {
     
    32703350                ui_notice "Port $portname contains:"
    32713351                foreach file $files {
    3272                     puts "  $file"
     3352                    puts [subst $outstring]
    32733353                }
    32743354            } else {
     
    32813361    registry::close_file_map
    32823362
    3283     return $status
     3363    return 0
     3364}
     3365
     3366# expand abbreviations of size units
     3367proc complete_size_units {units} {
     3368    if {$units == "K" || $units == "Ki"} {
     3369        return "KiB"
     3370    } elseif {$units == "k"} {
     3371        return "kB"
     3372    } elseif {$units == "Mi"} {
     3373        return "MiB"
     3374    } elseif {$units == "M"} {
     3375        return "MB"
     3376    } elseif {$units == "Gi"} {
     3377        return "GiB"
     3378    } elseif {$units == "G"} {
     3379        return "GB"
     3380    } else {
     3381        return $units
     3382    }
     3383}
     3384
     3385# Show space used by the given ports' files
     3386proc action_space {action portlist opts} {
     3387    global global_options
     3388    require_portlist portlist
     3389
     3390    set units {}
     3391    if {[info exists global_options(ports_space_units)]} {
     3392        set units [complete_size_units $global_options(ports_space_units)]
     3393    }
     3394    set spaceall 0.0
     3395    foreachport $portlist {
     3396        set space 0.0
     3397        set files [registry::port_registered $portname]
     3398        if { $files != 0 } {
     3399            if { [llength $files] > 0 } {
     3400                foreach file $files {
     3401                    catch {
     3402                        set space [expr $space + [file size $file] ]
     3403                    }
     3404                }
     3405                set msg "[bytesize $space $units] $portname"
     3406                if { $portversion != {} } {
     3407                    append msg " @$portversion"
     3408                }
     3409                puts $msg
     3410                set spaceall [expr $space + $spaceall]
     3411            } else {
     3412                puts "Port $portname does not contain any file or is not active."
     3413            }
     3414        } else {
     3415            puts "Port $portname is not installed."
     3416        }
     3417    }
     3418    if {[llength $portlist] > 1} {
     3419        puts "[bytesize $spaceall $units] total"
     3420    }
     3421    return 0
    32843422}
    32853423
     
    39774115    outdated    [list action_outdated       [ACTION_ARGS_PORTS]] \
    39784116    contents    [list action_contents       [ACTION_ARGS_PORTS]] \
     4117    space       [list action_space          [ACTION_ARGS_PORTS]] \
    39794118    dependents  [list action_dependents     [ACTION_ARGS_PORTS]] \
    39804119    rdependents [list action_dependents     [ACTION_ARGS_PORTS]] \
     
    40324171]
    40334172
     4173# Expand "action".
     4174# Returns an action proc, or a list of matching action procs, or the action passed in
     4175proc find_action { action } {
     4176    global action_array
     4177   
     4178    if { ! [info exists action_array($action)] } {
     4179        set guess [guess_action $action]
     4180        if { [info exists action_array($guess)] } {
     4181            return $guess
     4182        }
     4183        return $guess
     4184    }
     4185   
     4186    return $action
     4187}
     4188
     4189# Expand action
     4190# If there's more than one match, return the next possibility
    40344191proc find_action_proc { action } {
     4192    global action_array
     4193   
     4194    set action_proc ""
     4195    if { [info exists action_array($action)] } {
     4196        set action_proc [lindex $action_array($action) 0]
     4197    } else {
     4198        set action [complete_action $action]
     4199        if { [info exists action_array($action)] } {
     4200            set action_proc [lindex $action_array($action) 0]
     4201        }
     4202    }
     4203   
     4204    return $action_proc
     4205}
     4206
     4207proc get_action_proc { action } {
    40354208    global action_array
    40364209   
     
    40754248                 maintainer maintainers name platform platforms portdir pretty
    40764249                 replaced_by revision variant variants version}
     4250    contents    {size {units 1}}
    40774251    deps        {index no-build}
    40784252    rdeps       {index no-build full}
     
    40844258                 platforms portdir regex revision variant variants version}
    40854259    selfupdate  {nosync}
     4260    space       {{units 1}}
    40864261    activate    {no-exec}
    40874262    deactivate  {no-exec}
     
    43194494       
    43204495        # Find an action to execute
    4321         set action_proc [find_action_proc $action]
    4322         if { $action_proc == "" } {
    4323             puts "Unrecognized action \"$action\""
     4496        set actions [find_action $action]
     4497        if {[llength $actions] == 1} {
     4498            set action [lindex $actions 0]
     4499            set action_proc [get_action_proc $action]
     4500        } else {
     4501            if {[llength $actions] > 1} {
     4502                puts "Ambiguous action \"$action\": could be any of {$actions}."
     4503            } else {
     4504                puts "Unrecognized action \"$action\""
     4505            }
    43244506            set action_status 1
    43254507            break
     
    44114593
    44124594
     4595# return text action beginning with $text
    44134596proc complete_action { text state } {   
    44144597    global action_array
     
    44264609}
    44274610
     4611# return all actions beginning with $text
     4612proc guess_action { text } {   
     4613    global action_array
     4614
     4615    return [array names action_array "[string tolower $text]*"]
     4616
     4617    if { [llength $complete_choices ] == 1 } {
     4618        return [lindex $complete_choices 0]
     4619    }
     4620
     4621    return {}
     4622}
    44284623
    44294624proc attempt_completion { text word start end } {
  • branches/gsoc11-statistics/base/src/port/portindex.tcl

    r78062 r79672  
    260260             depends_lib depends_run description epoch homepage \
    261261             long_description maintainers name platforms revision variants \
    262              version portdir portarchive replaced_by license} {
     262             version portdir portarchive replaced_by license installs_libs} {
    263263    set keepkeys($key) 1
    264264}
  • branches/gsoc11-statistics/base/src/port1.0/fetch_common.tcl

    r69471 r79672  
    33#
    44# Copyright (c) 2002 - 2003 Apple Inc.
    5 # Copyright (c) 2004-2010 The MacPorts Project
     5# Copyright (c) 2004 - 2011 The MacPorts Project
    66# All rights reserved.
    77#
     
    242242
    243243        foreach site $urllist {
     244            if {[string range $site 0 6] == "file://"} {
     245                set pingtimes(localhost) 0
     246                continue
     247            }
     248           
    244249            regexp $hostregex $site -> host
    245 
     250           
    246251            if { [info exists seen($host)] } {
    247252                continue
     
    285290        set pinglist {}
    286291        foreach site $urllist {
    287             regexp $hostregex $site -> host
     292            if {[string range $site 0 6] == "file://"} {
     293                set host localhost
     294            } else {
     295                regexp $hostregex $site -> host
     296            }
    288297            lappend pinglist [ list $site $pingtimes($host) ]
    289298        }
  • branches/gsoc11-statistics/base/src/port1.0/port.tcl

    r64638 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 Apple Computer, Inc.
     5# Copyright (c) 2002 Apple Inc.
    66# All rights reserved.
    77#
     
    1414#    notice, this list of conditions and the following disclaimer in the
    1515#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16# 3. Neither the name of Apple Inc. nor the names of its contributors
    1717#    may be used to endorse or promote products derived from this software
    1818#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/port_autoconf.tcl.in

    r77749 r79672  
    22# $Id$
    33#
    4 # Copyright (c) 2002 - 2004 Apple Computer, Inc.
     4# Copyright (c) 2005 - 2011 The MacPorts Project
     5# Copyright (c) 2002 - 2004 Apple Inc.
    56# All rights reserved.
    67#
     
    1314#    notice, this list of conditions and the following disclaimer in the
    1415#    documentation and/or other materials provided with the distribution.
    15 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16# 3. Neither the name of Apple Inc. nor the names of its contributors
    1617#    may be used to endorse or promote products derived from this software
    1718#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portactivate.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2005, 2007, 2009-2011 The MacPorts Project
    66# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
     7# Copyright (c) 2002 - 2003 Apple Inc.
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
     
    6162    global env subport version revision portvariants user_options PortInfo
    6263
    63     registry_activate $subport "${version}_${revision}${portvariants}" [array get user_options]
     64    registry_activate $subport $version $revision $portvariants [array get user_options]
    6465
    6566    # Display notes at the end of the activation phase.
  • branches/gsoc11-statistics/base/src/port1.0/portbuild.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2007 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2004 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portchecksum.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2004 Apple Computer, Inc.
     5# Copyright (c) 2002 - 2004 Apple Inc.
    66# Copyright (c) 2004 - 2005 Paul Guyot <pguyot@kallisys.net>
     7# Copyright (c) 2006-2011 The MacPorts Project
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
     
    5960
    6061# types to recommend if none are specified in the portfile
    61 set default_checksum_types {sha1 rmd160}
     62set default_checksum_types {rmd160 sha256}
    6263
    6364# Using global all_dist_files, parse the checksums and store them into the
     
    311312            ui_notice "The non-matching file appears to be HTML. See this page for possible reasons"
    312313            ui_notice "for the checksum mismatch:"
    313             ui_notice "<http://trac.macports.org/wiki/MisbehavingServers>"
     314            ui_notice "<https://trac.macports.org/wiki/MisbehavingServers>"
    314315            ui_notice "***"
    315316        }
  • branches/gsoc11-statistics/base/src/port1.0/portclean.tcl

    r78179 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2005-2007, 2009-2011 The MacPorts Project
    56# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
    6 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     7# Copyright (c) 2002 - 2003 Apple Inc.
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
     
    5152
    5253proc portclean::clean_start {args} {
    53     global UI_PREFIX
     54    global UI_PREFIX prefix
    5455
    5556    ui_notice "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option subport]]"
     57
     58    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
     59        elevateToRoot "clean"
     60    }
    5661}
    5762
  • branches/gsoc11-statistics/base/src/port1.0/portconfigure.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2007 - 2011 The MacPorts Project
    66# Copyright (c) 2007 Markus W. Weissmann <mww@macports.org>
     7# Copyright (c) 2002 - 2003 Apple Inc.
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portdeactivate.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2010 The MacPorts Project
     5# Copyright (c) 2010-2011 The MacPorts Project
    66# All rights reserved.
    77#
     
    5959proc portdeactivate::deactivate_main {args} {
    6060    global subport version revision portvariants user_options
    61     registry_deactivate $subport "${version}_${revision}${portvariants}" [array get user_options]
     61    registry_deactivate $subport $version $revision $portvariants [array get user_options]
    6262    return 0
    6363}
  • branches/gsoc11-statistics/base/src/port1.0/portdepends.tcl

    r51780 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2005, 2007-2009 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portdestroot.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2002 - 2003 Apple Inc.
    66# Copyright (c) 2004 - 2005 Robert Shaw <rshaw@opendarwin.org>
     7# Copyright (c) 2004-2005, 2007-2011 The MacPorts Project
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portdistcheck.tcl

    r78062 r79672  
    44# $Id$
    55#
     6# Copyright (c) 2007-2011 The MacPorts Project
    67# Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>,
    78# All rights reserved.
     
    1617#    notice, this list of conditions and the following disclaimer in the
    1718#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its
     19# 3. Neither the name of The MacPorts Project nor the names of its
    1920#    contributors may be used to endorse or promote products derived from
    2021#    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portdistfiles.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2008 MacPorts Project
     5# Copyright (c) 2008-2011 The MacPorts Project
    66# All rights reserved.
    77#
     
    1414#    notice, this list of conditions and the following disclaimer in the
    1515#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     16# 3. Neither the name of The MacPorts Project nor the names of its contributors
    1717#    may be used to endorse or promote products derived from this software
    1818#    without specific prior written permission.
     
    5454
    5555proc portdistfiles::distfiles_main {args} {
    56     global UI_PREFIX master_sites checksums_array portdbpath dist_subdir
     56    global UI_PREFIX master_sites checksums_array portdbpath dist_subdir all_dist_files
    5757   
    5858    # give up on ports that do not provide URLs
     
    6464    set fetch_urls {}
    6565    portfetch::checkfiles fetch_urls
     66
     67    # also give up on ports that don't have any distfiles
     68    if {![info exists all_dist_files]} {
     69        return 0
     70    }
    6671
    6772    # get checksum data from the portfile and parse it
  • branches/gsoc11-statistics/base/src/port1.0/portextract.tcl

    r78660 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2005, 2007-2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# Copyright (c) 2007 Markus W. Weissmann <mww@macports.org>
    78# All rights reserved.
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portfetch.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2004 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portinstall.tcl

    r78660 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2002 - 2004 Apple Inc.
    66# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
     7# Copyright (c) 2005, 2007 - 2011 The MacPorts Project
    78# All rights reserved.
    89#
     
    1516#    notice, this list of conditions and the following disclaimer in the
    1617#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     18# 3. Neither the name of Apple Inc. nor the names of its contributors
    1819#    may be used to endorse or promote products derived from this software
    1920#    without specific prior written permission.
     
    5556proc portinstall::install_start {args} {
    5657    global UI_PREFIX subport version revision portvariants
    57     global prefix registry_open registry.format registry.path
     58    global prefix registry_open registry.path
    5859    ui_notice "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $subport $version $revision $portvariants]"
    5960   
     
    6768    # end gsoc08-privileges
    6869   
    69     if {${registry.format} == "receipt_sqlite" && ![info exists registry_open]} {
     70    if {![info exists registry_open]} {
    7071        registry::open [file join ${registry.path} registry registry.db]
    7172        set registry_open yes
     
    484485    worksrcdir UI_PREFIX destroot revision maintainers user_options \
    485486    portvariants negated_variants targets depends_lib PortInfo epoch license \
    486     registry.format os.platform os.major portarchivetype installPlist
     487    os.platform os.major portarchivetype installPlist
    487488
    488489    set oldpwd [pwd]
     
    504505    }
    505506
    506     if {[string equal ${registry.format} "receipt_sqlite"]} {
    507         # registry2.0
    508 
    509         # can't do this inside the write transaction due to deadlock issues with _get_dep_port
    510         set dep_portnames [list]
    511         foreach deplist {depends_lib depends_run} {
    512             if {[info exists $deplist]} {
    513                 foreach dep [set $deplist] {
    514                     set dep_portname [_get_dep_port $dep]
    515                     if {$dep_portname != ""} {
    516                         lappend dep_portnames $dep_portname
    517                     }
     507    # can't do this inside the write transaction due to deadlock issues with _get_dep_port
     508    set dep_portnames [list]
     509    foreach deplist {depends_lib depends_run} {
     510        if {[info exists $deplist]} {
     511            foreach dep [set $deplist] {
     512                set dep_portname [_get_dep_port $dep]
     513                if {$dep_portname != ""} {
     514                    lappend dep_portnames $dep_portname
    518515                }
    519516            }
    520517        }
    521 
    522         registry::write {
    523 
    524             set regref [registry::entry create $subport $version $revision $portvariants $epoch]
    525 
    526             if {[info exists user_options(ports_requested)]} {
    527                 $regref requested $user_options(ports_requested)
    528             } else {
    529                 $regref requested 0
    530             }
    531             $regref os_platform ${os.platform}
    532             $regref os_major ${os.major}
    533             $regref archs [get_canonical_archs]
    534             # Trick to have a portable GMT-POSIX epoch-based time.
    535             $regref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
    536             if {[info exists negated_variants]} {
    537                 $regref negated_variants $negated_variants
    538             }
    539 
    540             foreach dep_portname $dep_portnames {
    541                 $regref depends $dep_portname
    542             }
    543 
    544             $regref installtype image
    545             $regref state imaged
    546             $regref location $location
    547 
    548             if {[info exists installPlist]} {
    549                 # register files
    550                 $regref map $installPlist
    551             }
    552            
    553             # store portfile
    554             set fd [open [file join ${portpath} Portfile]]
    555             $regref portfile [read $fd]
    556             close $fd
    557         }
    558     } else {
    559         # Begin the registry entry
    560         set regref [registry_new $subport $version $revision $portvariants $epoch]
     518    }
     519
     520    registry::write {
     521
     522        set regref [registry::entry create $subport $version $revision $portvariants $epoch]
     523
     524        if {[info exists user_options(ports_requested)]} {
     525            $regref requested $user_options(ports_requested)
     526        } else {
     527            $regref requested 0
     528        }
     529        $regref os_platform ${os.platform}
     530        $regref os_major ${os.major}
     531        $regref archs [get_canonical_archs]
     532        # Trick to have a portable GMT-POSIX epoch-based time.
     533        $regref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
    561534        if {[info exists negated_variants]} {
    562             registry_prop_store $regref negated_variants $negated_variants
    563         }
    564 
    565         registry_prop_store $regref location $location
    566 
    567         if {[info exists user_options(ports_requested)]} {
    568             registry_prop_store $regref requested $user_options(ports_requested)
    569         } else {
    570             registry_prop_store $regref requested 0
    571         }
    572         registry_prop_store $regref categories $categories
    573 
    574         registry_prop_store $regref os_platform ${os.platform}
    575         registry_prop_store $regref os_major ${os.major}
    576         registry_prop_store $regref archs [get_canonical_archs]
    577 
    578         if {[info exists description]} {
    579             registry_prop_store $regref description [string map {\n \\n} ${description}]
    580         }
    581         if {[info exists long_description]} {
    582             registry_prop_store $regref long_description [string map {\n \\n} ${long_description}]
    583         }
    584         if {[info exists license]} {
    585             registry_prop_store $regref license ${license}
    586         }
    587         if {[info exists homepage]} {
    588             registry_prop_store $regref homepage ${homepage}
    589         }
    590         if {[info exists maintainers]} {
    591             registry_prop_store $regref maintainers ${maintainers}
    592         }
    593         if {[info exists depends_run]} {
    594             registry_prop_store $regref depends_run $depends_run
    595             registry_register_deps $depends_run $subport
    596         }
    597         if {[info exists depends_lib]} {
    598             registry_prop_store $regref depends_lib $depends_lib
    599             registry_register_deps $depends_lib $subport
    600         }
     535            $regref negated_variants $negated_variants
     536        }
     537
     538        foreach dep_portname $dep_portnames {
     539            $regref depends $dep_portname
     540        }
     541
     542        $regref installtype image
     543        $regref state imaged
     544        $regref location $location
     545
    601546        if {[info exists installPlist]} {
    602             registry_prop_store $regref contents [_fake_fileinfo_for_index $installPlist]
    603         }
    604         if {[info exists package-install]} {
    605             registry_prop_store $regref package-install ${package-install}
    606         }
    607         if {[info proc pkg_uninstall] == "pkg_uninstall"} {
    608             registry_prop_store $regref pkg_uninstall [proc_disasm pkg_uninstall]
    609         }
    610 
    611         registry_write $regref
     547            # register files
     548            $regref map $installPlist
     549        }
     550       
     551        # store portfile
     552        set fd [open [file join ${portpath} Portfile]]
     553        $regref portfile [read $fd]
     554        close $fd
    612555    }
    613556
  • branches/gsoc11-statistics/base/src/port1.0/portlivecheck.tcl

    r78071 r79672  
    44# $Id$
    55#
    6 # Copyright (c) 2005-2006 Paul Guyot <pguyot@kallisys.net>,
     6# Copyright (c) 2007-2011 The MacPorts Project
     7# Copyright (c) 2005-2007 Paul Guyot <pguyot@kallisys.net>,
    78# All rights reserved.
    89#
     
    1617#    notice, this list of conditions and the following disclaimer in the
    1718#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its
     19# 3. Neither the name of The MacPorts Project nor the names of its
    1920#    contributors may be used to endorse or promote products derived from
    2021#    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portload.tcl

    r75534 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2007 MacPorts Project
     5# Copyright (c) 2007, 2009, 2011 The MacPorts Project
    66# Copyright (c) 2007 James D. Berry
    77# All rights reserved.
     
    1515#    notice, this list of conditions and the following disclaimer in the
    1616#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of The MacPorts Project nor the names of its contributors
    1818#    may be used to endorse or promote products derived from this software
    1919#    without specific prior written permission.
     
    3737set org.macports.load [target_new org.macports.load portload::load_main]
    3838target_runtype ${org.macports.load} always
     39target_state ${org.macports.load} no
    3940target_provides ${org.macports.load} load
    4041target_requires ${org.macports.load} main
  • branches/gsoc11-statistics/base/src/port1.0/portmain.tcl

    r78660 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2004 - 2005, 2007 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
     
    5253        platforms default_variants install.user install.group \
    5354        macosx_deployment_target universal_variant os.universal_supported \
    54         supported_archs depends_skip_archcheck \
     55        supported_archs depends_skip_archcheck installs_libs \
    5556        copy_log_files \
    5657        compiler.cpath compiler.library_path \
     
    6566
    6667# Export options via PortInfo
    67 options_export name version revision epoch categories maintainers platforms description long_description notes homepage license provides conflicts replaced_by
     68options_export name version revision epoch categories maintainers platforms description long_description notes homepage license provides conflicts replaced_by installs_libs
    6869
    6970default subport {[portmain::get_default_subport]}
  • branches/gsoc11-statistics/base/src/port1.0/portmirror.tcl

    r78062 r79672  
    44# $Id$
    55#
     6# Copyright (c) 2007-2011 The MacPorts Project
    67# Copyright (c) 2006 Paul Guyot <pguyot@kallisys.net>,
    78# All rights reserved.
     
    1617#    notice, this list of conditions and the following disclaimer in the
    1718#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its
     19# 3. Neither the name of The MacPorts Project nor the names of its
    1920#    contributors may be used to endorse or promote products derived from
    2021#    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portpatch.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
     5# Copyright (c) 2004, 2006-2007, 2009-2011 The MacPorts Project
     6# Copyright (c) 2002 - 2003 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portstartupitem.tcl

    r78062 r79672  
    44# $Id$
    55#
    6 # Copyright (c) 2004-2007 MacPorts Project
     6# Copyright (c) 2004-2011 The MacPorts Project
    77# Copyright (c) 2006-2007 James D. Berry
    88# Copyright (c) 2004,2005 Markus W. Weissman <mww@macports.org>
     
    1818#    notice, this list of conditions and the following disclaimer in the
    1919#    documentation and/or other materials provided with the distribution.
    20 # 3. Neither the name of Apple Computer, Inc. nor the names of its
     20# 3. Neither the name of The MacPorts Project nor the names of its
    2121#    contributors may be used to endorse or promote products derived from
    2222#    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portsubmit.tcl

    r78174 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2002 - 2004 Apple Computer, Inc.
     5# Copyright (c) 2007 - 2011 The MacPorts Project
     6# Copyright (c) 2002 - 2004 Apple Inc.
    67# All rights reserved.
    78#
     
    1415#    notice, this list of conditions and the following disclaimer in the
    1516#    documentation and/or other materials provided with the distribution.
    16 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of Apple Inc. nor the names of its contributors
    1718#    may be used to endorse or promote products derived from this software
    1819#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/porttrace.tcl

    r70001 r79672  
    1616#    notice, this list of conditions and the following disclaimer in the
    1717#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its
     18# 3. Neither the name of The MacPorts Project nor the names of its
    1919#    contributors may be used to endorse or promote products derived from
    2020#    this software without specific prior written permission.
  • branches/gsoc11-statistics/base/src/port1.0/portuninstall.tcl

    r78062 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2010 The MacPorts Project
     5# Copyright (c) 2010-2011 The MacPorts Project
    66# All rights reserved.
    77#
     
    5151proc portuninstall::uninstall_start {args} {
    5252    global prefix
    53     if { ![file writable $prefix] } {
     53    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
    5454        # if install location is not writable, need root privileges
    5555        elevateToRoot "uninstall"
     
    5959proc portuninstall::uninstall_main {args} {
    6060    global subport version revision portvariants user_options
    61     registry_uninstall $subport "${version}_${revision}${portvariants}" [array get user_options]
     61    registry_uninstall $subport $version $revision $portvariants [array get user_options]
    6262    return 0
    6363}
  • branches/gsoc11-statistics/base/src/port1.0/portunload.tcl

    r75534 r79672  
    33# $Id$
    44#
    5 # Copyright (c) 2007 MacPorts Project
     5# Copyright (c) 2007, 2009, 2011 The MacPorts Project
    66# Copyright (c) 2007 James D. Berry
    77# All rights reserved.
     
    1515#    notice, this list of conditions and the following disclaimer in the
    1616#    documentation and/or other materials provided with the distribution.
    17 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     17# 3. Neither the name of The MacPorts Project nor the names of its contributors
    1818#    may be used to endorse or promote products derived from this software
    1919#    without specific prior written permission.
     
    3737set org.macports.unload [target_new org.macports.unload portunload::unload_main]
    3838target_runtype ${org.macports.unload} always
     39target_state ${org.macports.unload} no
    3940target_provides ${org.macports.unload} unload
    4041target_requires ${org.macports.unload} main
  • branches/gsoc11-statistics/base/src/port1.0/portutil.tcl

    r78660 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2002-2003 Apple Inc.
    56# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
    6 # Copyright (c) 2002 Apple Computer, Inc.
    7 # Copyright (c) 2006, 2007 Markus W. Weissmann <mww@macports.org>
     7# Copyright (c) 2006-2007 Markus W. Weissmann <mww@macports.org>
     8# Copyright (c) 2004-2011 The MacPorts Project
    89# All rights reserved.
    910#
     
    1617#    notice, this list of conditions and the following disclaimer in the
    1718#    documentation and/or other materials provided with the distribution.
    18 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     19# 3. Neither the name of Apple Inc. nor the names of its contributors
    1920#    may be used to endorse or promote products derived from this software
    2021#    without specific prior written permission.
     
    12741275            # otherwise execute the task.
    12751276            if {$skipped == 0} {
    1276                 set target [ditem_key $ditem provides]
     1277                # change current phase shown in log
     1278                set_phase $target
    12771279
    12781280                # Execute pre-run procedure
     
    12801282                    set result [catch {[ditem_key $ditem prerun] $targetname} errstr]
    12811283                }
    1282                 set_phase  $target
     1284
    12831285                #start tracelib
    12841286                if {($result ==0
     
    15771579            return -code error "$statefile is not writable - check permission on port directory"
    15781580        }
    1579         if {[file mtime ${portpath}/Portfile] >= [clock seconds]} {
     1581        if {[file mtime ${portpath}/Portfile] > [clock seconds]} {
    15801582            return -code error "Portfile is from the future - check date and time of your system"
    15811583        }
     
    26722674                set min 3.2
    26732675                set ok 3.2
    2674                 set rec 3.2.4
     2676                set rec 3.2.6
    26752677            }
    26762678        }
     
    26902692proc _archive_available {} {
    26912693    global subport version revision portvariants ports_source_only workpath \
    2692            registry.path os.platform os.major
     2694           registry.path os.platform os.major porturl
    26932695
    26942696    if {[tbool ports_source_only]} {
     
    27042706        }
    27052707    }
    2706    
    2707     # TODO: also check if porturl points to an archive
    2708     # maybe check if there's an archive available on the server too - this
    2709     # is kind of useless otherwise now that archive == installed image
     2708
     2709    if {!$found && [file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]] && [file extension $porturl] != ""} {
     2710        set found 1
     2711    }
     2712
     2713    # TODO: maybe check if there's an archive available on the server - this
     2714    # is much less useful otherwise now that archive == installed image
    27102715
    27112716    return $found
  • branches/gsoc11-statistics/base/src/portindex/portregister.pl

    r19376 r79672  
    11#!/usr/bin/perl -w
    22#
    3 # Copyright (c) 2003-2004 Apple Computer, Inc.
     3# Copyright (c) 2003-2004 Apple Inc.
    44# All rights reserved.
    55#
     
    1212#    notice, this list of conditions and the following disclaimer in the
    1313#    documentation and/or other materials provided with the distribution.
    14 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     14# 3. Neither the name of Apple Inc. nor the names of its contributors
    1515#    may be used to endorse or promote products derived from this software
    1616#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/portindex/portsubmit.pl

    r19376 r79672  
    11#!/usr/bin/perl -w
    22#
    3 # Copyright (c) 2003-2004 Apple Computer, Inc.
     3# Copyright (c) 2003-2004 Apple Inc.
    44# All rights reserved.
    55#
     
    1212#    notice, this list of conditions and the following disclaimer in the
    1313#    documentation and/or other materials provided with the distribution.
    14 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
     14# 3. Neither the name of Apple Inc. nor the names of its contributors
    1515#    may be used to endorse or promote products derived from this software
    1616#    without specific prior written permission.
  • branches/gsoc11-statistics/base/src/registry2.0/portimage.tcl

    r78180 r79672  
    33# $Id$
    44#
     5# Copyright (c) 2004-2005, 2007-2011 The MacPorts Project
    56# Copyright (c) 2004 Will Barton <wbb4@opendarwin.org>
    67# Copyright (c) 2002 Apple Inc.
     
    6263
    6364variable force 0
    64 variable use_reg2 0
    6565variable noexec 0
    6666
     67# takes a composite version spec rather than separate version,revision,variants
     68proc activate_composite {name {v ""} {optionslist ""}} {
     69    if {$v == ""} {
     70        return [activate $name "" "" 0 $optionslist]
     71    } elseif {[registry::decode_spec $v version revision variants]} {
     72        return [activate $name $version $revision $variants $optionslist]
     73    }
     74    throw registry::invalid "Registry error: Invalid version '$v' specified for ${name}. Please specify a version as recorded in the port registry."
     75}
     76
    6777# Activate a "Port Image"
    68 proc activate {name v optionslist} {
    69     global macports::prefix macports::registry.format macports::registry.path registry_open UI_PREFIX
     78proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} {
     79    global macports::prefix macports::registry.path registry_open UI_PREFIX
    7080    array set options $optionslist
    7181    variable force
    72     variable use_reg2
    7382    variable noexec
    7483
     
    7988        set noexec $options(ports_activate_no-exec)
    8089    }
    81     if {[string equal ${macports::registry.format} "receipt_sqlite"]} {
    82         set use_reg2 1
    83         if {![info exists registry_open]} {
    84             registry::open [file join ${macports::registry.path} registry registry.db]
    85             set registry_open yes
    86         }
     90    if {![info exists registry_open]} {
     91        registry::open [file join ${macports::registry.path} registry registry.db]
     92        set registry_open yes
    8793    }
    8894    set todeactivate [list]
    8995
    90     if {$use_reg2} {
    91         registry::read {
    92 
    93             set requested [_check_registry $name $v]
    94             # set name again since the one we were passed may not have had the correct case
    95             set name [$requested name]
    96             set version [$requested version]
    97             set revision [$requested revision]
    98             set variants [$requested variants]
    99             set specifier "${version}_${revision}${variants}"
    100             set location [$requested location]
    101 
    102             # if another version of this port is active, deactivate it first
    103             set current [registry::entry installed $name]
    104             foreach i $current {
    105                 if { ![string equal $specifier "[$i version]_[$i revision][$i variants]"] } {
    106                     lappend todeactivate $i
    107                 }
    108             }
    109 
    110             # this shouldn't be possible
    111             if { ![string equal [$requested installtype] "image"] } {
    112                 return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
    113             }
    114             if {![file isfile $location]} {
    115                 return -code error "Image error: Can't find image file $location"
    116             }
    117             if { [string equal [$requested state] "installed"] } {
    118                 return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
    119             }
    120         }
    121         foreach a $todeactivate {
    122             if {$noexec || ![registry::run_target $a deactivate [list ports_nodepcheck 1]]} {
    123                 deactivate $name "[$a version]_[$a revision][$a variants]" [list ports_nodepcheck 1]
    124             }
    125         }
    126     } else {
    127         # registry1.0
    128         set ilist [_check_registry $name $v]
     96    registry::read {
     97
     98        set requested [_check_registry $name $version $revision $variants]
    12999        # set name again since the one we were passed may not have had the correct case
    130         set name [lindex $ilist 0]
    131         set version [lindex $ilist 1]
    132         set revision [lindex $ilist 2]
    133         set variants [lindex $ilist 3]
     100        set name [$requested name]
     101        set version [$requested version]
     102        set revision [$requested revision]
     103        set variants [$requested variants]
     104        set specifier "${version}_${revision}${variants}"
     105        set location [$requested location]
    134106
    135107        # if another version of this port is active, deactivate it first
    136         set ilist [registry::installed $name]
    137         if { [llength $ilist] > 1 } {
    138             foreach i $ilist {
    139                 set iversion [lindex $i 1]
    140                 set irevision [lindex $i 2]
    141                 set ivariants [lindex $i 3]
    142                 set iactive [lindex $i 4]
    143                 if { ![string equal "${iversion}_${irevision}${ivariants}" "${version}_${revision}${variants}"] && $iactive == 1 } {
    144                     lappend todeactivate "${iversion}_${irevision}${ivariants}"
    145                 }
    146             }
    147         }
    148 
    149         set ref [registry::open_entry $name $version $revision $variants]
    150 
    151         if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
    152             return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
    153         }
    154         set location [registry::property_retrieve $ref location]
     108        set current [registry::entry installed $name]
     109        foreach i $current {
     110            if { ![string equal $specifier "[$i version]_[$i revision][$i variants]"] } {
     111                lappend todeactivate $i
     112            }
     113        }
     114
     115        # this shouldn't be possible
     116        if { ![string equal [$requested installtype] "image"] } {
     117            return -code error "Image error: ${name} @${specifier} not installed as an image."
     118        }
    155119        if {![file isfile $location]} {
    156120            return -code error "Image error: Can't find image file $location"
    157121        }
    158         if { [registry::property_retrieve $ref active] != 0 } {
    159             return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
    160         }
    161 
    162         foreach a $todeactivate {
    163             deactivate $name $a [list ports_nodepcheck 1]
    164         }
    165     }
    166 
    167     if {$v != ""} {
    168         ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
    169     } else {
    170         ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"
    171     }
    172 
    173     if {$use_reg2} {
    174         _activate_contents $requested
    175         $requested state installed
    176     } else {
    177         set contents [registry::property_retrieve $ref contents]
    178 
    179         set imagefiles {}
    180         foreach content_element $contents {
    181             lappend imagefiles [lindex $content_element 0]
    182         }
    183 
    184         registry::open_file_map
    185         _activate_contents $name $imagefiles $location
    186 
    187         registry::property_store $ref active 1
    188 
    189         registry::write_entry $ref
    190 
    191         foreach file $imagefiles {
    192             registry::register_file $file $name
    193         }
    194         registry::write_file_map
    195         registry::close_file_map
    196     }
    197 }
    198 
    199 proc deactivate {name v optionslist} {
    200     global UI_PREFIX macports::registry.format macports::registry.path registry_open
     122        if { [string equal [$requested state] "installed"] } {
     123            return -code error "Image error: ${name} @${specifier} is already active."
     124        }
     125    }
     126    foreach a $todeactivate {
     127        if {$noexec || ![registry::run_target $a deactivate [list ports_nodepcheck 1]]} {
     128            deactivate $name [$a version] [$a revision] [$a variants] [list ports_nodepcheck 1]
     129        }
     130    }
     131
     132    ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $specifier]"
     133
     134    _activate_contents $requested
     135    $requested state installed
     136}
     137
     138# takes a composite version spec rather than separate version,revision,variants
     139proc deactivate_composite {name {v ""} {optionslist ""}} {
     140    if {$v == ""} {
     141        return [deactivate $name "" "" 0 $optionslist]
     142    } elseif {[registry::decode_spec $v version revision variants]} {
     143        return [deactivate $name $version $revision $variants $optionslist]
     144    }
     145    throw registry::invalid "Registry error: Invalid version '$v' specified for ${name}. Please specify a version as recorded in the port registry."
     146}
     147
     148proc deactivate {name {version ""} {revision ""} {variants 0} {optionslist ""}} {
     149    global UI_PREFIX macports::registry.path registry_open
    201150    array set options $optionslist
    202     variable use_reg2
    203151
    204152    if {[info exists options(ports_force)] && [string is true -strict $options(ports_force)] } {
     
    210158        set force 0
    211159    }
    212     if {[string equal ${macports::registry.format} "receipt_sqlite"]} {
    213         set use_reg2 1
    214         if {![info exists registry_open]} {
    215             registry::open [file join ${macports::registry.path} registry registry.db]
    216             set registry_open yes
    217         }
    218     }
    219 
    220     if {$use_reg2} {
    221         if { [string equal $name ""] } {
    222             throw registry::image-error "Registry error: Please specify the name of the port."
    223         }
    224         set ilist [registry::entry installed $name]
    225         if { [llength $ilist] == 1 } {
    226             set requested [lindex $ilist 0]
    227         } else {
    228             throw registry::image-error "Image error: port ${name} is not active."
    229         }
    230         # set name again since the one we were passed may not have had the correct case
    231         set name [$requested name]
    232         set version [$requested version]
    233         set revision [$requested revision]
    234         set variants [$requested variants]
    235         set specifier "${version}_${revision}${variants}"
     160    if {![info exists registry_open]} {
     161        registry::open [file join ${macports::registry.path} registry registry.db]
     162        set registry_open yes
     163    }
     164
     165    if { [string equal $name ""] } {
     166        throw registry::image-error "Registry error: Please specify the name of the port."
     167    }
     168    set ilist [registry::entry installed $name]
     169    if { [llength $ilist] == 1 } {
     170        set requested [lindex $ilist 0]
    236171    } else {
    237         set ilist [registry::active $name]
    238         if { [llength $ilist] > 1 } {
    239             return -code error "Registry error: Please specify the name of the port."
    240         } else {
    241             set ilist [lindex $ilist 0]
    242         }
    243         # set name again since the one we were passed may not have had the correct case
    244         set name [lindex $ilist 0]
    245         set version [lindex $ilist 1]
    246         set revision [lindex $ilist 2]
    247         set variants [lindex $ilist 3]
    248         set specifier "${version}_${revision}${variants}"
    249     }
    250 
    251     if { $v != "" && ![string equal $specifier $v] } {
     172        throw registry::image-error "Image error: port ${name} is not active."
     173    }
     174    # set name again since the one we were passed may not have had the correct case
     175    set name [$requested name]
     176    set specifier "[$requested version]_[$requested revision][$requested variants]"
     177
     178    if {$version != "" && ($version != [$requested version] ||
     179        ($revision != "" && ($revision != [$requested revision] || $variants != [$requested variants])))} {
     180        set v $version
     181        if {$revision != ""} {
     182            append v _${revision}${variants}
     183        }
    252184        return -code error "Active version of $name is not $v but ${specifier}."
    253185    }
    254186
    255     if {$v != ""} {
    256         ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $v]"
    257     } else {
    258         ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s"] $name]"
    259     }
    260 
    261     if {$use_reg2} {
    262         if { ![string equal [$requested installtype] "image"] } {
    263             return -code error "Image error: ${name} @${specifier} not installed as an image."
    264         }
    265         # this shouldn't be possible
    266         if { [$requested state] != "installed" } {
    267             return -code error "Image error: ${name} @${specifier} is not active."
    268         }
    269 
    270         if {![info exists options(ports_nodepcheck)] || ![string is true -strict $options(ports_nodepcheck)]} {
    271             registry::check_dependents $requested $force "deactivate"
    272         }
    273 
    274         _deactivate_contents $requested [$requested files] $force
    275         $requested state imaged
    276     } else {
    277         set ref [registry::open_entry $name $version $revision $variants]
    278 
    279         if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
    280             return -code error "Image error: ${name} @${specifier} not installed as an image."
    281         }
    282         if { [registry::property_retrieve $ref active] != 1 } {
    283             return -code error "Image error: ${name} @${specifier} is not active."
    284         }
    285 
    286         registry::open_file_map
    287         set imagefiles [registry::port_registered $name]
    288 
    289         _deactivate_contents $name $imagefiles
    290 
    291         foreach file $imagefiles {
    292             registry::unregister_file $file
    293         }
    294         registry::write_file_map
    295         registry::close_file_map
    296 
    297         registry::property_store $ref active 0
    298 
    299         registry::write_entry $ref
    300     }
    301 }
    302 
    303 proc _check_registry {name v} {
     187    ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $specifier]"
     188
     189    if { ![string equal [$requested installtype] "image"] } {
     190        return -code error "Image error: ${name} @${specifier} not installed as an image."
     191    }
     192    # this shouldn't be possible
     193    if { [$requested state] != "installed" } {
     194        return -code error "Image error: ${name} @${specifier} is not active."
     195    }
     196
     197    if {![info exists options(ports_nodepcheck)] || ![string is true -strict $options(ports_nodepcheck)]} {
     198        registry::check_dependents $requested $force "deactivate"
     199    }
     200
     201    _deactivate_contents $requested [$requested files] $force
     202    $requested state imaged
     203}
     204
     205proc _check_registry {name version revision variants} {
    304206    global UI_PREFIX
    305     variable use_reg2
    306 
    307     if {$use_reg2} {
    308         if { [registry::decode_spec $v version revision variants] } {
    309             set ilist [registry::entry imaged $name $version $revision $variants]
    310             set valid 1
    311         } else {
    312             set valid [string equal $v {}]
    313             set ilist [registry::entry imaged $name]
    314         }
    315 
    316         if { [llength $ilist] > 1 || (!$valid && [llength $ilist] == 1) } {
    317             ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
    318             foreach i $ilist {
    319                 set iname [$i name]
    320                 set iversion [$i version]
    321                 set irevision [$i revision]
    322                 set ivariants [$i variants]
    323                 if { [$i state] == "installed" } {
    324                     ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
    325                 } else {
    326                     ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
    327                 }
    328             }
    329             if { $valid } {
    330                 throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
     207
     208    set searchkeys $name
     209    set composite_spec ""
     210    if {$version != ""} {
     211        lappend searchkeys $version
     212        set composite_spec $version
     213        # restriction imposed by underlying registry API (see entry.c):
     214        # if a revision is specified, so must variants be
     215        if {$revision != ""} {
     216            lappend searchkeys $revision $variants
     217            append composite_spec _${revision}${variants}
     218        }
     219    }
     220    set ilist [eval registry::entry imaged $searchkeys]
     221
     222    if { [llength $ilist] > 1 } {
     223        ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
     224        foreach i $ilist {
     225            set iname [$i name]
     226            set iversion [$i version]
     227            set irevision [$i revision]
     228            set ivariants [$i variants]
     229            if { [$i state] == "installed" } {
     230                ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
    331231            } else {
    332                 throw registry::invalid "Registry error: Invalid version specified. Please specify a version as recorded in the port registry."
    333             }
    334         } elseif { [llength $ilist] == 1 } {
    335             return [lindex $ilist 0]
    336         }
    337         throw registry::invalid "Registry error: No port of $name installed."
    338     } else {
    339         # registry1.0
    340         set ilist [registry::installed $name $v]
    341         if { [string equal $v ""] && [llength $ilist] > 1 } {
    342             # set name again since the one we were passed may not have had the correct case
    343             set name [lindex [lindex $ilist 0] 0]
    344             ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
    345             foreach i $ilist {
    346                 set iname [lindex $i 0]
    347                 set iversion [lindex $i 1]
    348                 set irevision [lindex $i 2]
    349                 set ivariants [lindex $i 3]
    350                 set iactive [lindex $i 4]
    351                 if { $iactive == 0 } {
    352                     ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
    353                 } elseif { $iactive == 1 } {
    354                     ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
    355                 }
    356             }
    357             return -code error "Registry error: Please specify the full version as recorded in the port registry."
    358         } elseif {[llength $ilist] == 1} {
    359             return [lindex $ilist 0]
    360         }
    361         return -code error "Registry error: No port of $name installed."
    362     }
     232                ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
     233            }
     234        }
     235        throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
     236    } elseif { [llength $ilist] == 1 } {
     237        return [lindex $ilist 0]
     238    }
     239    if {$composite_spec != ""} {
     240        set composite_spec " @${composite_spec}"
     241    }
     242    throw registry::invalid "Registry error: ${name}${composite_spec} is not installed."
    363243}
    364244
     
    382262                } else {
    383263                    # not root, so can't set owner/group
    384                     eval file attributes {$dstfile} -permissions [file attributes -permissions $srcfile]
     264                    eval file attributes {$dstfile} -permissions [file attributes $srcfile -permissions]
    385265                }
    386266                # set mtime on installed element
     
    535415proc _activate_contents {port {imagefiles {}} {location {}}} {
    536416    variable force
    537     variable use_reg2
    538417    variable noexec
    539418    global macports::prefix
     
    541420    set files [list]
    542421    set baksuffix .mp_[clock seconds]
    543     if {$use_reg2} {
    544         set location [$port location]
    545         set imagefiles [$port imagefiles]
    546     } else {
    547         set name $port
    548     }
     422    set location [$port location]
     423    set imagefiles [$port imagefiles]
    549424    set extracted_dir [extract_archive_to_tmpdir $location]
    550425
     
    557432    #  we remove the file from the file_map, take ownership of it, and
    558433    #  clobber it
    559     if {$use_reg2} {
    560         array set todeactivate {}
    561         try {
    562             registry::write {
    563                 foreach file $imagefiles {
    564                     set srcfile "${extracted_dir}${file}"
    565 
    566                     # To be able to install links, we test if we can lstat the file to
    567                     # figure out if the source file exists (file exists will return
    568                     # false for symlinks on files that do not exist)
    569                     if { [catch {file lstat $srcfile dummystatvar}] } {
    570                         throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port [$port name]."
     434    array set todeactivate {}
     435    try {
     436        registry::write {
     437            foreach file $imagefiles {
     438                set srcfile "${extracted_dir}${file}"
     439
     440                # To be able to install links, we test if we can lstat the file to
     441                # figure out if the source file exists (file exists will return
     442                # false for symlinks on files that do not exist)
     443                if { [catch {file lstat $srcfile dummystatvar}] } {
     444                    throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port [$port name]."
     445                }
     446
     447                set owner [registry::entry owner $file]
     448
     449                if {$owner != {} && $owner != $port} {
     450                    # deactivate conflicting port if it is replaced_by this one
     451                    set result [mportlookup [$owner name]]
     452                    array unset portinfo
     453                    array set portinfo [lindex $result 1]
     454                    if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^[$port name]\$"] != -1} {
     455                        # we'll deactivate the owner later, but before activating our files
     456                        set todeactivate($owner) yes
     457                        set owner "replaced"
    571458                    }
    572 
    573                     set owner [registry::entry owner $file]
    574 
    575                     if {$owner != {} && $owner != $port} {
    576                         # deactivate conflicting port if it is replaced_by this one
    577                         set result [mportlookup [$owner name]]
    578                         array unset portinfo
    579                         array set portinfo [lindex $result 1]
    580                         if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^[$port name]\$"] != -1} {
    581                             # we'll deactivate the owner later, but before activating our files
    582                             set todeactivate($owner) yes
    583                             set owner "replaced"
     459                }
     460
     461                if {$owner != "replaced"} {
     462                    if { [string is true -strict $force] } {
     463                        # if we're forcing the activation, then we move any existing
     464                        # files to a backup file, both in the filesystem and in the
     465                        # registry
     466                        if { [file exists $file] } {
     467                            set bakfile "${file}${baksuffix}"
     468                            ui_warn "File $file already exists.  Moving to: $bakfile."
     469                            file rename -force -- $file $bakfile
     470                            lappend backups $file
     471                        }
     472                        if { $owner != {} } {
     473                            $owner deactivate [list $file]
     474                            $owner activate [list $file] [list "${file}${baksuffix}"]
     475                        }
     476                    } else {
     477                        # if we're not forcing the activation, then we bail out if
     478                        # we find any files that already exist, or have entries in
     479                        # the registry
     480                        if { $owner != {} && $owner != $port } {
     481                            throw registry::image-error "Image error: $file is being used by the active [$owner name] port.  Please deactivate this port first, or use 'port -f activate [$port name]' to force the activation."
     482                        } elseif { $owner == {} && ![catch {file type $file}] } {
     483                            throw registry::image-error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port [$port name]. Use 'port -f activate [$port name]' to force the activation."
    584484                        }
    585485                    }
    586 
    587                     if {$owner != "replaced"} {
    588                         if { [string is true -strict $force] } {
    589                             # if we're forcing the activation, then we move any existing
    590                             # files to a backup file, both in the filesystem and in the
    591                             # registry
    592                             if { [file exists $file] } {
    593                                 set bakfile "${file}${baksuffix}"
    594                                 ui_warn "File $file already exists.  Moving to: $bakfile."
    595                                 file rename -force -- $file $bakfile
    596                                 lappend backups $file
    597                             }
    598                             if { $owner != {} } {
    599                                 $owner deactivate [list $file]
    600                                 $owner activate [list $file] [list "${file}${baksuffix}"]
    601                             }
    602                         } else {
    603                             # if we're not forcing the activation, then we bail out if
    604                             # we find any files that already exist, or have entries in
    605                             # the registry
    606                             if { $owner != {} && $owner != $port } {
    607                                 throw registry::image-error "Image error: $file is being used by the active [$owner name] port.  Please deactivate this port first, or use 'port -f activate [$port name]' to force the activation."
    608                             } elseif { $owner == {} && ![catch {file type $file}] } {
    609                                 throw registry::image-error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port [$port name]. Use 'port -f activate [$port name]' to force the activation."
    610                             }
    611                         }
    612                     }
    613 
    614                     # Split out the filename's subpaths and add them to the
    615                     # imagefile list.
    616                     # We need directories first to make sure they will be there
    617                     # before links. However, because file mkdir creates all parent
    618                     # directories, we don't need to have them sorted from root to
    619                     # subpaths. We do need, nevertheless, all sub paths to make sure
    620                     # we'll set the directory attributes properly for all
    621                     # directories.
    622                     set directory [file dirname $file]
    623                     while { [lsearch -exact $files $directory] == -1 } {
    624                         lappend files $directory
    625                         set directory [file dirname $directory]
    626                     }
    627 
    628                     # Also add the filename to the imagefile list.
    629                     lappend files $file
    630                 }
    631             }
    632 
    633             # deactivate ports replaced_by this one
    634             foreach owner [array names todeactivate] {
    635                 if {$noexec || ![registry::run_target $owner deactivate [list ports_nodepcheck 1]]} {
    636                     deactivate [$owner name] "" [list ports_nodepcheck 1]
    637                 }
    638             }
    639 
    640             # Sort the list in forward order, removing duplicates.
    641             # Since the list is sorted in forward order, we're sure that
    642             # directories are before their elements.
    643             # We don't have to do this as mentioned above, but it makes the
    644             # debug output of activate make more sense.
    645             set files [lsort -increasing -unique $files]
    646             set rollback_filelist {}
    647 
    648             registry::write {
    649                 # Activate it, and catch errors so we can roll-back
    650                 try {
    651                     $port activate $imagefiles
    652                     foreach file $files {
    653                         if {[_activate_file "${extracted_dir}${file}" $file] == 1} {
    654                             lappend rollback_filelist $file
    655                         }
    656                     }
    657                 } catch {*} {
    658                     ui_debug "Activation failed, rolling back."
    659                     # can't do it here since we're already inside a transaction
    660                     set deactivate_this yes
    661                     throw
    662                 }
    663             }
    664         } catch {*} {
    665             # roll back activation of this port
    666             if {[info exists deactivate_this]} {
    667                 _deactivate_contents $port $rollback_filelist yes yes
    668             }
    669             # if any errors occurred, move backed-up files back to their original
    670             # locations, then rethrow the error. Transaction rollback will take care
    671             # of this in the registry.
    672             foreach file $backups {
    673                 file rename -force -- "${file}${baksuffix}" $file
    674             }
    675             # reactivate deactivated ports
    676             foreach entry [array names todeactivate] {
    677                 if {[$entry state] == "imaged" && ($noexec || ![registry::run_target $entry activate ""])} {
    678                     set pvers "[$entry version]_[$entry revision][$entry variants]"
    679                     activate [$entry name] $pvers [list ports_activate_no-exec $noexec]
    680                 }
    681             }
    682             # remove temp image dir
    683             file delete -force $extracted_dir
    684             throw
    685         }
    686     } else {
    687         # registry1.0
    688         set deactivated [list]
    689         foreach file $imagefiles {
    690             set srcfile "${extracted_dir}${file}"
    691 
    692             # To be able to install links, we test if we can lstat the file to
    693             # figure out if the source file exists (file exists will return
    694             # false for symlinks on files that do not exist)
    695             if { [catch {file lstat $srcfile dummystatvar}] } {
    696                 file delete -force $extracted_dir
    697                 return -code error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port $name."
    698             }
    699 
    700             set port [registry::file_registered $file]
    701            
    702             if {$port != 0  && $port != $name} {
    703                 # deactivate conflicting port if it is replaced_by this one
    704                 if {[catch {mportlookup $port} result]} {
    705                     global errorInfo
    706                     ui_debug "$errorInfo"
    707                     file delete -force $extracted_dir
    708                     return -code error "port lookup failed: $result"
    709                 }
    710                 array unset portinfo
    711                 array set portinfo [lindex $result 1]
    712                 if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^${name}\$"] != -1} {
    713                     lappend deactivated [lindex [registry::active $port] 0]
    714                     deactivate $port "" ""
    715                     set port 0
    716                 }
    717             }
    718    
    719             if { $port != 0  && $force != 1 && $port != $name } {
    720                 file delete -force $extracted_dir
    721                 return -code error "Image error: $file is being used by the active $port port.  Please deactivate this port first, or use 'port -f activate $name' to force the activation."
    722             } elseif { [file exists $file] && $force != 1 } {
    723                 file delete -force $extracted_dir
    724                 return -code error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port $name. Use 'port -f activate $name' to force the activation."
    725             } elseif { $force == 1 && [file exists $file] || $port != 0 } {
    726                 set bakfile "${file}${baksuffix}"
    727 
    728                 if {[file exists $file]} {
    729                     ui_warn "File $file already exists.  Moving to: $bakfile."
    730                     file rename -force -- $file $bakfile
    731                     lappend backups $file
    732                 }
    733 
    734                 if { $port != 0 } {
    735                     set bakport [registry::file_registered $file]
    736                     registry::unregister_file $file
    737                     if {[file exists $bakfile]} {
    738                         registry::register_file $bakfile $bakport
    739                     }
    740                 }
    741             }
    742 
    743             # Split out the filename's subpaths and add them to the imagefile list.
    744             # We need directories first to make sure they will be there before
    745             # links. However, because file mkdir creates all parent directories,
    746             # we don't need to have them sorted from root to subpaths. We do need,
    747             # nevertheless, all sub paths to make sure we'll set the directory
    748             # attributes properly for all directories.
    749             set directory [file dirname $file]