[80186] branches/gsoc11-rev-upgrade/base

cal at macports.org cal at macports.org
Wed Jul 6 04:59:34 PDT 2011


Revision: 80186
          http://trac.macports.org/changeset/80186
Author:   cal at macports.org
Date:     2011-07-06 04:59:33 -0700 (Wed, 06 Jul 2011)
Log Message:
-----------
rev-upgrade: Merge from trunk

Modified Paths:
--------------
    branches/gsoc11-rev-upgrade/base/ChangeLog
    branches/gsoc11-rev-upgrade/base/LICENSE
    branches/gsoc11-rev-upgrade/base/Makefile.in
    branches/gsoc11-rev-upgrade/base/Mk/macports.autoconf.mk.in
    branches/gsoc11-rev-upgrade/base/NEWS
    branches/gsoc11-rev-upgrade/base/aclocal.m4
    branches/gsoc11-rev-upgrade/base/config/RELEASE_URL
    branches/gsoc11-rev-upgrade/base/configure
    branches/gsoc11-rev-upgrade/base/configure.ac
    branches/gsoc11-rev-upgrade/base/doc/Makefile
    branches/gsoc11-rev-upgrade/base/doc/macports.conf.5
    branches/gsoc11-rev-upgrade/base/doc/macports.conf.in
    branches/gsoc11-rev-upgrade/base/doc/port.1
    branches/gsoc11-rev-upgrade/base/doc/portfile.7
    branches/gsoc11-rev-upgrade/base/doc/portgroup.7
    branches/gsoc11-rev-upgrade/base/doc/prefix.mtree.in
    branches/gsoc11-rev-upgrade/base/doc/sources.conf
    branches/gsoc11-rev-upgrade/base/m4/tcl.m4
    branches/gsoc11-rev-upgrade/base/macports-pubkey.pem
    branches/gsoc11-rev-upgrade/base/portmgr/ReleaseProcess
    branches/gsoc11-rev-upgrade/base/portmgr/dmg/InstallationCheck
    branches/gsoc11-rev-upgrade/base/portmgr/dmg/License.html
    branches/gsoc11-rev-upgrade/base/portmgr/dmg/ReadMe.rtf
    branches/gsoc11-rev-upgrade/base/portmgr/dmg/postflight
    branches/gsoc11-rev-upgrade/base/portmgr/fedora/macports.spec
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/GuideRegen.sh
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/PortIndex2MySQL.tcl
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/mprsyncup
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_lint.pl
    branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_mirror.pl
    branches/gsoc11-rev-upgrade/base/portmgr/packaging/dpkgall.tcl
    branches/gsoc11-rev-upgrade/base/portmgr/packaging/mpkgall.tcl
    branches/gsoc11-rev-upgrade/base/portmgr/packaging/packageall.tcl
    branches/gsoc11-rev-upgrade/base/portmgr/packaging/rpmall.tcl
    branches/gsoc11-rev-upgrade/base/src/cregistry/entry.c
    branches/gsoc11-rev-upgrade/base/src/darwintracelib1.0/darwintrace.c
    branches/gsoc11-rev-upgrade/base/src/images_to_archives.tcl
    branches/gsoc11-rev-upgrade/base/src/macports1.0/Makefile
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_autoconf.tcl.in
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_dlist.tcl
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_fastload.tcl.in
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_index.tcl
    branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_util.tcl
    branches/gsoc11-rev-upgrade/base/src/macports1.0/tests/macports_dlist.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/package.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portarchivefetch.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portdmg.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portdpkg.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portmdmg.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portmpkg.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portpkg.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portportpkg.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portrpm.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portsrpm.tcl
    branches/gsoc11-rev-upgrade/base/src/package1.0/portunarchive.tcl
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Pextlib.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md_wrappers.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.h
    branches/gsoc11-rev-upgrade/base/src/pkg_mkindex.sh.in
    branches/gsoc11-rev-upgrade/base/src/port/Makefile
    branches/gsoc11-rev-upgrade/base/src/port/port-help.tcl
    branches/gsoc11-rev-upgrade/base/src/port/port.tcl
    branches/gsoc11-rev-upgrade/base/src/port/portindex.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/fetch_common.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/port.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in
    branches/gsoc11-rev-upgrade/base/src/port1.0/portactivate.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portbuild.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portclean.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portconfigure.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portdeactivate.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portdepends.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portdestroot.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portdistcheck.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portdistfiles.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portextract.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portfetch.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portinstall.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portlivecheck.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portload.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portmain.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portmirror.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portpatch.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portstartupitem.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portsubmit.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/porttrace.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portuninstall.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portunload.tcl
    branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl
    branches/gsoc11-rev-upgrade/base/src/portindex/portregister.pl
    branches/gsoc11-rev-upgrade/base/src/portindex/portsubmit.pl
    branches/gsoc11-rev-upgrade/base/src/registry2.0/Makefile
    branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl
    branches/gsoc11-rev-upgrade/base/src/registry2.0/portuninstall.tcl
    branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_flat.tcl
    branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl
    branches/gsoc11-rev-upgrade/base/src/registry2.0/registry.tcl
    branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_autoconf.tcl.in
    branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_util.tcl
    branches/gsoc11-rev-upgrade/base/src/upgrade_sources_conf_default.tcl
    branches/gsoc11-rev-upgrade/base/tests/Makefile
    branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Makefile
    branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Portfile.in
    branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/README
    branches/gsoc11-rev-upgrade/base/tests/test/checksums-1/master
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-a/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-b/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/master
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-d/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/master
    branches/gsoc11-rev-upgrade/base/tests/test/envvariables/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/envvariables/master
    branches/gsoc11-rev-upgrade/base/tests/test/site-tags/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/site-tags/master
    branches/gsoc11-rev-upgrade/base/tests/test/trace/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/trace/master
    branches/gsoc11-rev-upgrade/base/tests/test/universal/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/universal-2/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/variants/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/variants/master
    branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/Portfile
    branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/master

Added Paths:
-----------
    branches/gsoc11-rev-upgrade/base/doc/base.mtree.in

Property Changed:
----------------
    branches/gsoc11-rev-upgrade/base/
    branches/gsoc11-rev-upgrade/base/doc/
    branches/gsoc11-rev-upgrade/base/portmgr/fedora/macports.spec
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.h
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.c
    branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.h
    branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl


Property changes on: branches/gsoc11-rev-upgrade/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:78828-80185
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/ChangeLog
===================================================================
--- branches/gsoc11-rev-upgrade/base/ChangeLog	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/ChangeLog	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,8 +3,106 @@
 # $Id$
 ###
 
-Unreleased changes:
+Release 2.0.0 (unreleased):
 
+    - Multiple ports can now be defined in one Portfile using the 'subport'
+      procedure. This reduces code duplication when several ports use very
+      similar code. (jmr in r78062)
+
+    - Privilege dropping is now on by default. The runtime user can be changed
+      when building from source but defaults to 'macports'; this user is
+      created at install time. (jmr in r79025)
+
+    - Fetching from some extremely slow or partially unresponsive servers
+      should now time out as expected. (raimue in r71038)
+
+    - The registry is now "vacuumed" (compacted/defragmented) after
+      uninstalling ports. (jmr in r70608)
+
+    - Downloaded archives are now checked for integrity using digital
+      signatures. Sync and selfupdate can also use a signed tarball. New
+      pubkeys.conf file allows configuring keys to trust.
+      (jmr in r68996, r79093)
+
+    - Added 'actinact' pseudo-portname that expands to installed ports with an
+      active version and at least one inactive version.
+      (#27666, jmr in r79421, based on patch from gmail.com:ww.galen)
+
+    - Added --size option for 'contents' action that makes it print the size
+      of each file. (#27245, jmr in r79365, based on patch from
+      gmail.com:ww.galen)
+
+    - Added 'space' action to show the disk space used by ports' active files.
+      (#27244, jmr in r79349, based on patch from gmail.com:ww.galen)
+
+    - Actions can be abbreviated to an unambiguous prefix of the full name.
+      (#27242, patch from gmail.com:ww.galen committed in r79259)
+
+    - Fixed error when activating ports whose version contains an underscore
+      followed by an integer and a dash. (#28084, jmr in r79167)
+
+    - Deactivating a port that has dependents no longer needs to be forced
+      when the dependents are all inactive. (#29505, jmr in r78086)
+
+    - New option 'add_users' has been added. Setting it will ensure that the
+      listed users are created before all operations that may require them to
+      exist. (#11563, jmr in r78660)
+
+    - 'port info --index' should be much faster and will work with the
+      'current' pseudo-port provided the port has been indexed.
+      (#13673, jmr in r78621)
+
+    - Relocation is explicitly disabled when building pkgs on 10.6, so Apple's
+      Installer won't attempt to overwrite other copies of the same software
+      not installed by MacPorts. (#25174, jmr in r78178)
+
+    - Non-Darwin platforms can once again build base against OpenSSL for
+      checksum support. (#26813, afb in r77865)
+
+    - It is now safe to set svn.post_args, rather than that option being
+      reserved for svn.url. (#27454, jmr in r73825)
+
+    - Variants specified when running 'port mpkg' are now set in the
+      dependencies as well. (#27231, jmr in r73303)
+
+    - Fixed various issues with privilege dropping.
+      (#26899, jmr in r69453 etc.)
+
+    - Trace mode no longer fails on 10.6. (#21582, jmr in r74318, r74369)
+
+    - Ports that create StartupItems (aka launchd plists) should now be
+      installable by unprivileged users. (#10879, jmr in r66700, r75143)
+
+    - Fixed incorrect output from 'port dependents' when using newer SQLite
+      versions. (#27506, patch from gmail.com:mmpestorich committed in r76827)
+
+    - The flat registry format is no longer available. Setting portdbformat to
+      'flat' in macports.conf will result in the sqlite registry being used.
+      (jmr in r77681)
+
+    - Port images are now stored as archives. Archive mode is now effectively
+      always on. Among other benefits, this fixes some bugs with the handling
+      of hard links installed by ports (e.g. #13601).
+
+      Direct mode is no longer available. Existing port image directories, and
+      installed files for direct mode, will be converted to archives when
+      upgrading.
+
+      (#19458, branch by blb, merged by jmr in r77511)
+
+    - master_site_local, patch_site_local, and archive_site_local can be set
+      in macports.conf, with the same effects as the corresponding environment
+      variables. (jmr in r74924)
+
+    - Added 'logfile' action that prints the path to a port's log file.
+      (jmr in r74655)
+
+    - Computing large dependency trees that contain the same port(s) multiple
+      times should be considerably faster. (jmr in r73133)
+
+    - configure.compiler can now be set to macports-llvm-gcc-4.2 or
+      macports-clang (mfeiri in r72936, r72937)
+
     - Add '-n' option to reinplace (#26406, ryandesign in r73227)
 
     - Add new ccache_dir and ccache_size options, default path is

Modified: branches/gsoc11-rev-upgrade/base/LICENSE
===================================================================
--- branches/gsoc11-rev-upgrade/base/LICENSE	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/LICENSE	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,5 +1,5 @@
 Copyright (c) 2002 - 2003, Apple Inc.
-Copyright (c) 2004 - 2010, The MacPorts Project.
+Copyright (c) 2004 - 2011, The MacPorts Project.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

Modified: branches/gsoc11-rev-upgrade/base/Makefile.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/Makefile.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/Makefile.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -8,7 +8,7 @@
 DISTNAME	= MacPorts-${DISTVER}
 DISTARCTAG	= ${DISTTAG}-archive
 DISTARCNAME	= ${DISTNAME}-archive
-SVNURL		= http://svn.macports.org/repository/macports
+SVNURL		= https://svn.macports.org/repository/macports
 
 
 include Mk/macports.autoconf.mk
@@ -37,6 +37,31 @@
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 macports-pubkey.pem  $(DESTDIR)${datadir}/macports/
 # Only run these scripts when not building in a destroot
 ifeq ($(DESTDIR),)
+# create run user if it doesn't exist
+	@if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then \
+        if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then \
+            if test `id -u` -eq 0; then \
+                echo "Creating group \"${RUNUSR}\"" ; \
+                ${DSEDITGROUP} -q -o create -n . ${RUNUSR} ; \
+            else \
+                echo "Not creating group \"${RUNUSR}\" (not root)" ; \
+            fi ; \
+        fi ; \
+        if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then \
+            if test `id -u` -eq 0; then \
+                echo "Creating user \"${RUNUSR}\"" ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} Password \* ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $$(($$(${DSCL} -q . -list /Users UniqueID | /usr/bin/awk '{print $$2}' | sort -ug | tail -1)+1)) ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}') ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /var/empty ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false ; \
+            else \
+                echo "Not creating user \"${RUNUSR}\" (not root)" ; \
+            fi ; \
+        fi ; \
+    else \
+        echo "Can't find ${DSCL} / ${DSEDITGROUP}, not creating user \"${RUNUSR}\"" ; \
+    fi
 # Add [default] tag to the central MacPorts repository, if it isn't already
 	$(TCLSH) src/upgrade_sources_conf_default.tcl "${prefix}"
 # Convert image directories (and direct mode installs) to image archives
@@ -44,7 +69,7 @@
 endif
 	@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 ""
 	@echo "sudo port -v selfupdate"; echo ""
-	@echo "Please read \"man port\", the MacPorts guide at http://guide.macports.org/ and Wiki at http://trac.macports.org/ for full documentation."; echo ""
+	@echo "Please read \"man port\", the MacPorts guide at http://guide.macports.org/ and Wiki at https://trac.macports.org/ for full documentation."; echo ""
 
 group::
 	@echo "creating a macports group..." && sudo dseditgroup -o create -n . macports && echo "done! use './configure --with-install-group=macports --with-shared-directory' if you haven't already"
@@ -71,7 +96,7 @@
 	cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | gzip > ${PKGNAME}.tar.gz
 	cd ${DISTDIR}; COPY_EXTENDED_ATTRIBUTES_DISABLE=true tar -c ${PKGNAME} | bzip2 > ${PKGNAME}.tar.bz2
 	cd ${DISTDIR}; for tarball in ${PKGNAME}.tar.*; do { \
-		for type in -md5 -sha1 -ripemd160; do { \
+		for type in -md5 -sha1 -ripemd160 -sha256; do { \
 			openssl dgst $$type $$tarball; \
 		}; done >> ${DISTNAME}.chk.txt; \
 	}; done

Modified: branches/gsoc11-rev-upgrade/base/Mk/macports.autoconf.mk.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/Mk/macports.autoconf.mk.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/Mk/macports.autoconf.mk.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -52,11 +52,13 @@
 TCL_PACKAGE_DIR		= @TCL_PACKAGE_DIR@
 macports_tcl_dir	= @macports_tcl_dir@
 
+DSCL			= @DSCL@
+DSEDITGROUP		= @DSEDITGROUP@
 DSTUSR			= @DSTUSR@
 DSTGRP			= @DSTGRP@
 DSTMODE			= @DSTMODE@
+RUNUSR			= @RUNUSR@
 
-
 prefix			= @prefix@
 sysconfdir		= @sysconfdir@
 exec_prefix		= @exec_prefix@

Modified: branches/gsoc11-rev-upgrade/base/NEWS
===================================================================
--- branches/gsoc11-rev-upgrade/base/NEWS	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/NEWS	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,3 +1,29 @@
+== Overview of changes from MacPorts 1.9.2 to 2.0.0 ==
+
+# For regular users:
+
+*) Downloaded archives are now checked for integrity using digital signatures.
+   New pubkeys.conf file allows configuring keys to trust.
+
+*) Actions can be abbreviated to an unambiguous prefix of the full name.
+
+*) Ports that create StartupItems (aka launchd plists) should now be
+   installable by unprivileged users.
+
+*) Port images are now stored as archives. Archive mode is now effectively
+   always on. Direct mode and the flat registry format are no longer
+   available. Conversion will happen automatically.
+
+# For Portfile writers:
+
+*) Multiple ports can now be defined in one Portfile using the 'subport'
+   procedure.
+
+*) New option 'add_users' can be set to ensure that the listed users are
+   created at the right times during the install process.
+
+*) SHA256 checksums are now supported.
+
 == Overview of changes from MacPorts 1.8.2 to 1.9.0 ==
 
 # For regular users:

Modified: branches/gsoc11-rev-upgrade/base/aclocal.m4
===================================================================
--- branches/gsoc11-rev-upgrade/base/aclocal.m4	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/aclocal.m4	2011-07-06 11:59:33 UTC (rev 80186)
@@ -327,6 +327,12 @@
 		AC_MSG_RESULT([$DSTGRP])
 		AC_SUBST(DSTGRP)
 
+		# Set run-user to current user
+		AC_MSG_CHECKING([for macports user])
+		RUNUSR=`id -un`
+		AC_MSG_RESULT([$RUNUSR])
+		AC_SUBST(RUNUSR)
+
 		# Set Tcl package directory to ~/Library/Tcl
 	    AC_MSG_CHECKING(for Tcl package directory)
 		ac_cv_c_tclpkgd="~$DSTUSR/Library/Tcl"
@@ -354,7 +360,7 @@
 	
 	AC_MSG_CHECKING([for macports user])
 	if test "x$RUNUSR" = "x" ; then
-	   RUNUSR=nobody
+	   RUNUSR=macports
 	fi
 
 	AC_MSG_RESULT([$RUNUSR])

Modified: branches/gsoc11-rev-upgrade/base/config/RELEASE_URL
===================================================================
--- branches/gsoc11-rev-upgrade/base/config/RELEASE_URL	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/config/RELEASE_URL	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1 +1 @@
-http://svn.macports.org/repository/macports/tags/release_1_9_2/base
+https://svn.macports.org/repository/macports/tags/release_1_9_2/base

Modified: branches/gsoc11-rev-upgrade/base/configure
===================================================================
--- branches/gsoc11-rev-upgrade/base/configure	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/configure	2011-07-06 11:59:33 UTC (rev 80186)
@@ -647,8 +647,8 @@
 MPFRAMEWORKSDIR
 MPAPPLICATIONSDIR
 DSTMODE
+TCL_PACKAGE_DIR
 RUNUSR
-TCL_PACKAGE_DIR
 DSTGRP
 DSTUSR
 MPCONFIGDIR
@@ -709,6 +709,7 @@
 CVS
 BZR
 FILE
+DSEDITGROUP
 DSCL
 DIFF
 CPIO
@@ -792,6 +793,7 @@
 enable_werror
 with_objc_runtime
 with_objc_foundation
+with_unsupported_prefix
 with_ports_dir
 with_no_root_privileges
 with_install_user
@@ -823,10 +825,6 @@
 CPPFLAGS
 OBJC
 OBJCFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-OBJC
 MTREE
 CVS
 SVN
@@ -842,9 +840,7 @@
 XAR
 OPEN
 OBJCPP
-CPPFLAGS
-CPP
-CPPFLAGS'
+CPP'
 ac_subdirs_all='src/thread2.6'
 
 # Initialize some variables set by options.
@@ -1471,6 +1467,9 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-objc-runtime     Specify either "GNU" or "apple"
   --with-objc-foundation  Specify either "GNUstep" or "apple"
+  --with-unsupported-prefix
+                          Acknowledge that you accept the consequences of
+                          using an unsupported prefix.
   --with-ports-dir=DIR    Specify alternate ports directory
   --with-no-root-privileges
                           Specify that MacPorts should be installed in your
@@ -2923,13 +2922,13 @@
     as_fn_error $? "This version of Mac OS X is not supported
                   Please upgrade at http://store.apple.com/" "$LINENO" 5
     ;;
-  10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-3])
+  10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-6])
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This version of Mac OS X is out of date" >&5
 $as_echo "$as_me: WARNING: This version of Mac OS X is out of date" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please run Software Update to update it" >&5
 $as_echo "$as_me: WARNING: Please run Software Update to update it" >&2;}
     ;;
-  10.4*|10.5*|10.6*)
+  10.4*|10.5*|10.6*|10.7*)
         ;;
   *)
     ;;
@@ -2973,7 +2972,7 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please consider upgrading as some ports fail compiling" >&5
 $as_echo "$as_me: WARNING: Please consider upgrading as some ports fail compiling" >&2;}
     ;;
-  2.*|3.*)
+  2.*|3.*|4.*)
         ;;
   *)
     ;;
@@ -4398,6 +4397,46 @@
 fi
 
 
+# Extract the first word of "dseditgroup", so it can be a program name with args.
+set dummy dseditgroup; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DSEDITGROUP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $DSEDITGROUP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DSEDITGROUP="$DSEDITGROUP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_DSEDITGROUP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DSEDITGROUP=$ac_cv_path_DSEDITGROUP
+if test -n "$DSEDITGROUP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSEDITGROUP" >&5
+$as_echo "$DSEDITGROUP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "file", so it can be a program name with args.
 set dummy file; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7598,13 +7637,23 @@
 
 # Check for paths
 
-if test x$prefix = x/usr/local; then
-    as_fn_error $? "Installing MacPorts into /usr/local is not supported" "$LINENO" 5
+
+# Check whether --with-unsupported-prefix was given.
+if test "${with_unsupported_prefix+set}" = set; then :
+  withval=$with_unsupported_prefix; with_unsupported_prefix=$withval
+else
+  with_unsupported_prefix=no
 fi
 
+if test x$prefix = x/usr/local -o x$prefix = x/usr && test x$with_unsupported_prefix != xyes; then
+    as_fn_error $? "Installing MacPorts into $prefix is not supported. If \
+you understand this and wish to do so anyway, pass --with-unsupported-prefix \
+to configure." "$LINENO" 5
+fi
 
 
 
+
 # Check whether --with-ports-dir was given.
 if test "${with_ports_dir+set}" = set; then :
   withval=$with_ports_dir;  portsdir="$withval"
@@ -7682,6 +7731,14 @@
 $as_echo "$DSTGRP" >&6; }
 
 
+		# Set run-user to current user
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for macports user" >&5
+$as_echo_n "checking for macports user... " >&6; }
+		RUNUSR=`id -un`
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUNUSR" >&5
+$as_echo "$RUNUSR" >&6; }
+
+
 		# Set Tcl package directory to ~/Library/Tcl
 	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl package directory" >&5
 $as_echo_n "checking for Tcl package directory... " >&6; }
@@ -7768,7 +7825,7 @@
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for macports user" >&5
 $as_echo_n "checking for macports user... " >&6; }
 	if test "x$RUNUSR" = "x" ; then
-	   RUNUSR=nobody
+	   RUNUSR=macports
 	fi
 
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUNUSR" >&5
@@ -9592,7 +9649,7 @@
 
 
 # Output
-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"
+ac_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"
 
 
 ac_config_files="$ac_config_files src/pkg_mkindex.sh"
@@ -10305,6 +10362,7 @@
     "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "Mk/macports.autoconf.mk") CONFIG_FILES="$CONFIG_FILES Mk/macports.autoconf.mk" ;;
+    "doc/base.mtree") CONFIG_FILES="$CONFIG_FILES doc/base.mtree" ;;
     "doc/prefix.mtree") CONFIG_FILES="$CONFIG_FILES doc/prefix.mtree" ;;
     "doc/macosx.mtree") CONFIG_FILES="$CONFIG_FILES doc/macosx.mtree" ;;
     "doc/macports.conf") CONFIG_FILES="$CONFIG_FILES doc/macports.conf" ;;

Modified: branches/gsoc11-rev-upgrade/base/configure.ac
===================================================================
--- branches/gsoc11-rev-upgrade/base/configure.ac	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/configure.ac	2011-07-06 11:59:33 UTC (rev 80186)
@@ -32,11 +32,11 @@
     AC_MSG_ERROR([This version of Mac OS X is not supported
                   Please upgrade at http://store.apple.com/])
     ;;
-  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-3]])
+  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-6]])
     AC_MSG_WARN([This version of Mac OS X is out of date])
     AC_MSG_WARN([Please run Software Update to update it])
     ;;
-  10.4*|10.5*|10.6*)
+  10.4*|10.5*|10.6*|10.7*)
     dnl Supported version
     ;;
   *)
@@ -73,7 +73,7 @@
     AC_MSG_WARN([This version of Xcode Tools is out of date])
     AC_MSG_WARN([Please consider upgrading as some ports fail compiling])
     ;;
-  2.*|3.*)
+  2.*|3.*|4.*)
     dnl Supported version
     ;;
   *)
@@ -92,6 +92,7 @@
 AC_PATH_PROG(CPIO, [cpio], [])
 AC_PATH_PROG(DIFF, [diff], [])
 AC_PATH_PROG(DSCL, [dscl], [])
+AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [])
 AC_PATH_PROG(FILE, [file], [])
 AC_PATH_PROG(BZR, [bzr], [])
 AC_PATH_PROG(CVS, [cvs], [])
@@ -169,8 +170,16 @@
 
 # Check for paths
 AC_PREFIX_DEFAULT(/opt/local)
-if test x$prefix = x/usr/local; then
-    AC_MSG_ERROR([Installing MacPorts into /usr/local is not supported])
+AC_ARG_WITH(
+		unsupported-prefix,
+		AS_HELP_STRING([--with-unsupported-prefix],
+		[Acknowledge that you accept the consequences of using an unsupported prefix.]),
+		[with_unsupported_prefix=$withval],
+		[with_unsupported_prefix=no])
+if test x$prefix = x/usr/local -o x$prefix = x/usr && test x$with_unsupported_prefix != xyes; then
+    AC_MSG_ERROR([Installing MacPorts into $prefix is not supported. If \
+you understand this and wish to do so anyway, pass --with-unsupported-prefix \
+to configure.])
 fi
 MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
 MP_PATH_MPCONFIGDIR
@@ -346,6 +355,7 @@
 	Doxyfile
 	Makefile
 	Mk/macports.autoconf.mk
+	doc/base.mtree
 	doc/prefix.mtree
 	doc/macosx.mtree
 	doc/macports.conf


Property changes on: branches/gsoc11-rev-upgrade/base/doc
___________________________________________________________________
Modified: svn:ignore
   - macports.conf
pubkeys.conf
prefix.mtree
macosx.mtree
*[0-9].gz

   + macports.conf
pubkeys.conf
base.mtree
prefix.mtree
macosx.mtree
*[0-9].gz


Modified: branches/gsoc11-rev-upgrade/base/doc/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -17,7 +17,7 @@
 test:
 
 distclean: clean
-	rm -f macports.conf macosx.mtree prefix.mtree pubkeys.conf
+	rm -f macports.conf base.mtree macosx.mtree prefix.mtree pubkeys.conf
 
 %.1.gz: %.1
 	gzip -c $^ > $@
@@ -32,7 +32,8 @@
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${DESTDIR}${mpconfigdir}
 
-	<prefix.mtree $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
+	< prefix.mtree $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
+	< base.mtree $(MTREE) -U -e -p ${INSTALLDIR} > /dev/null
 	if test -L "${INSTALLDIR}/man" ; then \
 		rm -f "${INSTALLDIR}/man"; \
 	fi
@@ -55,6 +56,7 @@
 	for m in ${MAN7}; do rm -f ${INSTALLDIR}/share/man/man7/$$m ; done
 
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/share/macports/install
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 base.mtree ${INSTALLDIR}/share/macports/install/
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${INSTALLDIR}/share/macports/install/
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macosx.mtree ${INSTALLDIR}/share/macports/install/
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 port.1.gz ${INSTALLDIR}/share/man/man1

Copied: branches/gsoc11-rev-upgrade/base/doc/base.mtree.in (from rev 80185, trunk/base/doc/base.mtree.in)
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/base.mtree.in	                        (rev 0)
+++ branches/gsoc11-rev-upgrade/base/doc/base.mtree.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -0,0 +1,22 @@
+# $Id$
+#
+# MacPorts filesystem hierarchy, for internal use only. Changes to this file will not stick across installations.
+#
+
+/set type=dir uname=@DSTUSR@ gname=@DSTGRP@ mode=@DSTMODE@
+.
+    var
+        macports
+            build
+            ..
+            distfiles
+            ..
+            logs
+            ..
+            registry
+            ..
+            software
+            ..
+        ..
+    ..
+..

Modified: branches/gsoc11-rev-upgrade/base/doc/macports.conf.5
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/macports.conf.5	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/macports.conf.5	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,5 +1,6 @@
 .\" Copyright (c) 2005 Matt Anton <matt at opendarwin.org>
 .\" Copyright (c) 2007 Juan Manuel Palacios <jmpp at macports.org>
+.\" Copyright (c) 2007-2011 The MacPorts Project
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without

Modified: branches/gsoc11-rev-upgrade/base/doc/macports.conf.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/macports.conf.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/macports.conf.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -78,14 +78,16 @@
 
 # Rsync server to fetch MacPorts sources from. Note that this is only used
 # for selfupdate. The source(s) for the ports tree are set in sources.conf.
-# Known mirrors at time of writing (see http://trac.macports.org/wiki/Mirrors
+# Known mirrors at time of writing (see https://trac.macports.org/wiki/Mirrors
 # for the current list):
 #   rsync.macports.org        - California, USA (master)
 #   trd.no.rsync.macports.org - Trondheim, Norway
 #rsync_server		rsync.macports.org
 
 # Rsync directory from which to pull the base/ component (infrastructure) of MacPorts
-#rsync_dir			release/base/
+# If this points to a .tar file, a signed .rmd160 must exist next to it
+# on the server and will be used to verify its integrity.
+#rsync_dir			release/tarballs/base.tar
 
 # Rsync options
 #rsync_options		-rtzv --delete-after

Modified: branches/gsoc11-rev-upgrade/base/doc/port.1
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/port.1	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/port.1	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,6 +1,7 @@
 .\" port.1
 .\"
-.\" Copyright (c) 2002 Apple Computer, Inc.
+.\" Copyright (c) 2004-2011 The MacPorts Project
+.\" Copyright (c) 2002-2003 Apple Inc.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -11,7 +12,7 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of Apple Computer, Inc. nor the names of its
+.\" 3. Neither the name of Apple Inc. nor the names of its
 .\"    contributors may be used to endorse or promote products derived from
 .\"    this software without specific prior written permission.
 .\"
@@ -104,6 +105,10 @@
 set of installed but inactive ports.
 .Pp
 .It
+.Ar actinact :
+set of installed ports that have both an active version and one or more inactive versions.
+.Pp
+.It
 .Ar installed :
 set of all installed ports.
 .Pp
@@ -377,6 +382,31 @@
 .Dl "port uninstall vim"
 .Dl "port -u uninstall"
 .Dl "port uninstall --follow-dependents python24"
+.Ss select
+For a given
+.Ar group ,
+selects a
+.Ar version
+to be the default by creating appropriate symbolic links.
+For instance,
+.Ic "python"
+might be linked to
+.Ic "python2.6" .
+Available select groups are installed as subdirectories of
+.Ar ${prefix}/etc/select/ .
+To list the available versions in a group, use
+.Fl -list .
+To see which version is currently selected for a group, use
+.Fl -show .
+To change the selected version for a group, use
+.Fl -set .
+.Pp
+For example:
+.Pp
+.Dl "port select --list python"
+.Dl "port select --show gcc"
+.Dl "port select --set gcc mp-gcc44"
+.Pp
 .Ss activate
 Activate the installed
 .Ar portname .

Modified: branches/gsoc11-rev-upgrade/base/doc/portfile.7
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/portfile.7	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/portfile.7	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,6 +1,7 @@
 .\" portfile.7
 .\"
-.\" Copyright (c) 2002 Apple Computer, Inc.
+.\" Copyright (c) 2004-2011 The MacPorts Project
+.\" Copyright (c) 2002-2003 Apple Inc.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -11,7 +12,7 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of Apple Computer, Inc. nor the names of its
+.\" 3. Neither the name of Apple Inc. nor the names of its
 .\"    contributors may be used to endorse or promote products derived from
 .\"    this software without specific prior written permission.
 .\"
@@ -401,6 +402,26 @@
 .Dl add_users squid group=squid realname=Squid\e Proxy home=${prefix}/var/squid
 .sp
 .Dl add_users user1 group=mygroup user2 group=mygroup
+.It Ic installs_libs
+By default, it is assumed that ports may install libraries or headers that can
+be incorporated into their dependents. If this is not the case, set
+.Cm installs_libs
+to
+.Em no .
+This means that this port's dependents need not check that it is installed
+for the same architectures as them; that it is permissible to distribute
+binaries of the dependents even if their licenses conflict with the license
+of this port; and that updates to this port can never result in broken dynamic
+linking in its dependents.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em none
+.br
+.Sy Example:
+.Dl installs_libs no
 .El
 .Sh TARGET HOOKS
 A number of hooks are available for customizing many of the standard

Modified: branches/gsoc11-rev-upgrade/base/doc/portgroup.7
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/portgroup.7	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/portgroup.7	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,7 +11,7 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of Apple Computer, Inc. nor the names of its
+.\" 3. Neither the name of The MacPorts Project nor the names of its
 .\"    contributors may be used to endorse or promote products derived from
 .\"    this software without specific prior written permission.
 .\"

Modified: branches/gsoc11-rev-upgrade/base/doc/prefix.mtree.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/prefix.mtree.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/prefix.mtree.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -240,20 +240,6 @@
     src
     ..
     var
-        macports
-            build
-            ..
-            distfiles
-            ..
-            logs
-            ..
-            packages
-            ..
-            receipts
-            ..
-            registry
-            ..
-        ..
     ..
     www
     ..

Modified: branches/gsoc11-rev-upgrade/base/doc/sources.conf
===================================================================
--- branches/gsoc11-rev-upgrade/base/doc/sources.conf	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/doc/sources.conf	2011-07-06 11:59:33 UTC (rev 80186)
@@ -23,5 +23,9 @@
 #      rsync://rsync.macports.org/release/ports/
 #  To get it from the mirror in Trondheim, Norway use:
 #      rsync://trd.no.rsync.macports.org/release/ports/
-#  A current list of mirrors is available at http://trac.macports.org/wiki/Mirrors
-rsync://rsync.macports.org/release/ports/ [default]
+#  A current list of mirrors is available at https://trac.macports.org/wiki/Mirrors
+
+# If an rsync URL points to a .tar file, a signed .rmd160 must exist next to
+# it on the server and will be used to verify its integrity.
+
+rsync://rsync.macports.org/release/tarballs/ports.tar [default]

Modified: branches/gsoc11-rev-upgrade/base/m4/tcl.m4
===================================================================
--- branches/gsoc11-rev-upgrade/base/m4/tcl.m4	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/m4/tcl.m4	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,5 +1,5 @@
 # This file is based on the tcl.m4 file distributed with Tcl 8.4
-# Portions Copyright (2003) Apple Computer, Inc.
+# Portions Copyright (2003) Apple Inc.
 #
 # Copyright and License for this file, copied verbatim from the official
 # Tcl distribution, follows:

Modified: branches/gsoc11-rev-upgrade/base/macports-pubkey.pem
===================================================================
--- branches/gsoc11-rev-upgrade/base/macports-pubkey.pem	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/macports-pubkey.pem	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,9 +1,14 @@
 -----BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPlw2FSMEavmtuHq5O+f
-XPUXndBnUyoX8iJvQ7NlsNY+hleE307kOAly79WFq2aAGIyKB/Ob8V+qCLW4FGOO
-4NfvOnte1WxQP8oVxOM9ai3CeN6AnUxDWUTYVJ1R+a5ZQVnJyGBKkV+jLlj0PD/z
-d8PCJ/j7Wzizw3d4s9uBIR1zpLY8lVgTivsj5FM3RP6hS7ww7I47goQshoL+YFVg
-NhE9I63oZXqFF130l9jJI9axHUqza7a42WCv04J8iv8SQhgv6fY9ZQnIBMQ4hPDH
-klGusdf4HlCbUViKhxmUpfj6FJabh2jV48ymaoTZB767GJyACF4mvnNDkenEXf41
-/wIDAQAB
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAv2bUqZgZmQNtkInIcery
+c/DQIbGdKgrdJ2+x45jOCITEf7QubgNmJAtw4OSNt30EXWGOrJXGD5Vb81o4ycEr
+f+bdTgCAG9fOipMxxDhT8AbSkAzYx9vGIcEwQP6VX5QhPlFxJJweeefEINNHkrm5
+KdmGpGxwe5AtTzxJiabWmJookKuoPxdy+5Am/EaCOIU6+HyM8i163L+DYDT+MF+e
+LFUVtpoZ4xVzvHhLMDwIsZWdpBrJcj9MVv3TOL0PQDAjyo/Gp2TWWRbiMaQ8vkfO
+NVSDAfvtOUlTBFcdt0oeLYL0F5Yj8wt5HYdL9GE6u+JOl+ee/dEUUhcmoFew9x9W
+YznHujitbmbQVPV1IYi4qIE4MyZPlmPmSyVg1bnt9UIgSTccqwUV6VzxF2fpwjvP
+tTo/sNLdtI3S/mprvzxTgv/gaB//1JAHXDKgUAtsgUyb6+RREjF2mFnAJb99H7sN
+5E89dIbI9v9CW5gJr0BoPYiDIZ1+HTUhW3+FCw+eNvPET+p8H5b9E+VXG/ctjac2
+7Lkexo4TOVJCN0p9kTdgCNzHrsJpyMkvsP8sR1SVvv94uC1X7sspIgFNcf/+YQ9t
+hzq+5L7GZgAyYy06xi+DYL4xR4oAOkirp/va1Yu4PaYGqly/Fbuw8ibJH1lmnu0G
+u3jRn1M2GBkVDNlb9oUHiecCAwEAAQ==
 -----END PUBLIC KEY-----

Modified: branches/gsoc11-rev-upgrade/base/portmgr/ReleaseProcess
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/ReleaseProcess	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/ReleaseProcess	2011-07-06 11:59:33 UTC (rev 80186)
@@ -39,9 +39,9 @@
    first creating the needed branch directory to preserve the required directory structure
    (the 'base' directory level *needs* to exist in each release branch, otherwise selfupdate breaks):
 
- svn mkdir -m "commit-message" http://svn.macports.org/repository/macports/branches/release_1_6
- svn cp [-r<rev>] -m "commit-message" http://svn.macports.org/repository/macports/trunk/base \
-     http://svn.macports.org/repository/macports/branches/release_1_6
+ svn mkdir -m "commit-message" https://svn.macports.org/repository/macports/branches/release_1_6
+ svn cp [-r<rev>] -m "commit-message" https://svn.macports.org/repository/macports/trunk/base \
+     https://svn.macports.org/repository/macports/branches/release_1_6
 
 The actual release, alpha or beta releases, release candidates, and any point releases will all
 live on this branch, and tagged appropriately and if necessary (a must for the actual releases,
@@ -88,8 +88,8 @@
 
 We first tag the branched base directory to make up the final release:
 
- svn cp -m "commit-message" http://svn.macports.org/repository/macports/branches/release_1_6 \
-     http://svn.macports.org/repository/macports/tags/release_1_6_0
+ svn cp -m "commit-message" https://svn.macports.org/repository/macports/branches/release_1_6 \
+     https://svn.macports.org/repository/macports/tags/release_1_6_0
 
 Although only the base subdirectory is branched and tagged for a given major release, we also create a
 separate tag for the entire tree (base sources and full ports tree) at the time the final release tag is
@@ -101,14 +101,14 @@
 revision of the final tagging of base and then switching the base directory to the appropriate release
 tag URL. For instance:
 
- svn co [-r<rev>] http://svn.macports.org/repository/macports/trunk release_1.6.0-archive
+ svn co [-r<rev>] https://svn.macports.org/repository/macports/trunk release_1.6.0-archive
  cd release_1.6.0-archive/base
- svn switch http://svn.macports.org/repository/macports/tags/release_1_6_0/base
+ svn switch https://svn.macports.org/repository/macports/tags/release_1_6_0/base
 
 And finally we tag the entire directory as release_1_6_0-archive:
 
  cd ../../
- svn cp -m "commit-message" release_1.6.0-archive http://svn.macports.org/repository/macports/tags/release_1_6_0-archive
+ svn cp -m "commit-message" release_1.6.0-archive https://svn.macports.org/repository/macports/tags/release_1_6_0-archive
 
 
 === Create & Post Release Tarballs ===
@@ -157,7 +157,7 @@
 
  cd work
  mv MacPorts-1.6.0.dmg MacPorts-1.6.0-10.5-Leopard.dmg
- 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
+ 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
 
 These new products, along with the new checksums, also have to be posted to the appropriate
 directory of the MacPorts distfiles server. Developers are required to validate the generated installer as
@@ -217,7 +217,7 @@
 
  * The macports-announce@, macports-users@ and macports-dev@ mailing lists.
  * The MacPorts website, by adapting the $macports_version_major and $macports_version_latest variables as appropriate in the trunk/www/includes/common.inc file.
- * [http://trac.macports.org/news/] The MacOSforge news section (submitter: portmgr@)
+ * [https://trac.macports.org/news/] The MacOSforge news section (submitter: portmgr@)
  * [http://www.apple.com/downloads/macosx/unix_open_source/macports.html Apple's downloads page] (submitter: jmpp@)
  * [http://freshmeat.net/projects/macports/ Freshmeat] (submitter: mww@)
  * [http://www.versiontracker.com/dyn/moreinfo/macosx/26679 VersionTracker] (submitter: mij@)

Modified: branches/gsoc11-rev-upgrade/base/portmgr/dmg/InstallationCheck
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/dmg/InstallationCheck	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/dmg/InstallationCheck	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # $Id$
 #

Modified: branches/gsoc11-rev-upgrade/base/portmgr/dmg/License.html
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/dmg/License.html	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/dmg/License.html	2011-07-06 11:59:33 UTC (rev 80186)
@@ -15,7 +15,7 @@
 
     <body>
     
-        <p>Copyright (c) 2002 - 2003, Apple Computer, Inc.<br>Copyright (c) 2004 - 2010, The MacPorts Project.</p>
+        <p>Copyright (c) 2002 - 2003, Apple Inc.<br>Copyright (c) 2004 - 2011, The MacPorts Project.</p>
         <p>All rights reserved.</p>
         <p><br></p>
         
@@ -26,7 +26,7 @@
             <li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
             <li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
             in the documentation and/or other materials provided with the distribution.</li>
-            <li>Neither the name of Apple Computer, Inc., The MacPorts Project nor the names of its contributors may be used to endorse or
+            <li>Neither the name of Apple Inc., The MacPorts Project nor the names of its contributors may be used to endorse or
             promote products derived from this software without specific prior written permission.</li>
         </ol>
         <p><br></p>

Modified: branches/gsoc11-rev-upgrade/base/portmgr/dmg/ReadMe.rtf
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/dmg/ReadMe.rtf	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/dmg/ReadMe.rtf	2011-07-06 11:59:33 UTC (rev 80186)
@@ -18,7 +18,7 @@
 System Requirements:
 \f0\b0 \
 \
-This disk image is built for Mac OS X __XVERS__.x and requires valid TCL, curl and OpenSSL installations to function - all present by default on Mac OS X. Also required is the installation of Apple's Xcode programing suite, available as a separate installation from your OS X CDs or DVD, or preferably the latest version from Apple's Developer site: {\field{\*\fldinst{HYPERLINK "http://developer.apple.com/tools/xcode/index.html"}}{\fldrslt http://developer.apple.com/tools/xcode/index.html}}.\
+This disk image is built for Mac OS X __XVERS__.x and requires valid Tcl, cURL and OpenSSL installations to function - all present by default on Mac OS X. Also required is the installation of Apple's Xcode programing suite, available as a separate installation from your OS X CDs or DVD, or preferably the latest version from Apple's Developer site: {\field{\*\fldinst{HYPERLINK "http://developer.apple.com/tools/xcode/index.html"}}{\fldrslt http://developer.apple.com/tools/xcode/index.html}}.\
 \
 \
 
@@ -99,7 +99,7 @@
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
 
 \f0\b0 \cf0 \
-The MacPorts Wiki is available at: {\field{\*\fldinst{HYPERLINK "http://trac.macports.org/projects/macports/wiki/"}}{\fldrslt http://trac.macports.org}} and should be consulted for further documentation and support. Also provided are man pages for 
+The MacPorts Wiki is available at: {\field{\*\fldinst{HYPERLINK "https://trac.macports.org/wiki"}}{\fldrslt https://trac.macports.org}} and should be consulted for further documentation and support. Also provided are man pages for 
 \f2\i port
 \f0\i0 , 
 \f2\i macports.conf

Modified: branches/gsoc11-rev-upgrade/base/portmgr/dmg/postflight
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/dmg/postflight	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/dmg/postflight	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,6 +1,7 @@
 #!/bin/bash
 # -*- 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
 #
+# Copyright (c) 2008-2011 The MacPorts Project
 # Copyright (c) 2002-2007 Juan Manuel Palacios <jmpp at macports.org>, The MacPorts Project.
 # All rights reserved.
 #
@@ -12,7 +13,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple, Inc., The MacPorts Project nor the
+# 3. Neither the name of The MacPorts Project nor the
 #    names of its contributors may be used to endorse or promote products
 #    derived from this software without specific prior written permission.
 #
@@ -45,6 +46,8 @@
 MANPAGES=${PREFIX}/share/man
 MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl
 REG1DIR=${MACPORTS_TCL_DIR}/registry1.0
+DSCL=/usr/bin/dscl
+RUNUSR=macports
 TCLSH=/usr/bin/tclsh
 TCL_PACKAGE_DIR=/Library/Tcl
 TIMESTAMP=$(date +"%Y-%m-%d_at_%H:%M:%S")
@@ -53,8 +56,8 @@
 
 # Create config files from defaults if not present
 function setup_configs {
-    for f in macports.conf sources.conf variants.conf ; do
-        if [ ! -f ${CONFIGPATH}/${f} ]; then
+    for f in macports.conf pubkeys.conf sources.conf variants.conf ; do
+        if [[ ! -f ${CONFIGPATH}/${f} ]]; then
             echo "Copying ${f}.default to ${f}"
             /bin/cp ${CONFIGPATH}/${f}.default ${CONFIGPATH}/${f}
             /bin/chmod 644 ${CONFIGPATH}/${f}
@@ -64,6 +67,13 @@
 
 # Command to update the MacPorts installation through "selfupdate":
 function update_macports {
+    # Add [default] tag to the central MacPorts repository, if it isn't already
+    echo "Adding [default] tag to sources.conf if needed..."
+    ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/upgrade_sources_conf_default.tcl ${PREFIX}
+    # Convert image directories (and direct mode installs) to image archives
+    echo "Updating port image format..."
+    ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/images_to_archives.tcl ${MACPORTS_TCL_DIR}
+
     echo "Synchronizing the MacPorts installation with the project's rsync server..."
     if ! ${BINPATH}/port -v selfupdate; then 
         echo "An attempt to synchronize your recent MacPorts installation with the project's rsync server failed!"
@@ -71,18 +81,13 @@
     else
         echo "Successful!"
     fi
-    
-    # Add [default] tag to the central MacPorts repository, if it isn't already
-    ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/upgrade_sources_conf_default.tcl ${PREFIX}
-    # Convert image directories (and direct mode installs) to image archives
-    ${TCLSH} ${PACKAGE_PATH}/Contents/Resources/images_to_archives.tcl ${MACPORTS_TCL_DIR}
 }
 
 # Through this command we write an environment variable to an appropriate shell configuration file,
 # backing up the original only if it exists and if it doesn't contain the ${OUR_STRING} identification string,
 # which hints that we've already tweaked it and therefore already backed it up.
 function write_setting () {
-    if [ -f ${HOME}/.${CONF_FILE} ] && ! grep "${OUR_STRING}" ${HOME}/.${CONF_FILE} > /dev/null; then
+    if [[ -f ${HOME}/.${CONF_FILE} ]] && ! grep "${OUR_STRING}" ${HOME}/.${CONF_FILE} > /dev/null; then
         echo "Backing up your ${HOME}/.${CONF_FILE} shell confguration file as ${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX} before adapting it for MacPorts."
         /bin/cp -fp ${HOME}/.${CONF_FILE} "${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX}" || {
             echo "An attempt to backup your original configuration file failed! Please set your MacPorts compatible environment manually."
@@ -112,7 +117,7 @@
 
 # Delete the old registry1.0 directory
 function delete_reg1 {
-    if [ -d ${REG1DIR} ]; then
+    if [[ -d ${REG1DIR} ]]; then
         rm -vrf ${REG1DIR}
     fi
 }
@@ -120,14 +125,31 @@
 # link macports1.0 into tcl package dir if possible
 function link_tcl_package {
     # delete old directory if present
-    if ! test -L "${TCL_PACKAGE_DIR}/macports1.0" && test -d "${TCL_PACKAGE_DIR}/macports1.0"; then
+    if [[ ! -L "${TCL_PACKAGE_DIR}/macports1.0" ]] && [[ -d "${TCL_PACKAGE_DIR}/macports1.0" ]]; then
         rm -vrf "${TCL_PACKAGE_DIR}/macports1.0" || true
     fi
-    if ! test -e "${TCL_PACKAGE_DIR}/macports1.0" && test -w "${TCL_PACKAGE_DIR}"; then
+    if [[ ! -e "${TCL_PACKAGE_DIR}/macports1.0" ]] && [[ -w "${TCL_PACKAGE_DIR}" ]]; then
 		ln -vs "${MACPORTS_TCL_DIR}/macports1.0" "${TCL_PACKAGE_DIR}/macports1.0" || true
 	fi
 }
 
+# create the user to use for privilege dropping
+function create_run_user {
+    DSEDITGROUP=/usr/sbin/dseditgroup
+    if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then
+        echo "Creating group \"${RUNUSR}\""
+        ${DSEDITGROUP} -q -o create -n . ${RUNUSR}
+    fi
+    if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then
+        echo "Creating user \"${RUNUSR}\""
+        ${DSCL} -q . -create /Users/${RUNUSR} Password *
+        ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $(($(${DSCL} . -list /Users UniqueID | /usr/bin/awk '{print $2}' | sort -ug | tail -1)+1))
+        ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $2}')
+        ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /var/empty
+        ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false
+    fi
+}
+
 echo "The MacPorts Project, postflight script version ${VERSION}: checking the shell environment for user \"${USER}\"."
 
 # Set up config files
@@ -141,7 +163,7 @@
 
 # Determine the user's shell, in order to choose an appropriate configuration file we'll be tweaking.
 # Exit nicely if the shell is any other than bash or tcsh, as that's considered non-standard.
-USHELL=$(dscl . -read /users/${USER} shell | awk -F'/' '{print $NF}') || {
+USHELL=$(${DSCL} . -read /Users/${USER} shell | awk -F'/' '{print $NF}') || {
     echo "An attempt to determine your shell name failed! Please set your MacPorts compatible environment manually."
     update_macports
     exit 1
@@ -152,9 +174,9 @@
         LOGIN_FLAG=""
         ENV_COMMAND="setenv"
         ASSIGN=" "
-        if [ -f ${HOME}/.tcshrc ]; then
+        if [[ -f ${HOME}/.tcshrc ]]; then
             CONF_FILE=tcshrc
-        elif [ -f ${HOME}/.cshrc ]; then
+        elif [[ -f ${HOME}/.cshrc ]]; then
             CONF_FILE=cshrc
         else
             CONF_FILE=tcshrc
@@ -165,9 +187,9 @@
         LOGIN_FLAG="-l"
         ENV_COMMAND="export"
         ASSIGN="="
-        if [ -f ${HOME}/.bash_profile ]; then
+        if [[ -f ${HOME}/.bash_profile ]]; then
             CONF_FILE=bash_profile
-        elif [ -f ${HOME}/.bash_login ]; then
+        elif [[ -f ${HOME}/.bash_login ]]; then
             CONF_FILE=bash_login
         else
             CONF_FILE=profile
@@ -193,15 +215,15 @@
 # Adding our setting to the MANPATH variable only if it exists:
 if ! ${SHELL} ${LOGIN_FLAG} -c "/usr/bin/env | grep MANPATH" > /dev/null || \
 # and following that, if it's not empty:
-  [ -z "${ORIGINAL_MANPATH}" ] || \
+  [[ -z "${ORIGINAL_MANPATH}" ]] || \
 # or if it doesn't already contain our path:
   echo "${ORIGINAL_MANPATH}" | grep ${MANPAGES} > /dev/null || \
 # or if there's no empty component somewhere in the middle of it:
   echo "${ORIGINAL_MANPATH}" | grep :: > /dev/null || \
 # or at the start of it:
-  [ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $1}')" ] || \
+  [[ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $1}')" ]] || \
 # or at the end of it:
-  [ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $NF}')" ]; then
+  [[ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $NF}')" ]]; then
     echo "Your shell already has the right MANPATH environment variable for use with MacPorts!"
 else
     write_setting MANPATH "${MANPAGES}:\$MANPATH"

Modified: branches/gsoc11-rev-upgrade/base/portmgr/fedora/macports.spec
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/fedora/macports.spec	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/fedora/macports.spec	2011-07-06 11:59:33 UTC (rev 80186)
@@ -4,8 +4,8 @@
 Release: 0%{?dist}
 License: BSD
 Group: System Environment/Base
-URL: http://www.macports.org
-Source: http://svn.macosforge.org/repository/macports/distfiles/MacPorts/MacPorts-%{version}.tar.bz2
+URL: http://www.macports.org/
+Source: https://svn.macports.org/repository/macports/distfiles/MacPorts/MacPorts-%{version}.tar.bz2
 Prefix: /opt/local
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 


Property changes on: branches/gsoc11-rev-upgrade/base/portmgr/fedora/macports.spec
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base/portmgr/fedora/macports.spec:37343-46937
/branches/universal-sanity/base/portmgr/fedora/macports.spec:51872-52323
/branches/variant-descs-14482/base/portmgr/fedora/macports.spec:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/portmgr/fedora/macports.spec.in:30388-57826
/users/perry/base-bugs_and_notes/portmgr/fedora/macports.spec:45682-46060
/users/perry/base-select/portmgr/fedora/macports.spec:44044-44692
   + /branches/gsoc08-privileges/base/portmgr/fedora/macports.spec:37343-46937
/branches/universal-sanity/base/portmgr/fedora/macports.spec:51872-52323
/branches/variant-descs-14482/base/portmgr/fedora/macports.spec:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/portmgr/fedora/macports.spec:78828-80185
/trunk/base/portmgr/fedora/macports.spec.in:30388-57826
/users/perry/base-bugs_and_notes/portmgr/fedora/macports.spec:45682-46060
/users/perry/base-select/portmgr/fedora/macports.spec:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/GuideRegen.sh
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/GuideRegen.sh	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/GuideRegen.sh	2011-07-06 11:59:33 UTC (rev 80186)
@@ -17,7 +17,7 @@
 
 # Other settings (probably don't need to be changed).
 SVN_CONFIG_DIR=${ROOT}/svnconfig
-REPO_BASE=http://svn.macports.org/repository/macports
+REPO_BASE=https://svn.macports.org/repository/macports
 SVN="/opt/local/bin/svn -q --non-interactive --config-dir $SVN_CONFIG_DIR"
 # Where to checkout the source code. This needs to exist!
 SRCTREE=${ROOT}/source

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/PortIndex2MySQL.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/PortIndex2MySQL.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/PortIndex2MySQL.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -9,7 +9,7 @@
 # $Id$
 #
 # Copyright (c) 2007 Juan Manuel Palacios, The MacPorts Project.
-# Copyright (c) 2003 Apple Computer, Inc.
+# Copyright (c) 2003 Apple Inc.
 # Copyright (c) 2002 Kevin Van Vechten. 
 # All rights reserved.
 #
@@ -21,7 +21,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/mprsyncup
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/mprsyncup	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/mprsyncup	2011-07-06 11:59:33 UTC (rev 80186)
@@ -20,7 +20,7 @@
 #
 # Lastly, it is required of every 3rd party mirrors to keep track of this script
 # and the base/portmgr/rsync.repos file and always maintain local copies in as
-# close sync as possible. 
+# close sync as possible.
 #
 #
 # Created by fkr at opendarwin.org, jberry at macports.org and yeled at macports.org,
@@ -38,6 +38,8 @@
 RM="/bin/rm"
 MKDIR="/bin/mkdir"
 LN="/bin/ln"
+TAR="/usr/bin/tar"
+OPENSSL="/usr/bin/openssl"
 
 # Paths we'll work on:
 ROOT=/var/tmp/macports
@@ -54,7 +56,7 @@
 PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
 
 # platforms we generate indexes for
-PLATFORMS="8_ppc 8_i386 9_ppc 9_i386 10_i386"
+PLATFORMS="8_powerpc 8_i386 9_powerpc 9_i386 10_i386 11_i386"
 # copy new index of this platform to old index location for MP v1.8 compatability
 OLD_INDEX_PLATFORM="9_i386"
 
@@ -62,9 +64,13 @@
 MP_GROUP=nobody
 
 # Sources information:
-SVNURL=http://svn.macports.org/repository/macports
+SVNURL=https://svn.macports.org/repository/macports
 RELEASE_URL_FILE=config/RELEASE_URL
 
+# private key to use for signing
+# XXX set real path
+PRIVKEY=""
+
 # cleanup up the working copy if it is locked
 if [ -f ${TBASE}/.svn/lock ]; then
     ${CLEANUP} ${TBASE}
@@ -97,7 +103,7 @@
 if [ ! -d ${RSYNCROOT}/release/base ]; then
     ${MKDIR} -p ${RSYNCROOT}/release/base
 fi
-${RSYNC} -aIC --delete ${RBASE}/ ${RSYNCROOT}/release/base 
+${RSYNC} -aIC --delete ${RBASE}/ ${RSYNCROOT}/release/base
 
 # clean up the working copy if it is locked
 if [ -f ${PORTS}/.svn/lock ]; then
@@ -106,7 +112,7 @@
 
 # Update/checkout the ports tree, export it and rsync it to ${RSYNCROOT}/release/ports:
 if [ -d ${PORTS}/.svn ]; then
-    ${SVN} update ${PORTS}  
+    ${SVN} update ${PORTS}
 else
     ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
 fi
@@ -115,15 +121,15 @@
 pushd ${PORTS} >> /dev/null
 # build MP trunk in a private location for indexing
 pushd ${ROOT}/${TMPDIR} >> /dev/null
-mkdir -p ${TCLPKG} 
+${MKDIR} -p ${TCLPKG}
 ./configure \
     --prefix=${PREFIX} \
     --with-tclpackage=${TCLPKG} \
     --with-install-user=${MP_USER} \
-    --with-install-group=${MP_GROUP} 
-make clean 
+    --with-install-group=${MP_GROUP}
+make clean
 make
-make install 
+make install
 popd
 
 for PLATFORM in $PLATFORMS; do
@@ -146,3 +152,22 @@
     ${RM} -rf dports && ${LN} -s ../release/ports dports
 fi
 
+# generate and sign tarballs of base and dports
+# the signature always needs to match, so we try to make this look atomic to
+# clients by switching a symlink target
+
+TAR_CURDIR=${RSYNCROOT}/release/tarballs_current
+${MKDIR} -p ${TAR_CURDIR}
+cp -pR ${TAR_CURDIR} ${RSYNCROOT}/release/tarballs_old
+${LN} -sfh tarballs_old ${RSYNCROOT}/release/tarballs
+${TAR} -C ${RSYNCROOT}/release/ -cf ${TAR_CURDIR}/base.tar base
+${TAR} --exclude 'PortIndex*' -C ${RSYNCROOT}/release/ -cf ${TAR_CURDIR}/ports.tar ports
+cp -pR ${RSYNCROOT}/release/ports/PortIndex_* ${TAR_CURDIR}
+# XXX needs PRIVKEY to be set above
+#${OPENSSL} dgst -ripemd160 -sign ${PRIVKEY} -out ${TAR_CURDIR}/base.tar.rmd160 ${TAR_CURDIR}/base.tar
+#${OPENSSL} dgst -ripemd160 -sign ${PRIVKEY} -out ${TAR_CURDIR}/ports.tar.rmd160 ${TAR_CURDIR}/ports.tar
+for index in ${TAR_CURDIR}/PortIndex_*/PortIndex; do
+    #${OPENSSL} dgst -ripemd160 -sign ${PRIVKEY} -out ${index}.rmd160 ${index}
+done
+${LN} -sfh tarballs_current ${RSYNCROOT}/release/tarballs
+${RM} -rf ${RSYNCROOT}/release/tarballs_old

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/port_binary_distributable.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -6,6 +6,8 @@
 # Check that binaries of a port are distributable by looking at its license
 # and the licenses of its dependencies.
 #
+# Expected format: A {B C} means the license is A plus either B or C.
+#
 # Exit status:
 # 0: distributable
 # 1: non-distributable
@@ -19,9 +21,9 @@
 set check_deptypes {depends_build depends_lib}
 
 set good_licenses {agpl apache apsl artistic boost bsd cecill cpl curl \
-                   fontconfig freebsd gfdl gpl ibmpl ijg jasper lgpl libpng \
-                   mit mpl openssl php psf qpl public-domain ruby sleepycat \
-                   ssleay x11 zlib zpl}
+                   fontconfig freebsd freetype gfdl gpl ibmpl ijg jasper \
+                   lgpl libpng mit mpl openssl php psf qpl public-domain \
+                   ruby sleepycat ssleay x11 zlib zpl}
 foreach lic $good_licenses {
     set license_good($lic) 1
 }
@@ -80,7 +82,14 @@
         }
     }
 
-    return [list $dependencyList $portInfo(license)]
+    set ret [list $dependencyList $portInfo(license)]
+    if {[info exists portInfo(installs_libs)]} {
+        lappend ret $portInfo(installs_libs)
+    } else {
+        # when in doubt, assume code from the dep is incorporated
+        lappend ret yes
+    }
+    return $ret
 }
 
 # return license with any trailing dash followed by a number and/or plus sign removed
@@ -100,49 +109,93 @@
     set top_license [lindex $top_info 1]
     set top_license_names {}
     # check that top-level port's license(s) are good
-    foreach full_lic $top_license {
-        # chop off any trailing version number
-        set lic [remove_version [string tolower $full_lic]]
-        # add name to the list for later
-        lappend top_license_names $lic
-        if {![info exists license_good($lic)]} {
+    foreach sublist $top_license {
+        # each element may be a list of alternatives (i.e. only one need apply)
+        set any_good 0
+        set sub_names {}
+        foreach full_lic $sublist {
+            # chop off any trailing version number
+            set lic [remove_version [string tolower $full_lic]]
+            # add name to the list for later
+            lappend sub_names $lic
+            if {[info exists license_good($lic)]} {
+                set any_good 1
+            }
+        }
+        lappend top_license_names $sub_names
+        if {!$any_good} {
             if {$verbose} {
                 puts "'$portName' has license '$lic' which is not known to be distributable"
             }
             return 1
         }
     }
+
     # start with deps of top-level port
     set portList [lindex $top_info 0]
     while {[llength $portList] > 0} {
         set aPort [lindex $portList 0]
+        # mark as seen and remove from the list
+        set portSeen($aPort) 1
+        set portList [lreplace $portList 0 0]
+
         set aPortInfo [infoForPort $aPort $variantInfo]
         set aPortLicense [lindex $aPortInfo 1]
-        foreach full_lic $aPortLicense {
+        set installs_libs [lindex $aPortInfo 2]
+        if {!$installs_libs} {
+            continue
+        }
+        foreach sublist $aPortLicense {
+            set any_good 0
+            set any_compatible 0
             # check that this dependency's license(s) are good
-            set lic [remove_version [string tolower $full_lic]]
-            if {![info exists license_good($lic)]} {
+            foreach full_lic $sublist {
+                set lic [remove_version [string tolower $full_lic]]
+                if {[info exists license_good($lic)]} {
+                    set any_good 1
+                } else {
+                    # no good being compatible with other licenses if it's not distributable itself
+                    continue
+                }
+
+                # ... and that they don't conflict with the top-level port's
+                set any_conflict 0
+                foreach top_sublist [concat $top_license $top_license_names] {
+                    set any_sub_compatible 0
+                    foreach top_lic $top_sublist {
+                        if {![info exists license_conflicts([string tolower $top_lic])]
+                            || ([lsearch -sorted $license_conflicts([string tolower $top_lic]) $lic] == -1
+                            && [lsearch -sorted $license_conflicts([string tolower $top_lic]) [string tolower $full_lic]] == -1)} {
+                            set any_sub_compatible 1
+                            break
+                        }
+                    }
+                    if {!$any_sub_compatible} {
+                        set any_conflict 1
+                        break
+                    }
+                }
+                if {!$any_conflict} {
+                    set any_compatible 1
+                    break
+                }
+            }
+
+            if {!$any_good} {
                 if {$verbose} {
                     puts "dependency '$aPort' has license '$lic' which is not known to be distributable"
                 }
                 return 1
             }
-            # ... and that they don't conflict with the top-level port's
-            foreach top_lic [concat $top_license $top_license_names] {
-                if {[info exists license_conflicts([string tolower $top_lic])]
-                    && ([lsearch -sorted $license_conflicts([string tolower $top_lic]) $lic] != -1
-                    || [lsearch -sorted $license_conflicts([string tolower $top_lic]) [string tolower $full_lic]] != -1)} {
-                    if {$verbose} {
-                        puts "dependency '$aPort' has license '$full_lic' which conflicts with license '$top_lic' from '$portName'"
-                    }
-                    return 1
+            if {!$any_compatible} {
+                if {$verbose} {
+                    puts "dependency '$aPort' has license '$full_lic' which conflicts with license '$top_lic' from '$portName'"
                 }
+                return 1
             }
         }
 
-        # mark it seen and add its deps to the list
-        set portSeen($aPort) 1
-        set portList [lreplace $portList 0 0]
+        # add its deps to the list
         foreach possiblyNewPort [lindex $aPortInfo 0] {
             if {![info exists portSeen($possiblyNewPort)]} {
                 lappend portList $possiblyNewPort

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_lint.pl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_lint.pl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_lint.pl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -14,7 +14,7 @@
 $ENV{'LANG'} = 'en_US.UTF-8';
 
 my $REPOPATH = "/svn/repositories/macports/";
-my $REPOHOST = "http://svn.macosforge.org/repository/macports";
+my $REPOHOST = "https://svn.macports.org/repository/macports";
 my $SVNLOOK = "/opt/local/bin/svnlook";
 
 # use a release (non-trunk) version of port
@@ -96,7 +96,7 @@
 	     To => "$author, $maintainers",
 	     From => 'noreply at macports.org',
 	     Subject => "[$rev] $port Lint Report",
-	     Message => "Change: http://trac.macports.org/changeset/$rev\nPortfile: $port\n\n$errors \n\n",
+	     Message => "Change: https://trac.macports.org/changeset/$rev\nPortfile: $port\n\n$errors \n\n",
 	     smtp => 'relay.apple.com',
 	     );
 

Modified: branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_mirror.pl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_mirror.pl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/jobs/portfile_mirror.pl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,7 +11,7 @@
 my $EXCLUSIONS = ('molden');
 
 my $REPOPATH = "/svn/repositories/macports/";
-my $REPOHOST = "http://svn.macosforge.org/repository/macports";
+my $REPOHOST = "https://svn.macports.org/repository/macports";
 my $SVNLOOK = "/opt/local/bin/svnlook";
 my $PORTCMD = "/opt/local/bin/port";
 my $SVN = "/opt/local/bin/svn -q --non-interactive";

Modified: branches/gsoc11-rev-upgrade/base/portmgr/packaging/dpkgall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/packaging/dpkgall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/packaging/dpkgall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,9 +2,10 @@
 # dpkgbuild.tcl
 # $Id$
 #
+# Copyright (c) 2009-2011 The MacPorts Project
 # Copyright (c) 2004 Landon Fuller <landonf at macports.org>
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -15,7 +16,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -708,7 +709,7 @@
 			set port [lindex $portlist 0]
 
 			ui_msg "Uninstalling $port."
-			if { [catch {registry_uninstall::uninstall $portname $portversion} result] } {
+			if { [catch {registry_uninstall::uninstall $portname $portversion "" 0 [array get options]} result] } {
 				global errorInfo
 				ui_debug "$errorInfo"
 				ui_noisy_errorr "Fatal error: Uninstalling $port failed: $result"

Modified: branches/gsoc11-rev-upgrade/base/portmgr/packaging/mpkgall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/packaging/mpkgall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/packaging/mpkgall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,7 +3,7 @@
 # $Id$
 #
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/portmgr/packaging/packageall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/packaging/packageall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/packaging/packageall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # packageall.tcl
 # $Id$
 #
+# Copyright (c) 2009-2011 The MacPorts Project
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/portmgr/packaging/rpmall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/portmgr/packaging/rpmall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/portmgr/packaging/rpmall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,9 +2,10 @@
 # rpmall.tcl
 # $Id$
 #
+# Copyright (c) 2009-2011 The MacPorts Project
 # Copyright (c) 2003 Benjamin Reed <ranger at befunk.com>
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -15,7 +16,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/cregistry/entry.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/cregistry/entry.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/cregistry/entry.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,6 +2,7 @@
  * entry.c
  * $Id$
  *
+ * Copyright (c) 2010-2011 The MacPorts Project
  * Copyright (c) 2007 Chris Pickel <sfiera at macports.org>
  * All rights reserved.
  *

Modified: branches/gsoc11-rev-upgrade/base/src/darwintracelib1.0/darwintrace.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/darwintracelib1.0/darwintrace.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/darwintracelib1.0/darwintrace.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2005 Apple Inc. All rights reserved.
  * Copyright (c) 2005-2006 Paul Guyot <pguyot at kallisys.net>,
  * All rights reserved.
  *
@@ -16,7 +16,7 @@
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission. 
  * 
@@ -163,15 +163,15 @@
 
 #if __STDC_VERSION__>=199901L
 #if DARWINTRACE_DEBUG_OUTPUT
-#define dprintf(...) fprintf(stderr, __VA_ARGS__)
+#define debug_printf(...) fprintf(stderr, __VA_ARGS__)
 #else
-#define dprintf(...)
+#define debug_printf(...)
 #endif
 #else
 #if DARWINTRACE_DEBUG_OUTPUT
 __attribute__ ((format (printf, 1, 2)))
 static inline
-int dprintf(const char *format, ...) {
+int debug_printf(const char *format, ...) {
     int ret;
     va_list args;
     va_start(args, format);
@@ -180,7 +180,7 @@
     return ret;
 }
 #else
-#define dprintf(format, param)
+#define debug_printf(format, param)
 #endif
 #endif
 
@@ -362,11 +362,11 @@
 			strncpy(sun.sun_path, __env_darwintrace_log, sizeof(sun.sun_path));
 			if(connect(sock, (struct sockaddr*)&sun, strlen(__env_darwintrace_log)+1+sizeof(sun.sun_family))!=-1)
 			{
-				dprintf("darwintrace: connect successful. socket %d\n", sock);
+				debug_printf("darwintrace: connect successful. socket %d\n", sock);
 				__darwintrace_fd=sock;
 				ask_for_filemap();
 			} else {
-				dprintf("connect failed: %s\n", strerror(errno));
+				debug_printf("connect failed: %s\n", strerror(errno));
 				abort();
 			}
 			errno = olderrno;
@@ -469,7 +469,7 @@
     }
   }
 
-  dprintf("darwintrace: cleanup resulted in %s\n", path);
+  debug_printf("darwintrace: cleanup resulted in %s\n", path);
 }
 
 /*
@@ -663,7 +663,7 @@
 		__darwintrace_setup();
 		isInSandbox = __darwintrace_is_in_sandbox(path, newpath);
 		if (isInSandbox == 0) {
-			dprintf("darwintrace: creation/writing was forbidden at %s\n", path);
+			debug_printf("darwintrace: creation/writing was forbidden at %s\n", path);
 			errno = EACCES;
 			result = -1;
 		}
@@ -809,10 +809,10 @@
 	int result = 0;
 	int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
 	if (isInSandbox == 1) {
-		dprintf("darwintrace: unlink was allowed at %s\n", path);
+		debug_printf("darwintrace: unlink was allowed at %s\n", path);
 	} else if (isInSandbox == 0) {
 		/* outside sandbox, but sandbox is defined: forbid */
-		dprintf("darwintrace: unlink was forbidden at %s\n", path);
+		debug_printf("darwintrace: unlink was forbidden at %s\n", path);
 		errno = EACCES;
 		result = -1;
 	}
@@ -831,7 +831,7 @@
 	int result = 0;
 	int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
 	if (isInSandbox == 1) {
-		dprintf("darwintrace: mkdir was allowed at %s\n", path);
+		debug_printf("darwintrace: mkdir was allowed at %s\n", path);
 	} else if (isInSandbox == 0) {
 		/* outside sandbox, but sandbox is defined: forbid */
 		/* only consider directories that do not exist. */
@@ -840,7 +840,7 @@
 		err = lstat(path, &theInfo);
 		if ((err == -1) && (errno == ENOENT))
 		{
-			dprintf("darwintrace: mkdir was forbidden at %s\n", path);
+			debug_printf("darwintrace: mkdir was forbidden at %s\n", path);
 			errno = EACCES;
 			result = -1;
 		} /* otherwise, mkdir will do nothing (directory exists) or fail
@@ -861,10 +861,10 @@
 	int result = 0;
 	int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
 	if (isInSandbox == 1) {
-		dprintf("darwintrace: rmdir was allowed at %s\n", path);
+		debug_printf("darwintrace: rmdir was allowed at %s\n", path);
 	} else if (isInSandbox == 0) {
 		/* outside sandbox, but sandbox is defined: forbid */
-		dprintf("darwintrace: removing directory %s was forbidden\n", path);
+		debug_printf("darwintrace: removing directory %s was forbidden\n", path);
 		errno = EACCES;
 		result = -1;
 	}
@@ -883,10 +883,10 @@
 	int result = 0;
 	int isInSandbox = __darwintrace_is_in_sandbox(from, 0);
 	if (isInSandbox == 1) {
-		dprintf("darwintrace: rename was allowed at %s\n", from);
+		debug_printf("darwintrace: rename was allowed at %s\n", from);
 	} else if (isInSandbox == 0) {
 		/* outside sandbox, but sandbox is defined: forbid */
-		dprintf("darwintrace: renaming from %s was forbidden\n", from);
+		debug_printf("darwintrace: renaming from %s was forbidden\n", from);
 		errno = EACCES;
 		result = -1;
 	}
@@ -894,10 +894,10 @@
 	if (result == 0) {
 		isInSandbox = __darwintrace_is_in_sandbox(to, 0);
 		if (isInSandbox == 1) {
-			dprintf("darwintrace: rename was allowed at %s\n", to);
+			debug_printf("darwintrace: rename was allowed at %s\n", to);
 		} else if (isInSandbox == 0) {
 			/* outside sandbox, but sandbox is defined: forbid */
-			dprintf("darwintrace: renaming to %s was forbidden\n", to);
+			debug_printf("darwintrace: renaming to %s was forbidden\n", to);
 			errno = EACCES;
 			result = -1;
 		}

Modified: branches/gsoc11-rev-upgrade/base/src/images_to_archives.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/images_to_archives.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/images_to_archives.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -8,9 +8,15 @@
 source [file join [lindex $argv 0] macports1.0 macports_fastload.tcl]
 package require macports 1.0
 package require registry 1.0
+package require registry2 2.0
+package require Pextlib 1.0
 
-mportinit
+umask 022
 
+array set ui_options {ports_verbose yes}
+
+mportinit ui_options
+
 # always converting to tbz2 should be fine as both these programs are
 # needed elsewhere and assumed to be available
 set tarcmd [macports::findBinary tar ${macports::autoconf::tar_path}]
@@ -24,6 +30,10 @@
 
 puts "This could take a while..."
 
+# list of ports we successfully create an archive of, to be used to update
+# the registry only after we know all creation attempts were successful.
+set archived_list {}
+
 foreach installed $ilist {
     set iname [lindex $installed 0]
     set iversion [lindex $installed 1]
@@ -79,15 +89,7 @@
         } else {
             set targetdir [file join ${macports::registry.path} software ${iname}]
             file mkdir $targetdir
-            if {${macports::registry.format} == "receipt_sqlite"} {
-                set contents [$iref imagefiles]
-            } else {
-                set contents {}
-                set rawcontents [registry::property_retrieve $iref contents]
-                foreach entry $rawcontents {
-                    lappend contents [lindex $entry 0]
-                }
-            }
+            set contents [$iref imagefiles]
         }
         set newlocation [file join $targetdir $archivename]
 
@@ -109,51 +111,35 @@
             file delete -force ${targetdir}/tarlist ${targetdir}/error.log
         }
 
+        lappend archived_list [list $installtype $iref $location $newlocation]
+    }
+}
+
+registry::write {
+    foreach archived $archived_list {
+        set installtype [lindex $archived 0]
+        set iref [lindex $archived 1]
+        set newlocation [lindex $archived 3]
+    
         if {$installtype == "direct"} {
             # change receipt to image
-            if {${macports::registry.format} == "receipt_sqlite"} {
-                $iref installtype image
-                $iref state imaged
-                $iref activate [$iref imagefiles]
-                $iref state installed
-            } else {
-                registry::property_store $iref installtype image
-                foreach entry $contents {
-                    registry::register_file $entry $iname
-                }
-                registry::property_store $iref active 1
-            }
+            $iref installtype image
+            $iref state imaged
+            $iref activate [$iref imagefiles]
+            $iref state installed
         }
+    
+        # set the new location in the registry and delete the old dir
+        $iref location $newlocation
+    }
+}
 
-        if {${macports::registry.format} == "flat" && $installtype == "image"} {
-            # flat receipts also need file paths in contents trimmed to exclude image dir
-            set loclen [string length $location]
-            set locend [expr $loclen - 1]
-            set oldcontents [registry::property_retrieve $iref contents]
-            set newcontents {}
-            foreach fe $contents {
-                set oldfilepath [lindex $fe 0]
-                if {[string range $oldfilepath 0 $locend] == $location} {
-                    set newfilepath [string range $oldfilepath $loclen end]
-                    set newentry [list $newfilepath]
-                    foreach other [lrange $fe 1 end] {
-                        lappend newentry $other
-                    }
-                    lappend newcontents $newentry
-                } else {
-                    lappend newcontents $fe
-                }
-            }
-            registry::property_store $iref contents $newcontents
+foreach archived $archived_list {
+    set location [lindex $archived 2]
+    if {$location != "" && [file isdirectory $location]} {
+        if {[catch {file delete -force $location} result]} {
+            ui_warn "Failed to delete ${location}: $result"
         }
-        # set the new location in the registry and delete the old dir
-        registry::property_store $iref location $newlocation
-        if {${macports::registry.format} == "flat"} {
-            registry::write_entry $iref
-        }
-        if {$location != "" && [file isdirectory $location]} {
-            file delete -force $location
-        }
     }
 }
 

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -32,11 +32,16 @@
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 pkgIndex.tcl ${INSTALLDIR}
 
 	echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
-	if test -z "${DESTDIR}" && test "${INSTALLPKGLINK}" != "${INSTALLDIR}" && test -w "${TCL_PACKAGE_DIR}"; then \
-		if ! test -L "${INSTALLPKGLINK}" && test -d "${INSTALLPKGLINK}"; then \
-			rm -rf "${INSTALLPKGLINK}" || true; \
+	if test -z "${DESTDIR}" -a "${INSTALLPKGLINK}" != "${INSTALLDIR}"; then \
+		if test ! -d "${TCL_PACKAGE_DIR}"; then \
+			$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
 		fi; \
-		if ! test -e "${INSTALLPKGLINK}"; then \
-			ln -s "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
+		if test -w "${TCL_PACKAGE_DIR}"; then \
+			if test ! -L "${INSTALLPKGLINK}" && test -d "${INSTALLPKGLINK}"; then \
+				rm -rf "${INSTALLPKGLINK}" || true; \
+			fi; \
+			if test ! -e "${INSTALLPKGLINK}"; then \
+				ln -s "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
+			fi; \
 		fi; \
 	fi

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,10 +2,11 @@
 # macports.tcl
 # $Id$
 #
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 - 2003 Apple Inc.
 # Copyright (c) 2004 - 2005 Paul Guyot, <pguyot at kallisys.net>.
 # Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb at opendarwin.org>.
 # Copyright (c) 2004 - 2005 Robert Shaw <rshaw at opendarwin.org>
+# Copyright (c) 2004 - 2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -16,7 +17,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #
@@ -129,7 +130,7 @@
 proc macports::ch_logging {mport} {
     global ::debuglog ::debuglogname
 
-    set portname [_mportkey $mport name]
+    set portname [_mportkey $mport subport]
     set portpath [_mportkey $mport portpath]
 
     ui_debug "Starting logging for $portname"
@@ -369,7 +370,13 @@
                 if {[regexp {Xcode ([0-9.]+)} $xcodebuildversion - xcode_v] == 1} {
                     set macports::xcodeversion $xcode_v
                 } elseif {[regexp "DevToolsCore-(.*);" $xcodebuildversion - devtoolscore_v] == 1} {
-                    if {$devtoolscore_v >= 921.0} {
+                    if {$devtoolscore_v >= 1809.0} {
+                        set macports::xcodeversion "3.2.6"
+                    } elseif {$devtoolscore_v >= 1204.0} {
+                        set macports::xcodeversion "3.1.4"
+                    } elseif {$devtoolscore_v >= 1100.0} {
+                        set macports::xcodeversion "3.1"
+                    } elseif {$devtoolscore_v >= 921.0} {
                         set macports::xcodeversion "3.0"
                     } elseif {$devtoolscore_v >= 798.0} {
                         set macports::xcodeversion "2.5"
@@ -708,7 +715,7 @@
         global macports::rsync_server
     }
     if {![info exists rsync_dir]} {
-        set macports::rsync_dir release/base/
+        set macports::rsync_dir release/tarballs/base.tar
         global macports::rsync_dir
     }
     if {![info exists rsync_options]} {
@@ -938,35 +945,30 @@
         }
     }
     
-    # init registry if needed
-    if {${registry.format} == "receipt_sqlite"} {
-        set db_path [file join ${registry.path} registry registry.db]
-        set db_exists [file exists $db_path]
-        registry::open $db_path
-        # for the benefit of the portimage code that is called from multiple interpreters
-        global registry_open
-        set registry_open yes
-        # convert any flat receipts if we just created a new db
-        if {$db_exists == 0 && [file writable $db_path]} {
-            ui_warn "Converting your registry to sqlite format, this might take a while..."
-            if {[catch {registry::convert_to_sqlite}]} {
-                ui_debug "$::errorInfo"
-                file delete -force $db_path
-                error "Failed to convert your registry to sqlite!"
-            } else {
-                ui_warn "Successfully converted your registry to sqlite!"
-            }
+    # init registry
+    set db_path [file join ${registry.path} registry registry.db]
+    set db_exists [file exists $db_path]
+    registry::open $db_path
+    # for the benefit of the portimage code that is called from multiple interpreters
+    global registry_open
+    set registry_open yes
+    # convert any flat receipts if we just created a new db
+    if {$db_exists == 0 && [file writable $db_path]} {
+        ui_warn "Converting your registry to sqlite format, this might take a while..."
+        if {[catch {registry::convert_to_sqlite}]} {
+            ui_debug "$::errorInfo"
+            file delete -force $db_path
+            error "Failed to convert your registry to sqlite!"
+        } else {
+            ui_warn "Successfully converted your registry to sqlite!"
         }
     }
 }
 
 # call this just before you exit
 proc mportshutdown {} {
-    global macports::registry.format
-    if {${registry.format} == "receipt_sqlite"} {
-        # close it down so the cleanup stuff is called, e.g. vacuuming the db
-        registry::close
-    }
+    # close it down so the cleanup stuff is called, e.g. vacuuming the db
+    registry::close
 }
 
 proc macports::worker_init {workername portpath porturl portbuildpath options variations} {
@@ -1039,6 +1041,7 @@
     $workername alias registry_exists_for_name registry::entry_exists_for_name
     $workername alias registry_activate portimage::activate
     $workername alias registry_deactivate portimage::deactivate
+    $workername alias registry_deactivate_composite portimage::deactivate_composite
     $workername alias registry_uninstall registry_uninstall::uninstall
     $workername alias registry_register_deps registry::register_dependencies
     $workername alias registry_fileinfo_for_index registry::fileinfo_for_index
@@ -1122,25 +1125,83 @@
     return $result
 }
 
-proc macports::fetch_port {url} {
+proc macports::get_tar_flags {suffix} {
+    switch -- $suffix {
+        .tbz -
+        .tbz2 {
+            return "-j"
+        }
+        .tgz {
+            return "-z"
+        }
+        .txz {
+            return "--use-compress-program [findBinary xz {}] -"
+        }
+        .tlz {
+            return "--use-compress-program [findBinary lzma {}] -"
+        }
+        default {
+            return "-"
+        }
+    }
+}
+
+proc macports::fetch_port {url {local 0}} {
     global macports::portdbpath
     set fetchdir [file join $portdbpath portdirs]
-    set fetchfile [file tail $url]
     file mkdir $fetchdir
     if {![file writable $fetchdir]} {
         return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
     }
-    if {[catch {curl fetch $url [file join $fetchdir $fetchfile]} result]} {
-        return -code error "Port remote fetch failed: $result"
+    if {$local} {
+        set fetchfile $url
+    } else {
+        set fetchfile [file tail $url]
+        if {[catch {curl fetch $url [file join $fetchdir $fetchfile]} result]} {
+            return -code error "Port remote fetch failed: $result"
+        }
     }
+    set oldpwd [pwd]
     cd $fetchdir
-    if {[catch {exec [findBinary tar $macports::autoconf::tar_path] -zxf $fetchfile} result]} {
+    # check if this is a binary archive or just the port dir
+    set tarcmd [findBinary tar $macports::autoconf::tar_path]
+    set tarflags [get_tar_flags [file extension $fetchfile]]
+    set qflag ${macports::autoconf::tar_q}
+    set cmdline "$tarcmd ${tarflags}${qflag}xOf {$fetchfile} +CONTENTS"
+    ui_debug "$cmdline"
+    set contents [eval exec $cmdline]
+    if {![catch {set contents [eval exec $cmdline]}]} {
+        set binary 1
+        ui_debug "getting port name from binary archive"
+        # get the portname from the contents file
+        foreach line [split $contents "\n"] {
+            if {[lindex $line 0] == "@name"} {
+                # actually ${name}-${version}_${revision}
+                set portname [lindex $line 1]
+            }
+        }
+        ui_debug "port name is '$portname'"
+        file mkdir $portname
+        cd $portname
+    } else {
+        set binary 0
+        set portname [file rootname $fetchfile]
+    }
+
+    # extract the portfile (and possibly files dir if not a binary archive)
+    ui_debug "extracting port archive to [pwd]"
+    if {$binary} {
+        set cmdline "$tarcmd ${tarflags}${qflag}xOf {$fetchfile} +PORTFILE > Portfile"
+    } else {
+        set cmdline "$tarcmd ${tarflags}xf {$fetchfile}"
+    }
+    ui_debug "$cmdline"
+    if {[catch {eval exec $cmdline} result]} {
         return -code error "Port extract failed: $result"
     }
-    if {[regexp {(.+).tgz} $fetchfile match portdir] != 1} {
-        return -code error "Can't decipher portdir from $fetchfile"
-    }
-    return [file join $fetchdir $portdir]
+
+    cd $oldpwd
+    return [file join $fetchdir $portname]
 }
 
 proc macports::getprotocol {url} {
@@ -1156,10 +1217,20 @@
 # fetched port will be downloaded to (currently only applies to
 # mports:// sources).
 proc macports::getportdir {url {destdir "."}} {
+    global macports::extracted_portdirs
     set protocol [macports::getprotocol $url]
     switch ${protocol} {
         file {
-            return [file normalize [string range $url [expr [string length $protocol] + 3] end]]
+            set path [file normalize [string range $url [expr [string length $protocol] + 3] end]]
+            if {[file isdirectory $path]} {
+                return $path
+            } else {
+                # need to create a local dir for the exracted port, but only once
+                if {![info exists macports::extracted_portdirs($url)]} {
+                    set macports::extracted_portdirs($url) [macports::fetch_port $path 1]
+                }
+                return $macports::extracted_portdirs($url)
+            }
         }
         mports {
             return [macports::index::fetch_port $url $destdir]
@@ -1167,7 +1238,10 @@
         https -
         http -
         ftp {
-            return [macports::fetch_port $url]
+            if {![info exists macports::extracted_portdirs($url)]} {
+                set macports::extracted_portdirs($url) [macports::fetch_port $url 0]
+            }
+            return $macports::extracted_portdirs($url)
         }
         default {
             return -code error "Unsupported protocol $protocol"
@@ -1295,7 +1369,7 @@
         error "Error evaluating variants"
     }
 
-    ditem_key $mport provides [$workername eval return \$name]
+    ditem_key $mport provides [$workername eval return \$subport]
 
     return $mport
 }
@@ -1303,10 +1377,7 @@
 # mportopen_installed
 # opens a portfile stored in the registry
 proc mportopen_installed {name version revision variants options} {
-    global macports::registry.format macports::registry.path
-    if {${registry.format} != "receipt_sqlite"} {
-        return -code error "mportopen_installed requires sqlite registry"
-    }
+    global macports::registry.path
     set regref [lindex [registry::entry imaged $name $version $revision $variants] 0]
     set portfile_dir [file join ${registry.path} registry portfiles $name "${version}_${revision}${variants}"]
     file mkdir $portfile_dir
@@ -1332,11 +1403,11 @@
 # close mport opened with mportopen_installed and clean up associated files
 proc mportclose_installed {mport} {
     global macports::registry.path
-    foreach key {name version revision portvariants} {
+    foreach key {subport version revision portvariants} {
         set $key [_mportkey $mport $key]
     }
     mportclose $mport
-    set portfiles_dir [file join ${registry.path} registry portfiles $name]
+    set portfiles_dir [file join ${registry.path} registry portfiles $subport]
     set portfile [file join $portfiles_dir "${version}_${revision}${portvariants}" Portfile]
     file delete -force $portfile [file dirname $portfile]
     if {[llength [glob -nocomplain -directory $portfiles_dir *]] == 0} {
@@ -1431,13 +1502,13 @@
 proc _mportinstalled {mport} {
     # Check for the presence of the port in the registry
     set workername [ditem_key $mport workername]
-    return [$workername eval registry_exists_for_name \${name}]
+    return [$workername eval registry_exists_for_name \${subport}]
 }
 
 # Determine if a port is active
 proc _mportactive {mport} {
     set workername [ditem_key $mport workername]
-    if {![catch {set reslist [$workername eval registry_active \${name}]}] && [llength $reslist] > 0} {
+    if {![catch {set reslist [$workername eval registry_active \${subport}]}] && [llength $reslist] > 0} {
         set i [lindex $reslist 0]
         set name [lindex $i 0]
         set version [lindex $i 1]
@@ -1502,14 +1573,14 @@
 proc _mportconflictsinstalled {mport conflictinfo} {
     set conflictlist {}
     if {[llength $conflictinfo] > 0} {
-        ui_debug "Checking for conflicts against [_mportkey $mport name]"
+        ui_debug "Checking for conflicts against [_mportkey $mport subport]"
         foreach conflictport ${conflictinfo} {
             if {[_mportispresent $mport port:${conflictport}]} {
                 lappend conflictlist $conflictport
             }
         }
     } else {
-        ui_debug "[_mportkey $mport name] has no conflicts"
+        ui_debug "[_mportkey $mport subport] has no conflicts"
     }
 
     return $conflictlist
@@ -1519,7 +1590,7 @@
 ### _mportexec is private; may change without notice
 
 proc _mportexec {target mport} {
-    set portname [_mportkey $mport name]
+    set portname [_mportkey $mport subport]
     macports::push_log $mport
     # xxx: set the work path?
     set workername [ditem_key $mport workername]
@@ -1558,11 +1629,13 @@
 proc mportexec {mport target} {
     set workername [ditem_key $mport workername]
 
+    # check for existence of macportsuser and use fallback if necessary
+    $workername eval validate_macportsuser
     # check variants
     if {[$workername eval check_variants $target] != 0} {
         return 1
     }
-    set portname [_mportkey $mport name]
+    set portname [_mportkey $mport subport]
     if {$target != "clean"} {
         macports::push_log $mport
     }
@@ -1573,7 +1646,7 @@
         registry::exclusive_lock
         # see if we actually need to build this port
         if {($target != "activate" && $target != "install") ||
-            ![$workername eval registry_exists \$name \$version \$revision \$portvariants]} {
+            ![$workername eval registry_exists \$subport \$version \$revision \$portvariants]} {
             # possibly warn or error out depending on how old xcode is
             if {[$workername eval _check_xcode_version] != 0} {
                 return 1
@@ -1589,7 +1662,7 @@
             }
         }
 
-        ui_msg -nonewline "--->  Computing dependencies for [_mportkey $mport name]"
+        ui_msg -nonewline "--->  Computing dependencies for [_mportkey $mport subport]"
         if {[macports::ui_isset ports_debug]} {
             # play nice with debug messages
             ui_msg ""
@@ -1704,6 +1777,11 @@
                         set res [mportlookup $dep_portname]
                         array unset dep_portinfo
                         array set dep_portinfo [lindex $res 1]
+                        if {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
+                            set missing {}
+                        }
+                    }
+                    if {[llength $missing] > 0} {
                         if {[info exists dep_portinfo(variants)] && [lsearch $dep_portinfo(variants) universal] != -1} {
                             # dep offers a universal variant
                             if {[llength $active_archs] == 1} {
@@ -1715,7 +1793,7 @@
                                     }
                                 }
                                 if {[llength $missing] > 0} {
-                                    ui_error "Cannot install [_mportkey $mport name] for the arch(s) '$required_archs' because"
+                                    ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
                                     ui_error "its dependency $dep_portname is only installed for the arch '$active_archs'"
                                     ui_error "and the configured universal_archs '$macports::universal_archs' are not sufficient."
                                     return -code error "architecture mismatch"
@@ -1727,12 +1805,12 @@
                                 }
                             } else {
                                 # already universal
-                                ui_error "Cannot install [_mportkey $mport name] for the arch(s) '$required_archs' because"
+                                ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
                                 ui_error "its dependency $dep_portname is only installed for the archs '$active_archs'."
                                 return -code error "architecture mismatch"
                             }
                         } else {
-                            ui_error "Cannot install [_mportkey $mport name] for the arch(s) '$required_archs' because"
+                            ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
                             ui_error "its dependency $dep_portname is only installed for the arch '$active_archs'"
                             ui_error "and does not have a universal variant."
                             return -code error "architecture mismatch"
@@ -1785,7 +1863,7 @@
     upvar $filename myfilename
     upvar $extension myextension
 
-    if {[regexp {^(?:https?|ftp)://.+/(.+\.(tar\.gz|tar\.bz2))$} $url -> f e]} {
+    if {[regexp {^(?:https?|ftp|rsync)://.+/(.+\.(tar\.gz|tar\.bz2|tar))$} $url -> f e]} {
         set myfilename $f
         set myextension $e
 
@@ -1829,7 +1907,7 @@
 proc mportsync {{optionslist {}}} {
     global macports::sources macports::portdbpath macports::rsync_options tcl_platform
     global macports::portverbose
-    global macports::autoconf::rsync_path
+    global macports::autoconf::rsync_path macports::autoconf::tar_path macports::autoconf::openssl_path
     array set options $optionslist
 
     set numfailed 0
@@ -1881,13 +1959,21 @@
                 # Where to, boss?
                 set indexfile [macports::getindex $source]
                 set destdir [file dirname $indexfile]
+                set is_tarball [_source_is_snapshot $source]
                 file mkdir $destdir
-                # Keep rsync happy with a trailing slash
-                if {[string index $source end] != "/"} {
-                    append source "/"
+
+                if {$is_tarball} {
+                    set exclude_option ""
+                    # need to do a few things before replacing the ports tree in this case
+                    set destdir [file dirname $destdir]
+                } else {
+                    # Keep rsync happy with a trailing slash
+                    if {[string index $source end] != "/"} {
+                        append source "/"
+                    }
+                    # don't sync PortIndex yet; we grab the platform specific one afterwards
+                    set exclude_option "'--exclude=/PortIndex*'"
                 }
-                # don't sync PortIndex yet; we grab the platform specific one afterwards
-                set exclude_option "'--exclude=/PortIndex*'"
                 # Do rsync fetch
                 set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${exclude_option} ${source} ${destdir}"
                 ui_debug $rsync_commandline
@@ -1896,15 +1982,100 @@
                     incr numfailed
                     continue
                 }
+
+                if {$is_tarball} {
+                    # verify signature for tarball
+                    global macports::archivefetch_pubkeys
+                    set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${exclude_option} ${source}.rmd160 ${destdir}"
+                    ui_debug $rsync_commandline
+                    if {[catch {system $rsync_commandline}]} {
+                        ui_error "Synchronization of the ports tree signature failed doing rsync"
+                        incr numfailed
+                        continue
+                    }
+                    set tarball "${destdir}/[file tail $source]"
+                    set signature "${tarball}.rmd160"
+                    set openssl [macports::findBinary openssl $macports::autoconf::openssl_path]
+                    set verified 0
+                    foreach pubkey ${macports::archivefetch_pubkeys} {
+                        if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature $tarball} result]} {
+                            set verified 1
+                            ui_debug "successful verification with key $pubkey"
+                            break
+                        } else {
+                            ui_debug "failed verification with key $pubkey"
+                            ui_debug "openssl output: $result"
+                        }
+                    }
+                    if {!$verified} {
+                        ui_error "Failed to verify signature for ports tree!"
+                        incr numfailed
+                        continue
+                    }
+
+                    # extract tarball and move into place
+                    set tar [macports::findBinary tar $macports::autoconf::tar_path]
+                    file mkdir ${destdir}/tmp
+                    set tar_cmd "$tar -C ${destdir}/tmp -xf ${tarball}"
+                    ui_debug $tar_cmd
+                    if {[catch {system $tar_cmd}]} {
+                        ui_error "Failed to extract ports tree from tarball!"
+                        incr numfailed
+                        continue
+                    }
+                    # save the local PortIndex data
+                    if {[file isfile $indexfile]} {
+                        file copy -force $indexfile ${destdir}/
+                        file rename -force $indexfile ${destdir}/tmp/ports/
+                        if {[file isfile ${indexfile}.quick]} {
+                            file rename -force ${indexfile}.quick ${destdir}/tmp/ports/
+                        }
+                    }
+                    file delete -force ${destdir}/ports
+                    file rename ${destdir}/tmp/ports ${destdir}/ports
+                    file delete -force ${destdir}/tmp
+                }
+
                 # now sync the index if the local file is missing or older than a day
                 if {![file isfile $indexfile] || [expr [clock seconds] - [file mtime $indexfile]] > 86400} {
-                    set remote_indexfile "${source}PortIndex_${macports::os_platform}_${macports::os_major}_${macports::os_arch}/PortIndex"
+                    if {$is_tarball} {
+                        # chop ports.tar off the end
+                        set index_source [string range $source 0 end-[string length [file tail $source]]]
+                    } else {
+                        set index_source $source 
+                    }
+                    set remote_indexfile "${index_source}PortIndex_${macports::os_platform}_${macports::os_major}_${macports::os_arch}/PortIndex"
                     set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} $remote_indexfile ${destdir}"
                     ui_debug $rsync_commandline
                     if {[catch {system $rsync_commandline}]} {
                         ui_debug "Synchronization of the PortIndex failed doing rsync"
                     } else {
-                        mports_generate_quickindex $indexfile
+                        set ok 1
+                        if {$is_tarball} {
+                            set ok 0
+                            # verify signature for PortIndex
+                            set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${remote_indexfile}.rmd160 ${destdir}"
+                            ui_debug $rsync_commandline
+                            if {![catch {system $rsync_commandline}]} {
+                                foreach pubkey ${macports::archivefetch_pubkeys} {
+                                    if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature ${destdir}/PortIndex.rmd160 ${destdir}/PortIndex} result]} {
+                                        set ok 1
+                                        ui_debug "successful verification with key $pubkey"
+                                        break
+                                    } else {
+                                        ui_debug "failed verification with key $pubkey"
+                                        ui_debug "openssl output: $result"
+                                    }
+                                }
+                                if {$ok} {
+                                    # move PortIndex into place
+                                    file rename -force ${destdir}/PortIndex ${destdir}/ports/
+                                }
+                            }
+                        }
+                        if {$ok} {
+                            mports_generate_quickindex $indexfile
+                        }
                     }
                 }
                 if {[catch {system "chmod -R a+r \"$destdir\""}]} {
@@ -2490,6 +2661,8 @@
                     }
                     ui_error "Dependency '$dep_portname' not found."
                     return 1
+                } elseif {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
+                    set check_archs 0
                 }
                 lappend options subport $dep_portname
                 # Figure out the subport. Check the open_mports list first, since
@@ -2526,7 +2699,7 @@
                     }
                 }
                 if {$arch_mismatch} {
-                    macports::_explain_arch_mismatch [_mportkey $mport name] $dep_portname $required_archs $supported_archs $has_universal
+                    macports::_explain_arch_mismatch [_mportkey $mport subport] $dep_portname $required_archs $supported_archs $has_universal
                     return -code error "architecture mismatch"
                 }
             }
@@ -2694,7 +2867,7 @@
         install     -
         activate    -
         ""          {
-            if {[$workername eval registry_exists \$name \$version \$revision \$portvariants]
+            if {[$workername eval registry_exists \$subport \$version \$revision \$portvariants]
                 || [$workername eval _archive_available]} {
                 return "depends_lib depends_run"
             } else {
@@ -2709,6 +2882,7 @@
 proc macports::selfupdate {{optionslist {}} {updatestatusvar ""}} {
     global macports::prefix macports::portdbpath macports::libpath macports::rsync_server macports::rsync_dir macports::rsync_options
     global macports::autoconf::macports_version macports::autoconf::rsync_path tcl_platform
+    global macports::autoconf::openssl_path macports::autoconf::tar_path
     array set options $optionslist
     
     # variable that indicates whether we actually updated base
@@ -2725,8 +2899,18 @@
         }
     }
 
+    # are we syncing a tarball? (implies detached signature)
+    set is_tarball 0
+    if {[string range ${rsync_dir} end-3 end] == ".tar"} {
+        set is_tarball 1
+        set mp_source_path [file join $portdbpath sources ${rsync_server} [file dirname ${rsync_dir}]]
+    } else {
+        if {[string index $rsync_dir end] != "/"} {
+            append rsync_dir "/"
+        }
+        set mp_source_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}]
+    }
     # create the path to the to be downloaded sources if it doesn't exist
-    set mp_source_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}/]
     if {![file exists $mp_source_path]} {
         file mkdir $mp_source_path
     }
@@ -2738,6 +2922,45 @@
        return -code error "Error synchronizing MacPorts sources: $result"
     }
 
+    if {$is_tarball} {
+        # verify signature for tarball
+        global macports::archivefetch_pubkeys
+        if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir}.rmd160 $mp_source_path" } result ] } {
+            return -code error "Error synchronizing MacPorts source signature: $result"
+        }
+        set openssl [findBinary openssl $macports::autoconf::openssl_path]
+        set tarball "${mp_source_path}/[file tail $rsync_dir]"
+        set signature "${tarball}.rmd160"
+        set verified 0
+        foreach pubkey ${macports::archivefetch_pubkeys} {
+            if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature $tarball} result]} {
+                set verified 1
+                ui_debug "successful verification with key $pubkey"
+                break
+            } else {
+                ui_debug "failed verification with key $pubkey"
+                ui_debug "openssl output: $result"
+            }
+        }
+        if {!$verified} {
+            return -code error "Failed to verify signature for MacPorts source!"
+        }
+        
+        # extract tarball and move into place
+        set tar [macports::findBinary tar $macports::autoconf::tar_path]
+        file mkdir ${mp_source_path}/tmp
+        set tar_cmd "$tar -C ${mp_source_path}/tmp -xf ${tarball}"
+        ui_debug $tar_cmd
+        if {[catch {system $tar_cmd}]} {
+            return -code error "Failed to extract MacPorts sources from tarball!"
+        }
+        file delete -force ${mp_source_path}/base
+        file rename ${mp_source_path}/tmp/base ${mp_source_path}/base
+        file delete -force ${mp_source_path}/tmp
+        # set the final extracted source path
+        set mp_source_path ${mp_source_path}/base
+    }
+
     # echo current MacPorts version
     ui_msg "MacPorts base version $macports::autoconf::macports_version installed,"
 
@@ -2798,11 +3021,14 @@
                 ui_warn "Disabling readline support due to readline in /usr/local"
             }
 
+            if {$prefix == "/usr/local" || $prefix == "/usr"} {
+                append configure_args " --with-unsupported-prefix"
+            }
+
+            # Choose a sane compiler
             set cc_arg ""
-            switch -glob -- $::macports::macosx_version {
-                10.[45] { set cc_arg "CC=/usr/bin/gcc-4.0 " }
-                10.6     { set cc_arg "CC=/usr/bin/gcc-4.2 " }
-                10.*     { set cc_arg "CC=/usr/bin/llvm-gcc-4.2 " }
+            if {$::macports::os_platform == "darwin"} {
+                set cc_arg "CC=/usr/bin/cc "
             }
 
             # do the actual configure, build and installation of new base
@@ -3208,7 +3434,6 @@
         }
     }
 
-    global macports::registry.format
     # are we installing an existing version due to force or epoch override?
     if {[registry::entry_exists $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]
         && ([info exists options(ports_upgrade_force)] || $build_override == 1)} {
@@ -3220,8 +3445,8 @@
         set newregref [registry::open_entry $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) $existing_epoch]
         if {$is_dryrun eq "yes"} {
             ui_msg "Skipping uninstall $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
-        } elseif {!(${registry.format} == "receipt_sqlite" && [registry::run_target $newregref uninstall [array get options]])
-                  && [catch {registry_uninstall::uninstall $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) [array get options]} result]} {
+        } elseif {![registry::run_target $newregref uninstall [array get options]]
+                  && [catch {registry_uninstall::uninstall $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) [array get options]} result]} {
             global errorInfo
             ui_debug "$errorInfo"
             ui_error "Uninstall $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) failed: $result"
@@ -3244,8 +3469,8 @@
         if {$is_dryrun eq "yes"} {
             ui_msg "Skipping deactivate $portname @${version_active}_${revision_active}${variant_active} (dry run)"
         } elseif {![catch {registry::active $portname}] &&
-                  !(${registry.format} == "receipt_sqlite" && [registry::run_target $regref deactivate [array get options]])
-                  && [catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} [array get options]} result]} {
+                  ![registry::run_target $regref deactivate [array get options]]
+                  && [catch {portimage::deactivate $portname $version_active $revision_active $variant_active [array get options]} result]} {
             global errorInfo
             ui_debug "$errorInfo"
             ui_error "Deactivating $portname @${version_active}_${revision_active}${variant_active} failed: $result"
@@ -3320,8 +3545,8 @@
             set regref [registry::open_entry $portname $version $revision $variant $epoch]
             if {$is_dryrun eq "yes"} {
                 ui_msg "Skipping uninstall $portname @${version}_${revision}${variant} (dry run)"
-            } elseif {!(${registry.format} == "receipt_sqlite" && [registry::run_target $regref uninstall $optionslist])
-                      && [catch {registry_uninstall::uninstall $portname ${version}_${revision}${variant} $optionslist} result]} {
+            } elseif {![registry::run_target $regref uninstall $optionslist]
+                      && [catch {registry_uninstall::uninstall $portname $version $revision $variant $optionslist} result]} {
                 global errorInfo
                 ui_debug "$errorInfo"
                 # replaced_by can mean that we try to uninstall all versions of the old port, so handle errors due to dependents

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_autoconf.tcl.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_autoconf.tcl.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_autoconf.tcl.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # macports-autoconf.tcl.in
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2006 - 2009, 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -40,10 +41,12 @@
     variable macports_user_dir "~/.macports"
     variable macportsuser "@RUNUSR@"
     variable open_path "@OPEN@"
+    variable openssl_path "@OPENSSL@"
     variable pax_path "@PAX@"
     variable rsync_path "@RSYNC@"
     variable tar_command "@TAR_CMD@"
     variable tar_path "@TAR@"
+    variable tar_q "@TAR_Q@"
     variable unzip_path "@UNZIP@"
     variable xar_path "@XAR@"
 }

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_dlist.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_dlist.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_dlist.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,8 +1,9 @@
 # macports1.0/macports_dlist.tcl
 # $Id$
 #
+# Copyright (c) 2004-2005, 2007, 2009, 2011 The MacPorts Project
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_fastload.tcl.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_fastload.tcl.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_fastload.tcl.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # macports_fastload.tcl.in
 # $Id$
 #
-# Copyright (c) 2004 Paul Guyot, The MacPorts Project.
+# Copyright (c) 2005-2007, 2009-2010 The MacPorts Project
+# Copyright (c) 2004-2005 Paul Guyot, The MacPorts Project.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_index.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_index.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_index.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,7 +1,7 @@
 # macports_index.tcl
 # $Id$
 #
-# Copyright (c) 2004 Apple Computer, Inc.
+# Copyright (c) 2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -12,7 +12,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_util.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_util.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports_util.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -12,7 +12,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/tests/macports_dlist.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/tests/macports_dlist.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/tests/macports_dlist.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,6 +2,7 @@
 # macports1.0/test_dlist.tcl
 # $Id$
 #
+# Copyright (c) 2007 The MacPorts Project
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
 
 # Test suite for macports_dlist package.
@@ -70,7 +71,7 @@
 }
 
 # Replicate Shantonu's Bug #354 to test dlist functionality.
-# http://trac.macports.org/projects/macports/ticket/354
+# https://trac.macports.org/ticket/354
 # A depends on B, C.
 # B depends on C.
 # C has no dependencies.

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/package.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/package.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/package.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # package.tcl
 # $Id$
 #
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2004, 2007-2008, 2010 The MacPorts Project
+# Copyright (c) 2002-2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portarchivefetch.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portarchivefetch.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portarchivefetch.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # $Id$
 #
 # Copyright (c) 2002 - 2003 Apple Inc.
-# Copyright (c) 2004-2010 The MacPorts Project
+# Copyright (c) 2004 - 2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -59,11 +59,25 @@
 default archivefetch.ignore_sslcert no
 default archivefetch.pubkeys {$archivefetch_pubkeys}
 
-default archive_sites macports_archives
+default archive_sites {[portarchivefetch::filter_sites]}
 default archive_sites.listfile {"archive_sites.tcl"}
 default archive_sites.listpath {"port1.0/fetch"}
 default archive.subdir {${subport}}
 
+proc portarchivefetch::filter_sites {} {
+    global prefix porturl
+    set ret {}
+    foreach site [array names portfetch::mirror_sites::archive_prefix] {
+        if {$portfetch::mirror_sites::archive_prefix($site) == $prefix} {
+            lappend ret $site
+        }
+    }
+    if {[file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]]} {
+        lappend ret [string range $porturl 0 end-[string length [file tail $porturl]]]
+    }
+    return $ret
+}
+
 set_ui_prefix
 
 # Checks possible archive files to assemble url lists for later fetching
@@ -204,9 +218,9 @@
                     ui_debug "$::errorInfo"
                     return -code error "Failed to fetch signature for archive: $result"
                 }
+                set openssl [findBinary openssl $portutil::autoconf::openssl_path]
                 set verified 0
                 foreach pubkey [option archivefetch.pubkeys] {
-                    set openssl [findBinary openssl $portutil::autoconf::openssl_path]
                     if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature "${incoming_path}/${archive}.TMP"} result]} {
                         set verified 1
                         break
@@ -246,6 +260,11 @@
 
 # Initialize archivefetch target and call checkfiles.
 proc portarchivefetch::archivefetch_init {args} {
+    global porturl portarchivetype
+    # installing straight from a binary archive
+    if {[file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]] && [file extension $porturl] != ""} {
+        set portarchivetype [string range [file extension $porturl] 1 end]
+    }
     return 0
 }
 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portdmg.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portdmg.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portdmg.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portdmg.tcl
 # $Id$
 #
-# Copyright (c) 2003 Apple Computer, Inc.
+# Copyright (c) 2007, 2009-2011  The MacPorts Project
+# Copyright (c) 2003, 2005 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portdpkg.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portdpkg.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portdpkg.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portdpkg.tcl
 # $Id$
 #
+# Copyright (c) 2005, 2007, 2009, 2011 The MacPorts Project
 # Copyright (c) 2004 Landon Fuller <landonf at macports.org>
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portmdmg.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portmdmg.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portmdmg.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portmdmg.tcl
 # $Id$
 #
-# Copyright (c) 2003 Apple Computer, Inc.
+# Copyright (c) 2005, 2007-2011 The MacPorts Project
+# Copyright (c) 2003-2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portmpkg.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portmpkg.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portmpkg.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portmpkg.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2005, 2007 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portpkg.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portpkg.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portpkg.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portpkg.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2005, 2007 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portportpkg.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portportpkg.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portportpkg.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # portportpkg.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2004 Apple Computer, Inc.
+# Copyright (c) 2002 - 2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portrpm.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portrpm.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portrpm.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portrpm.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2005 - 2007, 2009 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portsrpm.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portsrpm.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portsrpm.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portsrpm.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2007, 2009, 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/package1.0/portunarchive.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/package1.0/portunarchive.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portunarchive.tcl
 # $Id$
 #
+# Copyright (c) 2005, 2007-2011 The MacPorts Project
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -61,7 +62,7 @@
 set_ui_prefix
 
 proc portunarchive::unarchive_init {args} {
-    global target_state_fd unarchive.skip \
+    global target_state_fd unarchive.skip destroot \
            ports_force ports_source_only ports_binary_only \
            subport version revision portvariants \
            unarchive.type unarchive.file unarchive.path
@@ -73,7 +74,8 @@
     } elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
         ui_debug "Skipping unarchive ($subport) since source-only is set"
         set skipped 1
-    } elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
+    } elseif {[check_statefile target org.macports.destroot $target_state_fd]
+              && [file isdirectory $destroot]} {
         ui_debug "Skipping unarchive ($subport) since destroot completed"
         set skipped 1
     } elseif {[info exists ports_force] && $ports_force == "yes"} {

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -16,9 +16,9 @@
 .PHONY: test
 
 test:: ${SHLIB_NAME}
-	${TCLSH} tests/checksums.tcl ${SHLIB_NAME}
-	${TCLSH} tests/curl.tcl ${SHLIB_NAME}
-	${TCLSH} tests/filemap.tcl ${SHLIB_NAME}
-	${TCLSH} tests/fs-traverse.tcl ${SHLIB_NAME}
-	${TCLSH} tests/symlink.tcl ${SHLIB_NAME}
-	${TCLSH} tests/unsetenv.tcl ${SHLIB_NAME}
+	${TCLSH} tests/checksums.tcl ./${SHLIB_NAME}
+	${TCLSH} tests/curl.tcl ./${SHLIB_NAME}
+	${TCLSH} tests/filemap.tcl ./${SHLIB_NAME}
+	${TCLSH} tests/fs-traverse.tcl ./${SHLIB_NAME}
+	${TCLSH} tests/symlink.tcl ./${SHLIB_NAME}
+	${TCLSH} tests/unsetenv.tcl ./${SHLIB_NAME}

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Pextlib.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Pextlib.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
  * Pextlib.c
  * $Id$
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * Copyright (c) 2004 - 2005 Paul Guyot <pguyot at kallisys.net>
  * Copyright (c) 2004 Landon Fuller <landonf at macports.org>
  * All rights reserved.
@@ -15,7 +15,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 
@@ -405,6 +405,7 @@
 #ifndef __APPLE__
         /* Crashes on Linux without this. */
         setenv("MACPORTS_DUMMY", "", 0);
+        unsetenv("MACPORTS_DUMMY");
 #endif
     } else {
         (void) unsetenv(name);

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/base32cmd.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -5,7 +5,7 @@
  * Find files and execute arbitrary expressions on them.
  * Author: Jordan K. Hubbard, Kevin Ballard, Rainer Mueller
  *
- * Copyright (c) 2004 Apple Computer, Inc.
+ * Copyright (c) 2004 Apple Inc.
  * Copyright (c) 2010 The MacPorts Project
  * All rights reserved.
  *
@@ -17,7 +17,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 
@@ -146,6 +146,8 @@
             xpath = ".";
         } else if (*(xpath + tlen) == '/') {
             xpath += tlen + 1;
+        } else if (*(target + tlen - 1) == '/') {
+            xpath += tlen;
         }
     }
 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/fs-traverse.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
  * fs-traverse.h
  * $Id$
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
  * md5cmd.c
  * $Id$
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2004 - 2005, 2009, 2011 The MacPorts Project
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md5cmd.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
  * md5cmd.h
  * $Id$
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md_wrappers.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md_wrappers.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/md_wrappers.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,6 +2,7 @@
  * rmd160cmd.c
  * $Id$
  *
+ * Copyright (c) 2006, 2009-2011 The MacPorts Project
  * Copyright (c) 2005 Paul Guyot <pguyot at kallisys.net>.
  * All rights reserved.
  *
@@ -13,7 +14,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/rmd160cmd.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,7 +3,8 @@
  * $Id$
  * Copied from md5cmd.c 20040903 EH
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2004 - 2005, 2009 - 2011 The MacPorts Project
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha1cmd.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,7 +3,7 @@
  * $Id$
  * Copied from md5cmd.h 20040903 EH
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 


Property changes on: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base/src/pextlib1.0/sha2.c:37343-46937
/branches/universal-sanity/base/src/pextlib1.0/sha2.c:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/sha2.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.c:45682-46060
/users/perry/base-select/src/pextlib1.0/sha2.c:44044-44692
   + /branches/gsoc08-privileges/base/src/pextlib1.0/sha2.c:37343-46937
/branches/universal-sanity/base/src/pextlib1.0/sha2.c:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/sha2.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/pextlib1.0/sha2.c:78828-80185
/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.c:45682-46060
/users/perry/base-select/src/pextlib1.0/sha2.c:44044-44692


Property changes on: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base/src/pextlib1.0/sha2.h:37343-46937
/branches/universal-sanity/base/src/pextlib1.0/sha2.h:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/sha2.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.h:45682-46060
/users/perry/base-select/src/pextlib1.0/sha2.h:44044-44692
   + /branches/gsoc08-privileges/base/src/pextlib1.0/sha2.h:37343-46937
/branches/universal-sanity/base/src/pextlib1.0/sha2.h:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/sha2.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/pextlib1.0/sha2.h:78828-80185
/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.h:45682-46060
/users/perry/base-select/src/pextlib1.0/sha2.h:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
  * sha256cmd.c
  * $Id$
  *
- * Copyright (c) 2009 The MacPorts Project
+ * Copyright (c) 2009, 2011 The MacPorts Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 


Property changes on: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.c:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/sha256cmd.c:51231-60371
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.c:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.c:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.c:44044-44692
   + /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.c:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/sha256cmd.c:51231-60371
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.c:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/pextlib1.0/sha256cmd.c:78828-80185
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.c:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.c:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -13,7 +13,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of The MacPorts Project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 


Property changes on: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha256cmd.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.h:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/sha256cmd.h:51231-60371
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.h:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.h:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.h:44044-44692
   + /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.h:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/sha256cmd.h:51231-60371
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.h:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/pextlib1.0/sha256cmd.h:78828-80185
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.h:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.h:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -5,6 +5,7 @@
  *
  * Author: Rainer Mueller <raimue at macports.org>
  *
+ * Copyright (c) 2009 The MacPorts Project
  * Copyright (c) 2008 Rainer Mueller <raimue at macports.org>
  * All rights reserved.
  *
@@ -16,7 +17,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its
+ * 3. Neither the name of The MacPorts Project nor the names of its
  *    contributors may be used to endorse or promote products derived from
  *    this software without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/tty.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -16,7 +16,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its
+ * 3. Neither the name of The MacPorts Project nor the names of its
  *    contributors may be used to endorse or promote products derived from
  *    this software without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.c
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.c	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.c	2011-07-06 11:59:33 UTC (rev 80186)
@@ -5,7 +5,7 @@
  *
  * Author: Landon Fuller <landonf at macports.org>
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * Copyright (c) 2004 Landon Fuller <landonf at macports.org>
  * All rights reserved.
  *
@@ -17,7 +17,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its
+ * 3. Neither the name of Apple Inc. nor the names of its
  *    contributors may be used to endorse or promote products derived from
  *    this software without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.h
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.h	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pextlib1.0/vercomp.h	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,7 +3,7 @@
  * $Id$
  * Author: Landon Fuller <landonf at macports.org>
  *
- * Copyright (c) 2002 - 2003 Apple Computer, Inc.
+ * Copyright (c) 2002 - 2003 Apple Inc.
  * Copyright (c) 2004 Landon Fuller
  * All rights reserved.
  *
@@ -15,7 +15,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+ * 3. Neither the name of Apple Inc. nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  * 

Modified: branches/gsoc11-rev-upgrade/base/src/pkg_mkindex.sh.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/pkg_mkindex.sh.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/pkg_mkindex.sh.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -12,7 +12,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/port/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -22,7 +22,8 @@
 	${edit} port.tcl > $@
 
 mkdirs:
-	<../../doc/prefix.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
+	< ../../doc/prefix.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
+	< ../../doc/base.mtree $(MTREE) -U -d -e -p ${INSTALLDIR} > /dev/null
 
 clean:
 	rm -f ${SCRIPTS}

Modified: branches/gsoc11-rev-upgrade/base/src/port/port-help.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port/port-help.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port/port-help.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -277,7 +277,7 @@
 specifying any version.
 
 One example is the set of python ports, where there are (among others)
-python25, python26, and python30.  The select action lets you set which
+python25, python26, and python31.  The select action lets you set which
 of these becomes the version run when you simply use 'python'.
 
 <arguments> must include the group upon which to be acted, and may include
@@ -293,6 +293,13 @@
 Upgrade MacPorts itself and run the sync target
 }
 
+set porthelp(space) {
+Show the disk space used by the given ports
+
+--units <units> Specify units to use. Accepted units are: B, kB, KiB, MB, MiB,
+                GB, GiB. The 'B' may be omitted.
+}
+
 set porthelp(srpm) {
 Creates a srpm for each of the given ports
 }

Modified: branches/gsoc11-rev-upgrade/base/src/port/port.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port/port.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port/port.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -5,9 +5,9 @@
 # port.tcl
 # $Id$
 #
-# Copyright (c) 2002-2007 The MacPorts Project.
+# Copyright (c) 2004-2011 The MacPorts Project
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002-2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -18,7 +18,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -87,8 +87,8 @@
 ----------------
 Pseudo-portnames are words that may be used in place of a portname, and
 which expand to some set of ports. The common pseudo-portnames are:
-all, current, active, inactive, installed, uninstalled, outdated, obsolete,
-requested, unrequested and leaves.
+all, current, active, inactive, actinact, installed, uninstalled, outdated,
+obsolete, requested, unrequested and leaves.
 These pseudo-portnames expand to the set of ports named.
 
 Pseudo-portnames starting with variants:, variant:, description:, depends:,
@@ -154,7 +154,58 @@
 }
 
 
+# Format an integer representing bytes using given units
+proc bytesize {siz {unit {}}} {
+    if {$unit == {}} {
+        if {$siz > 0x40000000} {
+            set unit "GiB"
+        } elseif {$siz > 0x100000} {
+            set unit "MiB"
+        } elseif {$siz > 0x400} {
+            set unit "KiB"
+        } else {
+            set unit "B"
+        }
+    }
+    switch -- $unit {
+        KiB {
+            set siz [expr $siz / 1024.0]
+        }
+        kB {
+            set siz [expr $siz / 1000.0]
+        }
+        MiB {
+            set siz [expr $siz / 1048576.0]
+        }
+        MB {
+            set siz [expr $siz / 1000000.0]
+        }
+        GiB {
+            set siz [expr $siz / 1073741824.0]
+        }
+        GB {
+            set siz [expr $siz / 1000000000.0]
+        }
+        B { }
+        default {
+            ui_warn "Unknown file size unit '$unit' specified"
+            set unit "B"
+        }
+    }
+    if {[expr round($siz)] != $siz} {
+        set siz [format {%.3f} $siz]
+    }
+    return "$siz $unit"
+}
 
+proc filesize {fil {unit {}}} {
+    set siz {@}
+    catch {
+        set siz [bytesize [file size $fil] $unit]
+    }
+    return $siz
+}
+
 # Produce an error message, and exit, unless
 # we're handling errors in a soft fashion, in which
 # case we continue
@@ -185,7 +236,9 @@
 
 # show the URL for the ticket reporting instructions
 proc print_tickets_url {args} {
-    ui_notice "To report a bug, see <http://guide.macports.org/#project.tickets>"
+    if {${macports::prefix} != "/usr/local" && ${macports::prefix} != "/usr"} {
+        ui_notice "To report a bug, see <http://guide.macports.org/#project.tickets>"
+    }
 }
 
 # Form a composite version as is sometimes used for registry functions
@@ -713,7 +766,35 @@
     return [get_installed_ports no no]
 }
 
+proc get_actinact_ports {} {
+    set inactive_ports [get_inactive_ports]
+    set active_ports [get_active_ports]
+    set results {}
 
+    foreach port $inactive_ports {
+        array set portspec $port
+        set portname $portspec(name)
+        lappend inact($portname) $port
+    }
+
+    foreach port $active_ports {
+        array set portspec $port
+        set portname $portspec(name)
+
+        if {[info exists inact($portname)]} {
+            if {![info exists added_inact($portname)]} {
+                foreach inact_spec $inact($portname) {
+                    lappend results $inact_spec
+                }
+                set added_inact($portname) 1
+            }
+            lappend results $port
+        }
+    }
+    return $results
+}
+
+
 proc get_outdated_ports {} {
     # Get the list of installed ports
     set ilist {}
@@ -1163,6 +1244,7 @@
         ^uninstalled(@.*)?$ -
         ^active(@.*)?$      -
         ^inactive(@.*)?$    -
+        ^actinact(@.*)?$    -
         ^leaves(@.*)?$      -
         ^outdated(@.*)?$    -
         ^obsolete(@.*)?$    -
@@ -2010,7 +2092,7 @@
                             array unset variant
                             array set variant $vinfo($v)
                             if {[info exists variant(is_default)]} {
-                                set varmodifier "\[+]"
+                                set varmodifier "\[$variant(is_default)]"
                             }
                         }
                         lappend inf "$varmodifier$v"
@@ -2217,15 +2299,13 @@
 
 
 proc action_activate { action portlist opts } {
-    global macports::registry.format
     set status 0
     if {[require_portlist portlist] || [prefix_unwritable]} {
         return 1
     }
     foreachport $portlist {
         set composite_version [composite_version $portversion [array get variations]]
-        if {${macports::registry.format} == "receipt_sqlite"
-            && ![info exists options(ports_activate_no-exec)]
+        if {![info exists options(ports_activate_no-exec)]
             && ![catch {set ilist [registry::installed $portname $composite_version]}]
             && [llength $ilist] == 1} {
 
@@ -2236,7 +2316,7 @@
             }
         }
         if {![macports::global_option_isset ports_dryrun]} {
-            if { [catch {portimage::activate $portname $composite_version [array get options]} result] } {
+            if { [catch {portimage::activate_composite $portname $composite_version [array get options]} result] } {
                 global errorInfo
                 ui_debug "$errorInfo"
                 break_softcontinue "port activate failed: $result" 1 status
@@ -2251,15 +2331,13 @@
 
 
 proc action_deactivate { action portlist opts } {
-    global macports::registry.format
     set status 0
     if {[require_portlist portlist] || [prefix_unwritable]} {
         return 1
     }
     foreachport $portlist {
         set composite_version [composite_version $portversion [array get variations]]
-        if {${macports::registry.format} == "receipt_sqlite"
-            && ![info exists options(ports_deactivate_no-exec)]
+        if {![info exists options(ports_deactivate_no-exec)]
             && ![catch {set ilist [registry::active $portname]}]} {
 
             set i [lindex $ilist 0]
@@ -2274,7 +2352,7 @@
             }
         }
         if {![macports::global_option_isset ports_dryrun]} {
-            if { [catch {portimage::deactivate $portname $composite_version [array get options]} result] } {
+            if { [catch {portimage::deactivate_composite $portname $composite_version [array get options]} result] } {
                 global errorInfo
                 ui_debug "$errorInfo"
                 break_softcontinue "port deactivate failed: $result" 1 status
@@ -2412,7 +2490,6 @@
 
 
 proc action_setrequested { action portlist opts } {
-    global macports::registry.format
     set status 0
     if {[require_portlist portlist] || [prefix_unwritable]} {
         return 1
@@ -2426,9 +2503,6 @@
             foreach i $ilist {
                 set regref [registry::open_entry $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
                 registry::property_store $regref requested $val
-                if {${macports::registry.format} != "receipt_sqlite"} {
-                    registry::write_entry $regref
-                }
             }
         } else {
             global errorInfo
@@ -2813,7 +2887,6 @@
 
 
 proc action_uninstall { action portlist opts } {
-    global macports::registry.format
     set status 0
     if {[macports::global_option_isset port_uninstall_old]} {
         # if -u then uninstall all inactive ports
@@ -2835,8 +2908,7 @@
             continue
         }
         set composite_version [composite_version $portversion [array get variations]]
-        if {${macports::registry.format} == "receipt_sqlite"
-            && ![info exists options(ports_uninstall_no-exec)]
+        if {![info exists options(ports_uninstall_no-exec)]
             && ![catch {set ilist [registry::installed $portname $composite_version]}]
             && [llength $ilist] == 1} {
 
@@ -2848,7 +2920,7 @@
             }
         }
 
-        if { [catch {registry_uninstall::uninstall $portname $composite_version [array get options]} result] } {
+        if { [catch {registry_uninstall::uninstall_composite $portname $composite_version [array get options]} result] } {
             global errorInfo
             ui_debug "$errorInfo"
             break_softcontinue "port uninstall failed: $result" 1 status
@@ -3072,10 +3144,20 @@
 
 
 proc action_contents { action portlist opts } {
-    set status 0
+    global global_options
     if {[require_portlist portlist]} {
         return 1
     }
+    if {[info exists global_options(ports_contents_size)]} {
+        set units {}
+        if {[info exists global_options(ports_contents_units)]} {
+            set units [complete_size_units $global_options(ports_contents_units)]
+        }
+        set outstring {[format "%12s $file" [filesize $file $units]]}
+    } else {
+        set outstring {  $file}
+    }
+
     foreachport $portlist {
         if { ![catch {set ilist [registry::installed $portname]} result] } {
             # set portname again since the one we were passed may not have had the correct case
@@ -3086,7 +3168,7 @@
             if { [llength $files] > 0 } {
                 ui_notice "Port $portname contains:"
                 foreach file $files {
-                    puts "  $file"
+                    puts [subst $outstring]
                 }
             } else {
                 ui_notice "Port $portname does not contain any files or is not active."
@@ -3097,9 +3179,67 @@
     }
     registry::close_file_map
 
-    return $status
+    return 0
 }
 
+# expand abbreviations of size units
+proc complete_size_units {units} {
+    if {$units == "K" || $units == "Ki"} {
+        return "KiB"
+    } elseif {$units == "k"} {
+        return "kB"
+    } elseif {$units == "Mi"} {
+        return "MiB"
+    } elseif {$units == "M"} {
+        return "MB"
+    } elseif {$units == "Gi"} {
+        return "GiB"
+    } elseif {$units == "G"} {
+        return "GB"
+    } else {
+        return $units
+    }
+}
+
+# Show space used by the given ports' files
+proc action_space {action portlist opts} {
+    global global_options
+    require_portlist portlist
+
+    set units {}
+    if {[info exists global_options(ports_space_units)]} {
+        set units [complete_size_units $global_options(ports_space_units)]
+    }
+    set spaceall 0.0
+    foreachport $portlist {
+        set space 0.0
+        set files [registry::port_registered $portname]
+        if { $files != 0 } {
+            if { [llength $files] > 0 } {
+                foreach file $files {
+                    catch {
+                        set space [expr $space + [file size $file] ]
+                    }
+                }
+                set msg "[bytesize $space $units] $portname"
+                if { $portversion != {} } {
+                    append msg " @$portversion"
+                }
+                puts $msg
+                set spaceall [expr $space + $spaceall]
+            } else {
+                puts "Port $portname does not contain any file or is not active."
+            }
+        } else {
+            puts "Port $portname is not installed."
+        }
+    }
+    if {[llength $portlist] > 1} {
+        puts "[bytesize $spaceall $units] total"
+    }
+    return 0
+}
+
 proc action_variants { action portlist opts } {
     global global_variations
     set status 0
@@ -3185,7 +3325,7 @@
                         # selected by variants.conf, prefixed with (+)/(-)
                         set varmodifier "($global_variations($v))"
                     } elseif {[info exists variant(is_default)]} {
-                        set varmodifier "\[+]"
+                        set varmodifier "\[$variant(is_default)\]"
                     } else {
                         set varmodifier "   "
                     }
@@ -3793,6 +3933,7 @@
     installed   [list action_installed      [ACTION_ARGS_PORTS]] \
     outdated    [list action_outdated       [ACTION_ARGS_PORTS]] \
     contents    [list action_contents       [ACTION_ARGS_PORTS]] \
+    space       [list action_space          [ACTION_ARGS_PORTS]] \
     dependents  [list action_dependents     [ACTION_ARGS_PORTS]] \
     rdependents [list action_dependents     [ACTION_ARGS_PORTS]] \
     deps        [list action_deps           [ACTION_ARGS_PORTS]] \
@@ -3848,17 +3989,51 @@
     exit        [list action_exit           [ACTION_ARGS_NONE]] \
 ]
 
+# Expand "action".
+# Returns an action proc, or a list of matching action procs, or the action passed in
+proc find_action { action } {
+    global action_array
+    
+    if { ! [info exists action_array($action)] } {
+        set guess [guess_action $action]
+        if { [info exists action_array($guess)] } {
+            return $guess
+        }
+        return $guess
+    }
+    
+    return $action
+}
+
+# Expand action
+# If there's more than one match, return the next possibility
 proc find_action_proc { action } {
     global action_array
     
     set action_proc ""
     if { [info exists action_array($action)] } {
         set action_proc [lindex $action_array($action) 0]
+    } else {
+        set action [complete_action $action]
+        if { [info exists action_array($action)] } {
+            set action_proc [lindex $action_array($action) 0]
+        }
     }
     
     return $action_proc
 }
 
+proc get_action_proc { action } {
+    global action_array
+    
+    set action_proc ""
+    if { [info exists action_array($action)] } {
+        set action_proc [lindex $action_array($action) 0]
+    }
+    
+    return $action_proc
+}
+
 # Returns whether an action expects text arguments at all,
 # expects text arguments or wants an expanded list of ports
 # Return values are constants:
@@ -3891,6 +4066,7 @@
                  line long_description
                  maintainer maintainers name platform platforms portdir pretty
                  replaced_by revision variant variants version}
+    contents    {size {units 1}}
     deps        {index no-build}
     rdeps       {index no-build full}
     rdependents {full}
@@ -3900,6 +4076,7 @@
                  long_description maintainer maintainers name platform
                  platforms portdir regex revision variant variants version}
     selfupdate  {nosync}
+    space       {{units 1}}
     activate    {no-exec}
     deactivate  {no-exec}
     uninstall   {follow-dependents follow-dependencies no-exec}
@@ -4135,9 +4312,16 @@
         array set global_options $global_options_base
         
         # Find an action to execute
-        set action_proc [find_action_proc $action]
-        if { $action_proc == "" } {
-            puts "Unrecognized action \"$action\""
+        set actions [find_action $action]
+        if {[llength $actions] == 1} {
+            set action [lindex $actions 0]
+            set action_proc [get_action_proc $action]
+        } else {
+            if {[llength $actions] > 1} {
+                puts "Ambiguous action \"$action\": could be any of {$actions}."
+            } else {
+                puts "Unrecognized action \"$action\""
+            }
             set action_status 1
             break
         }
@@ -4227,6 +4411,7 @@
 }
 
 
+# return text action beginning with $text
 proc complete_action { text state } {   
     global action_array
     global complete_choices complete_position
@@ -4242,7 +4427,19 @@
     return $word
 }
 
+# return all actions beginning with $text
+proc guess_action { text } {   
+    global action_array
 
+    return [array names action_array "[string tolower $text]*"]
+
+    if { [llength $complete_choices ] == 1 } {
+        return [lindex $complete_choices 0]
+    }
+
+    return {}
+}
+
 proc attempt_completion { text word start end } {
     # If the word starts with '~', or contains '.' or '/', then use the build-in
     # completion to complete the word

Modified: branches/gsoc11-rev-upgrade/base/src/port/portindex.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port/portindex.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port/portindex.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -259,7 +259,7 @@
 foreach key {categories depends_fetch depends_extract depends_build \
              depends_lib depends_run description epoch homepage \
              long_description maintainers name platforms revision variants \
-             version portdir portarchive replaced_by license} {
+             version portdir portarchive replaced_by license installs_libs} {
     set keepkeys($key) 1
 }
 mporttraverse pindex $directory

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/fetch_common.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/fetch_common.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/fetch_common.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # $Id$
 #
 # Copyright (c) 2002 - 2003 Apple Inc.
-# Copyright (c) 2004-2010 The MacPorts Project
+# Copyright (c) 2004 - 2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -241,8 +241,13 @@
         }
 
         foreach site $urllist {
+            if {[string range $site 0 6] == "file://"} {
+                set pingtimes(localhost) 0
+                continue
+            }
+            
             regexp $hostregex $site -> host
-
+            
             if { [info exists seen($host)] } {
                 continue
             }
@@ -284,7 +289,11 @@
 
         set pinglist {}
         foreach site $urllist {
-            regexp $hostregex $site -> host
+            if {[string range $site 0 6] == "file://"} {
+                set host localhost
+            } else {
+                regexp $hostregex $site -> host
+            }
             lappend pinglist [ list $site $pingtimes($host) ]
         }
 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/port.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/port.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/port.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # port.tcl
 # $Id$
 #
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/port_autoconf.tcl.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,7 +1,8 @@
 # port_autoconf.tcl.in
 # $Id$
 #
-# Copyright (c) 2002 - 2004 Apple Computer, Inc.
+# Copyright (c) 2005 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -12,7 +13,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portactivate.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portactivate.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portactivate.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portactivate.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2005, 2007, 2009-2011 The MacPorts Project
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #
@@ -60,7 +61,7 @@
 proc portactivate::activate_main {args} {
     global env subport version revision portvariants user_options PortInfo
 
-    registry_activate $subport "${version}_${revision}${portvariants}" [array get user_options]
+    registry_activate $subport $version $revision $portvariants [array get user_options]
 
     # Display notes at the end of the activation phase.
     if {[info exists PortInfo(notes)] && $PortInfo(notes) ne {}} {

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portbuild.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portbuild.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portbuild.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2007 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portchecksum.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portchecksum.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2004 Apple Computer, Inc.
+# Copyright (c) 2002 - 2004 Apple Inc.
 # Copyright (c) 2004 - 2005 Paul Guyot <pguyot at kallisys.net>
+# Copyright (c) 2006-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #
@@ -58,7 +59,7 @@
 set checksum_types_count [llength $checksum_types]
 
 # types to recommend if none are specified in the portfile
-set default_checksum_types {sha1 rmd160}
+set default_checksum_types {rmd160 sha256}
 
 # Using global all_dist_files, parse the checksums and store them into the
 # global array checksums_array.
@@ -310,7 +311,7 @@
             ui_notice "***"
             ui_notice "The non-matching file appears to be HTML. See this page for possible reasons"
             ui_notice "for the checksum mismatch:"
-            ui_notice "<http://trac.macports.org/wiki/MisbehavingServers>"
+            ui_notice "<https://trac.macports.org/wiki/MisbehavingServers>"
             ui_notice "***"
         }
 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portclean.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portclean.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portclean.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portclean.tcl
 # $Id$
 #
+# Copyright (c) 2005-2007, 2009-2011 The MacPorts Project
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #
@@ -50,9 +51,13 @@
 set_ui_prefix
 
 proc portclean::clean_start {args} {
-    global UI_PREFIX
+    global UI_PREFIX prefix
 
     ui_notice "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option subport]]"
+
+    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
+        elevateToRoot "clean"
+    }
 }
 
 proc portclean::clean_main {args} {

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portconfigure.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portconfigure.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portconfigure.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2007 - 2011 The MacPorts Project
 # Copyright (c) 2007 Markus W. Weissmann <mww at macports.org>
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -351,13 +352,15 @@
 
 # internal function to determine the default compiler
 proc portconfigure::configure_get_default_compiler {args} {
-    global macosx_deployment_target
-    switch -exact ${macosx_deployment_target} {
-        "10.4"      -
-        "10.5"      { return gcc-4.0 }
-        "10.6"      { return gcc-4.2 }
-        "10.7"      { return llvm-gcc-4.2 }
-        default     { return gcc }
+    global xcodeversion macosx_deployment_target
+    if {$xcodeversion == "none" || $xcodeversion == ""} {
+        return gcc
+    } elseif {[rpm-vercomp $xcodeversion 4.0] >= 0} {
+        return llvm-gcc-4.2
+    } elseif {[rpm-vercomp $xcodeversion 3.2] >= 0 && $macosx_deployment_target != "10.4"} {
+        return gcc-4.2
+    } else {
+        return gcc-4.0
     }
 }
 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portdeactivate.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portdeactivate.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portdeactivate.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # portdeactivate.tcl
 # $Id$
 #
-# Copyright (c) 2010 The MacPorts Project
+# Copyright (c) 2010-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -58,6 +58,6 @@
 
 proc portdeactivate::deactivate_main {args} {
     global subport version revision portvariants user_options
-    registry_deactivate $subport "${version}_${revision}${portvariants}" [array get user_options]
+    registry_deactivate $subport $version $revision $portvariants [array get user_options]
     return 0
 }

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portdepends.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portdepends.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portdepends.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portdepends.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2005, 2007-2009 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portdestroot.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portdestroot.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portdestroot.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2002 - 2003 Apple Inc.
 # Copyright (c) 2004 - 2005 Robert Shaw <rshaw at opendarwin.org>
+# Copyright (c) 2004-2005, 2007-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portdistcheck.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portdistcheck.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portdistcheck.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,6 +3,7 @@
 #
 # $Id$
 #
+# Copyright (c) 2007-2011 The MacPorts Project
 # Copyright (c) 2005-2006 Paul Guyot <pguyot at kallisys.net>,
 # All rights reserved.
 #
@@ -15,7 +16,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its
+# 3. Neither the name of The MacPorts Project nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portdistfiles.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portdistfiles.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portdistfiles.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # portdistfiles.tcl
 # $Id$
 #
-# Copyright (c) 2008 MacPorts Project
+# Copyright (c) 2008-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -53,7 +53,7 @@
 }
 
 proc portdistfiles::distfiles_main {args} {
-    global UI_PREFIX master_sites checksums_array portdbpath dist_subdir
+    global UI_PREFIX master_sites checksums_array portdbpath dist_subdir all_dist_files
     
     # give up on ports that do not provide URLs
     if {![info exists master_sites] || $master_sites == "{}"} {
@@ -64,6 +64,11 @@
     set fetch_urls {}
     portfetch::checkfiles fetch_urls
 
+    # also give up on ports that don't have any distfiles
+    if {![info exists all_dist_files]} {
+        return 0
+    }
+
     # get checksum data from the portfile and parse it
     set checksums_str [option checksums]
     set result [portchecksum::parse_checksums $checksums_str]

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portextract.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portextract.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portextract.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portextract.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2005, 2007-2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # Copyright (c) 2007 Markus W. Weissmann <mww at macports.org>
 # All rights reserved.
 #
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portfetch.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portfetch.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portfetch.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2004 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portinstall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portinstall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,8 +2,9 @@
 # portinstall.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2002 - 2004 Apple Inc.
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
+# Copyright (c) 2005, 2007 - 2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -54,7 +55,7 @@
 
 proc portinstall::install_start {args} {
     global UI_PREFIX subport version revision portvariants
-    global prefix registry_open registry.format registry.path
+    global prefix registry_open registry.path
     ui_notice "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $subport $version $revision $portvariants]"
     
     # start gsoc08-privileges
@@ -66,7 +67,7 @@
     }
     # end gsoc08-privileges
     
-    if {${registry.format} == "receipt_sqlite" && ![info exists registry_open]} {
+    if {![info exists registry_open]} {
         registry::open [file join ${registry.path} registry registry.db]
         set registry_open yes
     }
@@ -483,7 +484,7 @@
     homepage depends_run package-install workdir workpath \
     worksrcdir UI_PREFIX destroot revision maintainers user_options \
     portvariants negated_variants targets depends_lib PortInfo epoch license \
-    registry.format os.platform os.major portarchivetype installPlist
+    os.platform os.major portarchivetype installPlist
 
     set oldpwd [pwd]
     if {$oldpwd == ""} {
@@ -503,112 +504,54 @@
         set installPlist [extract_contents $location $portarchivetype]
     }
 
-    if {[string equal ${registry.format} "receipt_sqlite"]} {
-        # registry2.0
-
-        # can't do this inside the write transaction due to deadlock issues with _get_dep_port
-        set dep_portnames [list]
-        foreach deplist {depends_lib depends_run} {
-            if {[info exists $deplist]} {
-                foreach dep [set $deplist] {
-                    set dep_portname [_get_dep_port $dep]
-                    if {$dep_portname != ""} {
-                        lappend dep_portnames $dep_portname
-                    }
+    # can't do this inside the write transaction due to deadlock issues with _get_dep_port
+    set dep_portnames [list]
+    foreach deplist {depends_lib depends_run} {
+        if {[info exists $deplist]} {
+            foreach dep [set $deplist] {
+                set dep_portname [_get_dep_port $dep]
+                if {$dep_portname != ""} {
+                    lappend dep_portnames $dep_portname
                 }
             }
         }
+    }
 
-        registry::write {
+    registry::write {
 
-            set regref [registry::entry create $subport $version $revision $portvariants $epoch]
+        set regref [registry::entry create $subport $version $revision $portvariants $epoch]
 
-            if {[info exists user_options(ports_requested)]} {
-                $regref requested $user_options(ports_requested)
-            } else {
-                $regref requested 0
-            }
-            $regref os_platform ${os.platform}
-            $regref os_major ${os.major}
-            $regref archs [get_canonical_archs]
-            # Trick to have a portable GMT-POSIX epoch-based time.
-            $regref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
-            if {[info exists negated_variants]} {
-                $regref negated_variants $negated_variants
-            }
-
-            foreach dep_portname $dep_portnames {
-                $regref depends $dep_portname
-            }
-
-            $regref installtype image
-            $regref state imaged
-            $regref location $location
-
-            if {[info exists installPlist]} {
-                # register files
-                $regref map $installPlist
-            }
-            
-            # store portfile
-            set fd [open [file join ${portpath} Portfile]]
-            $regref portfile [read $fd]
-            close $fd
+        if {[info exists user_options(ports_requested)]} {
+            $regref requested $user_options(ports_requested)
+        } else {
+            $regref requested 0
         }
-    } else {
-        # Begin the registry entry
-        set regref [registry_new $subport $version $revision $portvariants $epoch]
+        $regref os_platform ${os.platform}
+        $regref os_major ${os.major}
+        $regref archs [get_canonical_archs]
+        # Trick to have a portable GMT-POSIX epoch-based time.
+        $regref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
         if {[info exists negated_variants]} {
-            registry_prop_store $regref negated_variants $negated_variants
+            $regref negated_variants $negated_variants
         }
 
-        registry_prop_store $regref location $location
-
-        if {[info exists user_options(ports_requested)]} {
-            registry_prop_store $regref requested $user_options(ports_requested)
-        } else {
-            registry_prop_store $regref requested 0
+        foreach dep_portname $dep_portnames {
+            $regref depends $dep_portname
         }
-        registry_prop_store $regref categories $categories
 
-        registry_prop_store $regref os_platform ${os.platform}
-        registry_prop_store $regref os_major ${os.major}
-        registry_prop_store $regref archs [get_canonical_archs]
+        $regref installtype image
+        $regref state imaged
+        $regref location $location
 
-        if {[info exists description]} {
-            registry_prop_store $regref description [string map {\n \\n} ${description}]
-        }
-        if {[info exists long_description]} {
-            registry_prop_store $regref long_description [string map {\n \\n} ${long_description}]
-        }
-        if {[info exists license]} {
-            registry_prop_store $regref license ${license}
-        }
-        if {[info exists homepage]} {
-            registry_prop_store $regref homepage ${homepage}
-        }
-        if {[info exists maintainers]} {
-            registry_prop_store $regref maintainers ${maintainers}
-        }
-        if {[info exists depends_run]} {
-            registry_prop_store $regref depends_run $depends_run
-            registry_register_deps $depends_run $subport
-        }
-        if {[info exists depends_lib]} {
-            registry_prop_store $regref depends_lib $depends_lib
-            registry_register_deps $depends_lib $subport
-        }
         if {[info exists installPlist]} {
-            registry_prop_store $regref contents [_fake_fileinfo_for_index $installPlist]
+            # register files
+            $regref map $installPlist
         }
-        if {[info exists package-install]} {
-            registry_prop_store $regref package-install ${package-install}
-        }
-        if {[info proc pkg_uninstall] == "pkg_uninstall"} {
-            registry_prop_store $regref pkg_uninstall [proc_disasm pkg_uninstall]
-        }
-
-        registry_write $regref
+        
+        # store portfile
+        set fd [open [file join ${portpath} Portfile]]
+        $regref portfile [read $fd]
+        close $fd
     }
 
     _cd $oldpwd

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portlivecheck.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portlivecheck.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,7 +3,8 @@
 #
 # $Id$
 #
-# Copyright (c) 2005-2006 Paul Guyot <pguyot at kallisys.net>,
+# Copyright (c) 2007-2011 The MacPorts Project
+# Copyright (c) 2005-2007 Paul Guyot <pguyot at kallisys.net>,
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -15,7 +16,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its
+# 3. Neither the name of The MacPorts Project nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portload.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portload.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portload.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # portsubmit.tcl
 # $Id$
 #
-# Copyright (c) 2007 MacPorts Project
+# Copyright (c) 2007, 2009, 2011 The MacPorts Project
 # Copyright (c) 2007 James D. Berry
 # All rights reserved.
 #
@@ -14,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -36,6 +36,7 @@
 
 set org.macports.load [target_new org.macports.load portload::load_main]
 target_runtype ${org.macports.load} always
+target_state ${org.macports.load} no
 target_provides ${org.macports.load} load 
 target_requires ${org.macports.load} main
 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portmain.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portmain.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portmain.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portmain.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2004 - 2005, 2007 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -51,7 +52,7 @@
         os.platform os.subplatform os.version os.major os.arch os.endian \
         platforms default_variants install.user install.group \
         macosx_deployment_target universal_variant os.universal_supported \
-        supported_archs depends_skip_archcheck \
+        supported_archs depends_skip_archcheck installs_libs \
         copy_log_files \
         compiler.cpath compiler.library_path \
         add_users
@@ -64,7 +65,7 @@
 option_proc notes handle_option_string
 
 # Export options via PortInfo
-options_export name version revision epoch categories maintainers platforms description long_description notes homepage license provides conflicts replaced_by
+options_export name version revision epoch categories maintainers platforms description long_description notes homepage license provides conflicts replaced_by installs_libs
 
 default subport {[portmain::get_default_subport]}
 proc portmain::get_default_subport {} {

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portmirror.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portmirror.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portmirror.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,6 +3,7 @@
 #
 # $Id$
 #
+# Copyright (c) 2007-2011 The MacPorts Project
 # Copyright (c) 2006 Paul Guyot <pguyot at kallisys.net>,
 # All rights reserved.
 #
@@ -15,7 +16,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its
+# 3. Neither the name of The MacPorts Project nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portpatch.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portpatch.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portpatch.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portpatch.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2004, 2006-2007, 2009-2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portstartupitem.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portstartupitem.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portstartupitem.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,7 +3,7 @@
 #
 # $Id$
 #
-# Copyright (c) 2004-2007 MacPorts Project
+# Copyright (c) 2004-2011 The MacPorts Project
 # Copyright (c) 2006-2007 James D. Berry
 # Copyright (c) 2004,2005 Markus W. Weissman <mww at macports.org>
 # All rights reserved.
@@ -17,7 +17,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its
+# 3. Neither the name of The MacPorts Project nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portsubmit.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portsubmit.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portsubmit.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,8 @@
 # portsubmit.tcl
 # $Id$
 #
-# Copyright (c) 2002 - 2004 Apple Computer, Inc.
+# Copyright (c) 2007 - 2011 The MacPorts Project
+# Copyright (c) 2002 - 2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -13,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/porttrace.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/porttrace.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/porttrace.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -15,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its
+# 3. Neither the name of The MacPorts Project nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
 #

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portuninstall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portuninstall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portuninstall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # portuninstall.tcl
 # $Id$
 #
-# Copyright (c) 2010 The MacPorts Project
+# Copyright (c) 2010-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@
 
 proc portuninstall::uninstall_start {args} {
     global prefix
-    if { ![file writable $prefix] } {
+    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
         # if install location is not writable, need root privileges
         elevateToRoot "uninstall"
     }
@@ -58,6 +58,6 @@
 
 proc portuninstall::uninstall_main {args} {
     global subport version revision portvariants user_options
-    registry_uninstall $subport "${version}_${revision}${portvariants}" [array get user_options]
+    registry_uninstall $subport $version $revision $portvariants [array get user_options]
     return 0
 }

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portunload.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portunload.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portunload.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,7 +2,7 @@
 # portsubmit.tcl
 # $Id$
 #
-# Copyright (c) 2007 MacPorts Project
+# Copyright (c) 2007, 2009, 2011 The MacPorts Project
 # Copyright (c) 2007 James D. Berry
 # All rights reserved.
 #
@@ -14,7 +14,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 
@@ -36,6 +36,7 @@
 
 set org.macports.unload [target_new org.macports.unload portunload::unload_main]
 target_runtype ${org.macports.unload} always
+target_state ${org.macports.unload} no
 target_provides ${org.macports.unload} unload 
 target_requires ${org.macports.unload} main
 

Modified: branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/port1.0/portutil.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,9 +2,10 @@
 # portutil.tcl
 # $Id$
 #
+# Copyright (c) 2002-2003 Apple Inc.
 # Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
-# Copyright (c) 2006, 2007 Markus W. Weissmann <mww at macports.org>
+# Copyright (c) 2006-2007 Markus W. Weissmann <mww at macports.org>
+# Copyright (c) 2004-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -15,7 +16,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 #
@@ -1273,13 +1274,14 @@
 
             # otherwise execute the task.
             if {$skipped == 0} {
-                set target [ditem_key $ditem provides]
+                # change current phase shown in log
+                set_phase $target
 
                 # Execute pre-run procedure
                 if {[ditem_contains $ditem prerun]} {
                     set result [catch {[ditem_key $ditem prerun] $targetname} errstr]
                 }
-                set_phase  $target
+
                 #start tracelib
                 if {($result ==0
                   && [info exists ports_trace]
@@ -1576,7 +1578,7 @@
         if {![file writable $statefile] && ![tbool ports_dryrun]} {
             return -code error "$statefile is not writable - check permission on port directory"
         }
-        if {[file mtime ${portpath}/Portfile] >= [clock seconds]} {
+        if {[file mtime ${portpath}/Portfile] > [clock seconds]} {
             return -code error "Portfile is from the future - check date and time of your system"
         }
         if {!([info exists ports_ignore_older] && $ports_ignore_older == "yes") && [file mtime $statefile] < [file mtime ${portpath}/Portfile]} {
@@ -2027,8 +2029,7 @@
 
                     if {![info exists variations($variant)]} {
                         # Set is_default and update vinfo.
-                        array set info [list is_default val]
-                        array set vinfo [list $variant [array get info]]
+                        array set vinfo [list $variant [list is_default $val]]
 
                         set variations($variant) $val
                     }
@@ -2506,6 +2507,15 @@
     }
 }
 
+proc validate_macportsuser {} {
+    global macportsuser
+    if {[getuid] == 0 && $macportsuser != "root" && 
+        ([existsuser $macportsuser] == 0 || [existsgroup $macportsuser] == 0 )} {
+        ui_warn "configured user/group $macportsuser does not exist, will build as root"
+        set macportsuser "root"
+    }
+}
+
 # dependency analysis helpers
 
 ### _libtest is private; subject to change without notice
@@ -2633,6 +2643,18 @@
     }
 }
 
+# returns the flags that should be passed to the compiler to choose arch(s)
+proc get_canonical_archflags {{tool cc}} {
+    if {![variant_exists universal] || ![variant_isset universal]} {
+        return [option configure.${tool}_archflags]
+    } else {
+        if {$tool == "cc" || $tool == "objc"} {
+            set tool c
+        }
+        return [option configure.universal_${tool}flags]
+    }
+}
+
 # check that the selected archs are supported
 proc check_supported_archs {} {
     global supported_archs build_arch universal_archs configure.build_arch configure.universal_archs subport
@@ -2671,7 +2693,7 @@
             default {
                 set min 3.2
                 set ok 3.2
-                set rec 3.2.4
+                set rec 3.2.6
             }
         }
         if {$xcodeversion == "none"} {
@@ -2689,7 +2711,7 @@
 # check if we can unarchive this port
 proc _archive_available {} {
     global subport version revision portvariants ports_source_only workpath \
-           registry.path os.platform os.major
+           registry.path os.platform os.major porturl
 
     if {[tbool ports_source_only]} {
         return 0
@@ -2703,10 +2725,13 @@
             break
         }
     }
-    
-    # TODO: also check if porturl points to an archive
-    # maybe check if there's an archive available on the server too - this
-    # is kind of useless otherwise now that archive == installed image
 
+    if {!$found && [file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]] && [file extension $porturl] != ""} {
+        set found 1
+    }
+
+    # TODO: maybe check if there's an archive available on the server - this
+    # is much less useful otherwise now that archive == installed image
+
     return $found
 }

Modified: branches/gsoc11-rev-upgrade/base/src/portindex/portregister.pl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/portindex/portregister.pl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/portindex/portregister.pl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# Copyright (c) 2003-2004 Apple Computer, Inc.
+# Copyright (c) 2003-2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/portindex/portsubmit.pl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/portindex/portsubmit.pl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/portindex/portsubmit.pl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# Copyright (c) 2003-2004 Apple Computer, Inc.
+# Copyright (c) 2003-2004 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -21,8 +21,8 @@
 .PHONY: test
 
 test:: ${SHLIB_NAME}
-	${TCLSH} tests/entry.tcl ${SHLIB_NAME}
-	${TCLSH} tests/depends.tcl ${SHLIB_NAME}
+	${TCLSH} tests/entry.tcl ./${SHLIB_NAME}
+	${TCLSH} tests/depends.tcl ./${SHLIB_NAME}
 
 distclean:: clean
 	rm -f registry_autoconf.tcl

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,6 +2,7 @@
 # portimage.tcl
 # $Id$
 #
+# Copyright (c) 2004-2005, 2007-2011 The MacPorts Project
 # Copyright (c) 2004 Will Barton <wbb4 at opendarwin.org>
 # Copyright (c) 2002 Apple Inc.
 # All rights reserved.
@@ -61,15 +62,23 @@
 namespace eval portimage {
 
 variable force 0
-variable use_reg2 0
 variable noexec 0
 
+# takes a composite version spec rather than separate version,revision,variants
+proc activate_composite {name {v ""} {optionslist ""}} {
+    if {$v == ""} {
+        return [activate $name "" "" 0 $optionslist]
+    } elseif {[registry::decode_spec $v version revision variants]} {
+        return [activate $name $version $revision $variants $optionslist]
+    }
+    throw registry::invalid "Registry error: Invalid version '$v' specified for ${name}. Please specify a version as recorded in the port registry."
+}
+
 # Activate a "Port Image"
-proc activate {name v optionslist} {
-    global macports::prefix macports::registry.format macports::registry.path registry_open UI_PREFIX
+proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} {
+    global macports::prefix macports::registry.path registry_open UI_PREFIX
     array set options $optionslist
     variable force
-    variable use_reg2
     variable noexec
 
     if {[info exists options(ports_force)] && [string is true -strict $options(ports_force)] } {
@@ -78,128 +87,67 @@
     if {[info exists options(ports_activate_no-exec)]} {
         set noexec $options(ports_activate_no-exec)
     }
-    if {[string equal ${macports::registry.format} "receipt_sqlite"]} {
-        set use_reg2 1
-        if {![info exists registry_open]} {
-            registry::open [::file join ${macports::registry.path} registry registry.db]
-            set registry_open yes
-        }
+    if {![info exists registry_open]} {
+        registry::open [::file join ${macports::registry.path} registry registry.db]
+        set registry_open yes
     }
     set todeactivate [list]
 
-    if {$use_reg2} {
-        registry::read {
+    registry::read {
 
-            set requested [_check_registry $name $v]
-            # set name again since the one we were passed may not have had the correct case
-            set name [$requested name]
-            set version [$requested version]
-            set revision [$requested revision]
-            set variants [$requested variants]
-            set specifier "${version}_${revision}${variants}"
-            set location [$requested location]
-
-            # if another version of this port is active, deactivate it first
-            set current [registry::entry installed $name]
-            foreach i $current {
-                if { ![string equal $specifier "[$i version]_[$i revision][$i variants]"] } {
-                    lappend todeactivate $i
-                }
-            }
-
-            # this shouldn't be possible
-            if { ![string equal [$requested installtype] "image"] } {
-                return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
-            }
-            if {![::file isfile $location]} {
-                return -code error "Image error: Can't find image file $location"
-            }
-            if { [string equal [$requested state] "installed"] } {
-                return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
-            }
-        }
-        foreach a $todeactivate {
-            if {$noexec || ![registry::run_target $a deactivate [list ports_nodepcheck 1]]} {
-                deactivate $name "[$a version]_[$a revision][$a variants]" [list ports_nodepcheck 1]
-            }
-        }
-    } else {
-        # registry1.0
-        set ilist [_check_registry $name $v]
+        set requested [_check_registry $name $version $revision $variants]
         # set name again since the one we were passed may not have had the correct case
-        set name [lindex $ilist 0]
-        set version [lindex $ilist 1]
-        set revision [lindex $ilist 2]
-        set variants [lindex $ilist 3]
+        set name [$requested name]
+        set version [$requested version]
+        set revision [$requested revision]
+        set variants [$requested variants]
+        set specifier "${version}_${revision}${variants}"
+        set location [$requested location]
 
         # if another version of this port is active, deactivate it first
-        set ilist [registry::installed $name]
-        if { [llength $ilist] > 1 } {
-            foreach i $ilist {
-                set iversion [lindex $i 1]
-                set irevision [lindex $i 2]
-                set ivariants [lindex $i 3]
-                set iactive [lindex $i 4]
-                if { ![string equal "${iversion}_${irevision}${ivariants}" "${version}_${revision}${variants}"] && $iactive == 1 } {
-                    lappend todeactivate "${iversion}_${irevision}${ivariants}"
-                }
+        set current [registry::entry installed $name]
+        foreach i $current {
+            if { ![string equal $specifier "[$i version]_[$i revision][$i variants]"] } {
+                lappend todeactivate $i
             }
         }
 
-        set ref [registry::open_entry $name $version $revision $variants]
-
-        if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
-            return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
+        # this shouldn't be possible
+        if { ![string equal [$requested installtype] "image"] } {
+            return -code error "Image error: ${name} @${specifier} not installed as an image."
         }
-        set location [registry::property_retrieve $ref location]
         if {![::file isfile $location]} {
             return -code error "Image error: Can't find image file $location"
         }
-        if { [registry::property_retrieve $ref active] != 0 } {
-            return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
+        if { [string equal [$requested state] "installed"] } {
+            return -code error "Image error: ${name} @${specifier} is already active."
         }
-
-        foreach a $todeactivate {
-            deactivate $name $a [list ports_nodepcheck 1]
+    }
+    foreach a $todeactivate {
+        if {$noexec || ![registry::run_target $a deactivate [list ports_nodepcheck 1]]} {
+            deactivate $name [$a version] [$a revision] [$a variants] [list ports_nodepcheck 1]
         }
     }
 
-    if {$v != ""} {
-        ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
-    } else {
-        ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"
-    }
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $specifier]"
 
-    if {$use_reg2} {
-        _activate_contents $requested
-        $requested state installed
-    } else {
-        set contents [registry::property_retrieve $ref contents]
+    _activate_contents $requested
+    $requested state installed
+}
 
-        set imagefiles {}
-        foreach content_element $contents {
-            lappend imagefiles [lindex $content_element 0]
-        }
-
-        registry::open_file_map
-        _activate_contents $name $imagefiles $location
-
-        registry::property_store $ref active 1
-
-        registry::write_entry $ref
-
-        foreach file $imagefiles {
-            registry::register_file $file $name
-        }
-        registry::write_file_map
-        registry::close_file_map
+# takes a composite version spec rather than separate version,revision,variants
+proc deactivate_composite {name {v ""} {optionslist ""}} {
+    if {$v == ""} {
+        return [deactivate $name "" "" 0 $optionslist]
+    } elseif {[registry::decode_spec $v version revision variants]} {
+        return [deactivate $name $version $revision $variants $optionslist]
     }
+    throw registry::invalid "Registry error: Invalid version '$v' specified for ${name}. Please specify a version as recorded in the port registry."
 }
 
-proc deactivate {name v optionslist} {
-    global UI_PREFIX macports::registry.format macports::registry.path registry_open
+proc deactivate {name {version ""} {revision ""} {variants 0} {optionslist ""}} {
+    global UI_PREFIX macports::registry.path registry_open
     array set options $optionslist
-    variable use_reg2
 
     if {[info exists options(ports_force)] && [string is true -strict $options(ports_force)] } {
         # this not using the namespace variable is correct, since activate
@@ -209,157 +157,89 @@
     } else {
         set force 0
     }
-    if {[string equal ${macports::registry.format} "receipt_sqlite"]} {
-        set use_reg2 1
-        if {![info exists registry_open]} {
-            registry::open [::file join ${macports::registry.path} registry registry.db]
-            set registry_open yes
-        }
+    if {![info exists registry_open]} {
+        registry::open [::file join ${macports::registry.path} registry registry.db]
+        set registry_open yes
     }
 
-    if {$use_reg2} {
-        if { [string equal $name ""] } {
-            throw registry::image-error "Registry error: Please specify the name of the port."
-        }
-        set ilist [registry::entry installed $name]
-        if { [llength $ilist] == 1 } {
-            set requested [lindex $ilist 0]
-        } else {
-            throw registry::image-error "Image error: port ${name} is not active."
-        }
-        # set name again since the one we were passed may not have had the correct case
-        set name [$requested name]
-        set version [$requested version]
-        set revision [$requested revision]
-        set variants [$requested variants]
-        set specifier "${version}_${revision}${variants}"
+    if { [string equal $name ""] } {
+        throw registry::image-error "Registry error: Please specify the name of the port."
+    }
+    set ilist [registry::entry installed $name]
+    if { [llength $ilist] == 1 } {
+        set requested [lindex $ilist 0]
     } else {
-        set ilist [registry::active $name]
-        if { [llength $ilist] > 1 } {
-            return -code error "Registry error: Please specify the name of the port."
-        } else {
-            set ilist [lindex $ilist 0]
-        }
-        # set name again since the one we were passed may not have had the correct case
-        set name [lindex $ilist 0]
-        set version [lindex $ilist 1]
-        set revision [lindex $ilist 2]
-        set variants [lindex $ilist 3]
-        set specifier "${version}_${revision}${variants}"
+        throw registry::image-error "Image error: port ${name} is not active."
     }
+    # set name again since the one we were passed may not have had the correct case
+    set name [$requested name]
+    set specifier "[$requested version]_[$requested revision][$requested variants]"
 
-    if { $v != "" && ![string equal $specifier $v] } {
+    if {$version != "" && ($version != [$requested version] ||
+        ($revision != "" && ($revision != [$requested revision] || $variants != [$requested variants])))} {
+        set v $version
+        if {$revision != ""} {
+            append v _${revision}${variants}
+        }
         return -code error "Active version of $name is not $v but ${specifier}."
     }
 
-    if {$v != ""} {
-        ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $v]"
-    } else {
-        ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s"] $name]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $specifier]"
+
+    if { ![string equal [$requested installtype] "image"] } {
+        return -code error "Image error: ${name} @${specifier} not installed as an image."
     }
+    # this shouldn't be possible
+    if { [$requested state] != "installed" } {
+        return -code error "Image error: ${name} @${specifier} is not active."
+    }
 
-    if {$use_reg2} {
-        if { ![string equal [$requested installtype] "image"] } {
-            return -code error "Image error: ${name} @${specifier} not installed as an image."
-        }
-        # this shouldn't be possible
-        if { [$requested state] != "installed" } {
-            return -code error "Image error: ${name} @${specifier} is not active."
-        }
-
-        if {![info exists options(ports_nodepcheck)] || ![string is true -strict $options(ports_nodepcheck)]} {
-            registry::check_dependents $requested $force "deactivate"
-        }
-
-        _deactivate_contents $requested [$requested files] $force
-        $requested state imaged
-    } else {
-        set ref [registry::open_entry $name $version $revision $variants]
-
-        if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
-            return -code error "Image error: ${name} @${specifier} not installed as an image."
-        }
-        if { [registry::property_retrieve $ref active] != 1 } {
-            return -code error "Image error: ${name} @${specifier} is not active."
-        }
-
-        registry::open_file_map
-        set imagefiles [registry::port_registered $name]
-
-        _deactivate_contents $name $imagefiles
-
-        foreach file $imagefiles {
-            registry::unregister_file $file
-        }
-        registry::write_file_map
-        registry::close_file_map
-
-        registry::property_store $ref active 0
-
-        registry::write_entry $ref
+    if {![info exists options(ports_nodepcheck)] || ![string is true -strict $options(ports_nodepcheck)]} {
+        registry::check_dependents $requested $force "deactivate"
     }
+
+    _deactivate_contents $requested [$requested files] $force
+    $requested state imaged
 }
 
-proc _check_registry {name v} {
+proc _check_registry {name version revision variants} {
     global UI_PREFIX
-    variable use_reg2
 
-    if {$use_reg2} {
-        if { [registry::decode_spec $v version revision variants] } {
-            set ilist [registry::entry imaged $name $version $revision $variants]
-            set valid 1
-        } else {
-            set valid [string equal $v {}]
-            set ilist [registry::entry imaged $name]
+    set searchkeys $name
+    set composite_spec ""
+    if {$version != ""} {
+        lappend searchkeys $version
+        set composite_spec $version
+        # restriction imposed by underlying registry API (see entry.c):
+        # if a revision is specified, so must variants be
+        if {$revision != ""} {
+            lappend searchkeys $revision $variants
+            append composite_spec _${revision}${variants}
         }
+    }
+    set ilist [eval registry::entry imaged $searchkeys]
 
-        if { [llength $ilist] > 1 || (!$valid && [llength $ilist] == 1) } {
-            ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
-            foreach i $ilist {
-                set iname [$i name]
-                set iversion [$i version]
-                set irevision [$i revision]
-                set ivariants [$i variants]
-                if { [$i state] == "installed" } {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
-                } else {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
-                }
-            }
-            if { $valid } {
-                throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
+    if { [llength $ilist] > 1 } {
+        ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
+        foreach i $ilist {
+            set iname [$i name]
+            set iversion [$i version]
+            set irevision [$i revision]
+            set ivariants [$i variants]
+            if { [$i state] == "installed" } {
+                ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
             } else {
-                throw registry::invalid "Registry error: Invalid version specified. Please specify a version as recorded in the port registry."
+                ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
             }
-        } elseif { [llength $ilist] == 1 } {
-            return [lindex $ilist 0]
         }
-        throw registry::invalid "Registry error: No port of $name installed."
-    } else {
-        # registry1.0
-        set ilist [registry::installed $name $v]
-        if { [string equal $v ""] && [llength $ilist] > 1 } {
-            # set name again since the one we were passed may not have had the correct case
-            set name [lindex [lindex $ilist 0] 0]
-            ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
-            foreach i $ilist { 
-                set iname [lindex $i 0]
-                set iversion [lindex $i 1]
-                set irevision [lindex $i 2]
-                set ivariants [lindex $i 3]
-                set iactive [lindex $i 4]
-                if { $iactive == 0 } {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
-                } elseif { $iactive == 1 } {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
-                }
-            }
-            return -code error "Registry error: Please specify the full version as recorded in the port registry."
-        } elseif {[llength $ilist] == 1} {
-            return [lindex $ilist 0]
-        }
-        return -code error "Registry error: No port of $name installed."
+        throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
+    } elseif { [llength $ilist] == 1 } {
+        return [lindex $ilist 0]
     }
+    if {$composite_spec != ""} {
+        set composite_spec " @${composite_spec}"
+    }
+    throw registry::invalid "Registry error: ${name}${composite_spec} is not installed."
 }
 
 ## Activates a file from an image into the filesystem. Deals with symlinks,
@@ -534,18 +414,13 @@
 ## Activates the contents of a port
 proc _activate_contents {port {imagefiles {}} {location {}}} {
     variable force
-    variable use_reg2
     variable noexec
     global macports::prefix
 
     set files [list]
     set baksuffix .mp_[clock seconds]
-    if {$use_reg2} {
-        set location [$port location]
-        set imagefiles [$port imagefiles]
-    } else {
-        set name $port
-    }
+    set location [$port location]
+    set imagefiles [$port imagefiles]
     set extracted_dir [extract_archive_to_tmpdir $location]
 
     set backups [list]
@@ -556,248 +431,139 @@
     # Last, if the file exists, and belongs to another port, and force is set
     #  we remove the file from the file_map, take ownership of it, and
     #  clobber it
-    if {$use_reg2} {
-        array set todeactivate {}
-        try {
-            registry::write {
-                foreach file $imagefiles {
-                    set srcfile "${extracted_dir}${file}"
+    array set todeactivate {}
+    try {
+        registry::write {
+            foreach file $imagefiles {
+                set srcfile "${extracted_dir}${file}"
 
-                    # To be able to install links, we test if we can lstat the file to
-                    # figure out if the source file exists (file exists will return
-                    # false for symlinks on files that do not exist)
-                    if { [catch {::file lstat $srcfile dummystatvar}] } {
-                        throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port [$port name]."
-                    }
+                # To be able to install links, we test if we can lstat the file to
+                # figure out if the source file exists (file exists will return
+                # false for symlinks on files that do not exist)
+                if { [catch {::file lstat $srcfile dummystatvar}] } {
+                    throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port [$port name]."
+                }
 
-                    set owner [registry::entry owner $file]
+                set owner [registry::entry owner $file]
 
-                    if {$owner != {} && $owner != $port} {
-                        # deactivate conflicting port if it is replaced_by this one
-                        set result [mportlookup [$owner name]]
-                        array unset portinfo
-                        array set portinfo [lindex $result 1]
-                        if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^[$port name]\$"] != -1} {
-                            # we'll deactivate the owner later, but before activating our files
-                            set todeactivate($owner) yes
-                            set owner "replaced"
-                        }
+                if {$owner != {} && $owner != $port} {
+                    # deactivate conflicting port if it is replaced_by this one
+                    set result [mportlookup [$owner name]]
+                    array unset portinfo
+                    array set portinfo [lindex $result 1]
+                    if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^[$port name]\$"] != -1} {
+                        # we'll deactivate the owner later, but before activating our files
+                        set todeactivate($owner) yes
+                        set owner "replaced"
                     }
+                }
 
-                    if {$owner != "replaced"} {
-                        if { [string is true -strict $force] } {
-                            # if we're forcing the activation, then we move any existing
-                            # files to a backup file, both in the filesystem and in the
-                            # registry
-                            if { [::file exists $file] } {
-                                set bakfile "${file}${baksuffix}"
-                                ui_warn "File $file already exists.  Moving to: $bakfile."
-                                ::file rename -force -- $file $bakfile
-                                lappend backups $file
-                            }
-                            if { $owner != {} } {
-                                $owner deactivate [list $file]
-                                $owner activate [list $file] [list "${file}${baksuffix}"]
-                            }
-                        } else {
-                            # if we're not forcing the activation, then we bail out if
-                            # we find any files that already exist, or have entries in
-                            # the registry
-                            if { $owner != {} && $owner != $port } {
-                                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."
-                            } elseif { $owner == {} && ![catch {::file type $file}] } {
-                                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."
-                            }
+                if {$owner != "replaced"} {
+                    if { [string is true -strict $force] } {
+                        # if we're forcing the activation, then we move any existing
+                        # files to a backup file, both in the filesystem and in the
+                        # registry
+                        if { ![catch {::file type $file}] } {
+                            set bakfile "${file}${baksuffix}"
+                            ui_warn "File $file already exists.  Moving to: $bakfile."
+                            ::file rename -force -- $file $bakfile
+                            lappend backups $file
                         }
+                        if { $owner != {} } {
+                            $owner deactivate [list $file]
+                            $owner activate [list $file] [list "${file}${baksuffix}"]
+                        }
+                    } else {
+                        # if we're not forcing the activation, then we bail out if
+                        # we find any files that already exist, or have entries in
+                        # the registry
+                        if { $owner != {} && $owner != $port } {
+                            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."
+                        } elseif { $owner == {} && ![catch {::file type $file}] } {
+                            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."
+                        }
                     }
-
-                    # Split out the filename's subpaths and add them to the
-                    # imagefile list.
-                    # We need directories first to make sure they will be there
-                    # before links. However, because file mkdir creates all parent
-                    # directories, we don't need to have them sorted from root to
-                    # subpaths. We do need, nevertheless, all sub paths to make sure
-                    # we'll set the directory attributes properly for all
-                    # directories.
-                    set directory [::file dirname $file]
-                    while { [lsearch -exact $files $directory] == -1 } {
-                        lappend files $directory
-                        set directory [::file dirname $directory]
-                    }
-
-                    # Also add the filename to the imagefile list.
-                    lappend files $file
                 }
-            }
 
-            # deactivate ports replaced_by this one
-            foreach owner [array names todeactivate] {
-                if {$noexec || ![registry::run_target $owner deactivate [list ports_nodepcheck 1]]} {
-                    deactivate [$owner name] "" [list ports_nodepcheck 1]
+                # Split out the filename's subpaths and add them to the
+                # imagefile list.
+                # We need directories first to make sure they will be there
+                # before links. However, because file mkdir creates all parent
+                # directories, we don't need to have them sorted from root to
+                # subpaths. We do need, nevertheless, all sub paths to make sure
+                # we'll set the directory attributes properly for all
+                # directories.
+                set directory [::file dirname $file]
+                while { [lsearch -exact $files $directory] == -1 } {
+                    lappend files $directory
+                    set directory [::file dirname $directory]
                 }
-            }
 
-            # Sort the list in forward order, removing duplicates.
-            # Since the list is sorted in forward order, we're sure that
-            # directories are before their elements.
-            # We don't have to do this as mentioned above, but it makes the
-            # debug output of activate make more sense.
-            set files [lsort -increasing -unique $files]
-            set rollback_filelist {}
-
-            registry::write {
-                # Activate it, and catch errors so we can roll-back
-                try {
-                    $port activate $imagefiles
-                    foreach file $files {
-                        if {[_activate_file "${extracted_dir}${file}" $file] == 1} {
-                            lappend rollback_filelist $file
-                        }
-                    }
-                } catch {*} {
-                    ui_debug "Activation failed, rolling back."
-                    # can't do it here since we're already inside a transaction
-                    set deactivate_this yes
-                    throw
-                }
+                # Also add the filename to the imagefile list.
+                lappend files $file
             }
-        } catch {*} {
-            # roll back activation of this port
-            if {[info exists deactivate_this]} {
-                _deactivate_contents $port $rollback_filelist yes yes
-            }
-            # if any errors occurred, move backed-up files back to their original
-            # locations, then rethrow the error. Transaction rollback will take care
-            # of this in the registry.
-            foreach file $backups {
-                ::file rename -force -- "${file}${baksuffix}" $file
-            }
-            # reactivate deactivated ports
-            foreach entry [array names todeactivate] {
-                if {[$entry state] == "imaged" && ($noexec || ![registry::run_target $entry activate ""])} {
-                    set pvers "[$entry version]_[$entry revision][$entry variants]"
-                    activate [$entry name] $pvers [list ports_activate_no-exec $noexec]
-                }
-            }
-            # remove temp image dir
-            ::file delete -force $extracted_dir
-            throw
         }
-    } else {
-        # registry1.0
-        set deactivated [list]
-        foreach file $imagefiles {
-            set srcfile "${extracted_dir}${file}"
 
-            # To be able to install links, we test if we can lstat the file to
-            # figure out if the source file exists (file exists will return
-            # false for symlinks on files that do not exist)
-            if { [catch {::file lstat $srcfile dummystatvar}] } {
-                ::file delete -force $extracted_dir
-                return -code error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port $name."
+        # deactivate ports replaced_by this one
+        foreach owner [array names todeactivate] {
+            if {$noexec || ![registry::run_target $owner deactivate [list ports_nodepcheck 1]]} {
+                deactivate [$owner name] "" "" 0 [list ports_nodepcheck 1]
             }
-
-            set port [registry::file_registered $file]
-            
-            if {$port != 0  && $port != $name} {
-                # deactivate conflicting port if it is replaced_by this one
-                if {[catch {mportlookup $port} result]} {
-                    global errorInfo
-                    ui_debug "$errorInfo"
-                    ::file delete -force $extracted_dir
-                    return -code error "port lookup failed: $result"
-                }
-                array unset portinfo
-                array set portinfo [lindex $result 1]
-                if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^${name}\$"] != -1} {
-                    lappend deactivated [lindex [registry::active $port] 0]
-                    deactivate $port "" ""
-                    set port 0
-                }
-            }
-    
-            if { $port != 0  && $force != 1 && $port != $name } {
-                ::file delete -force $extracted_dir
-                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."
-            } elseif { [::file exists $file] && $force != 1 } {
-                ::file delete -force $extracted_dir
-                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."
-            } elseif { $force == 1 && [::file exists $file] || $port != 0 } {
-                set bakfile "${file}${baksuffix}"
-
-                if {[::file exists $file]} {
-                    ui_warn "File $file already exists.  Moving to: $bakfile."
-                    ::file rename -force -- $file $bakfile
-                    lappend backups $file
-                }
-
-                if { $port != 0 } {
-                    set bakport [registry::file_registered $file]
-                    registry::unregister_file $file
-                    if {[::file exists $bakfile]} {
-                        registry::register_file $bakfile $bakport
-                    }
-                }
-            }
-
-            # Split out the filename's subpaths and add them to the imagefile list.
-            # We need directories first to make sure they will be there before
-            # links. However, because file mkdir creates all parent directories,
-            # we don't need to have them sorted from root to subpaths. We do need,
-            # nevertheless, all sub paths to make sure we'll set the directory
-            # attributes properly for all directories.
-            set directory [::file dirname $file]
-            while { [lsearch -exact $files $directory] == -1 } { 
-                lappend files $directory
-                set directory [::file dirname $directory]
-            }
-
-            # Also add the filename to the imagefile list.
-            lappend files $file
         }
-        registry::write_file_map
 
         # Sort the list in forward order, removing duplicates.
-        # Since the list is sorted in forward order, we're sure that directories
-        # are before their elements.
+        # Since the list is sorted in forward order, we're sure that
+        # directories are before their elements.
         # We don't have to do this as mentioned above, but it makes the
         # debug output of activate make more sense.
         set files [lsort -increasing -unique $files]
         set rollback_filelist {}
 
-        # Activate it, and catch errors so we can roll-back
-        if { [catch { foreach file $files {
-                        if {[_activate_file "${extracted_dir}${file}" $file] == 1} {
-                            lappend rollback_filelist $file
-                        }
-                    }} result]} {
-            ui_debug "Activation failed, rolling back."
-            _deactivate_contents $name $rollback_filelist yes yes
-            # return backed up files to their old locations
-            foreach f $backups {
-                set bakfile "${f}${baksuffix}"
-                set bakport [registry::file_registered $bakfile]
-                if {$bakport != 0} {
-                    registry::unregister_file $bakfile
-                    registry::register_file $f $bakport
+        registry::write {
+            # Activate it, and catch errors so we can roll-back
+            try {
+                $port activate $imagefiles
+                foreach file $files {
+                    if {[_activate_file "${extracted_dir}${file}" $file] == 1} {
+                        lappend rollback_filelist $file
+                    }
                 }
-                ::file rename -force -- $bakfile $file
+            } catch {*} {
+                ui_debug "Activation failed, rolling back."
+                # can't do it here since we're already inside a transaction
+                set deactivate_this yes
+                throw
             }
-            # reactivate deactivated ports
-            foreach entry $deactivated {
-                set pname [lindex $entry 0]
-                set pvers "[lindex $entry 1]_[lindex $entry 2][lindex $entry 3]"
-                activate $pname $pvers ""
+        }
+    } catch {*} {
+        # roll back activation of this port
+        if {[info exists deactivate_this]} {
+            _deactivate_contents $port $rollback_filelist yes yes
+        }
+        # if any errors occurred, move backed-up files back to their original
+        # locations, then rethrow the error. Transaction rollback will take care
+        # of this in the registry.
+        foreach file $backups {
+            ::file rename -force -- "${file}${baksuffix}" $file
+        }
+        # reactivate deactivated ports
+        foreach entry [array names todeactivate] {
+            if {[$entry state] == "imaged" && ($noexec || ![registry::run_target $entry activate ""])} {
+                activate [$entry name] [$entry version] [$entry revision] [$entry variants] [list ports_activate_no-exec $noexec]
             }
-            registry::write_file_map
-
-            ::file delete -force $extracted_dir
-            return -code error $result
         }
+        # remove temp image dir
+        ::file delete -force $extracted_dir
+        throw
     }
     ::file delete -force $extracted_dir
 }
 
+# These directories should not be removed during deactivation even if they are empty.
+# TODO: look into what other dirs should go here
+variable precious_dirs
+array set precious_dirs { /Library/LaunchDaemons 1 /Library/LaunchAgents 1 }
+
 proc _deactivate_file {dstfile} {
     if { [::file type $dstfile] == "link" } {
         ui_debug "deactivating link: $dstfile"
@@ -805,8 +571,13 @@
     } elseif { [::file isdirectory $dstfile] } {
         # 0 item means empty.
         if { [llength [readdir $dstfile]] == 0 } {
-            ui_debug "deactivating directory: $dstfile"
-            ::file delete -- $dstfile
+            variable precious_dirs
+            if {![info exists precious_dirs($dstfile)]} {
+                ui_debug "deactivating directory: $dstfile"
+                ::file delete -- $dstfile
+            } else {
+                ui_debug "directory $dstfile does not belong to us"
+            }
         } else {
             ui_debug "$dstfile is not empty"
         }
@@ -817,7 +588,6 @@
 }
 
 proc _deactivate_contents {port imagefiles {force 0} {rollback 0}} {
-    variable use_reg2
     set files [list]
 
     foreach file $imagefiles {
@@ -852,7 +622,7 @@
     set files [lsort -decreasing -unique $files]
 
     # Remove all elements.
-    if {$use_reg2 && !$rollback} {
+    if {!$rollback} {
         registry::write {
             $port deactivate $imagefiles
             foreach file $files {

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/portuninstall.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/portuninstall.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/portuninstall.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -2,6 +2,7 @@
 # portuninstall.tcl
 # $Id$
 #
+# Copyright (c) 2004-2005, 2008-2011 The MacPorts Project
 # Copyright (c) 2002 - 2003 Apple Inc.
 # All rights reserved.
 #
@@ -40,10 +41,25 @@
 
 namespace eval registry_uninstall {
 
-proc uninstall {portname {v ""} optionslist} {
+# takes a composite version spec rather than separate version,revision,variants
+proc uninstall_composite {portname {v ""} {optionslist ""}} {
+    if {$v == ""} {
+        return [uninstall $portname "" "" 0 $optionslist]
+    } elseif {[registry::decode_spec $v version revision variants]} {
+        return [uninstall $portname $version $revision $variants $optionslist]
+    }
+    throw registry::invalid "Registry error: Invalid version '$v' specified for ${portname}. Please specify a version as recorded in the port registry."
+}
+
+proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""}} {
     global uninstall.force uninstall.nochecksum UI_PREFIX \
-           macports::registry.format macports::portimagefilepath
+           macports::portimagefilepath
     array set options $optionslist
+    if {[info exists options(subport)]} {
+        # don't want this set when calling registry::run_target
+        unset options(subport)
+        set optionslist [array get options]
+    }
 
     if {![info exists uninstall.force]} {
         set uninstall.force no
@@ -56,172 +72,89 @@
     if {[info exists options(ports_uninstall_no-exec)]} {
         set options(ports_deactivate_no-exec) $options(ports_uninstall_no-exec)
     }
-    # check which registry API to use
-    set use_reg2 [string equal ${macports::registry.format} "receipt_sqlite"]
 
-    if {$use_reg2} {
-        if { [registry::decode_spec $v version revision variants] } {
-            set ilist [registry::entry imaged $portname $version $revision $variants]
-            set valid 1
-        } else {
-            set valid [string equal $v {}]
-            set ilist [registry::entry imaged $portname]
+    set searchkeys $portname
+    set composite_spec ""
+    if {$version != ""} {
+        lappend searchkeys $version
+        set composite_spec $version
+        # restriction imposed by underlying registry API (see entry.c):
+        # if a revision is specified, so must variants be
+        if {$revision != ""} {
+            lappend searchkeys $revision $variants
+            append composite_spec _${revision}${variants}
         }
-    } else {
-        set ilist [registry::installed $portname $v]
-        set valid 1
     }
+    set ilist [eval registry::entry imaged $searchkeys]
     if { [llength $ilist] > 1 } {
         # set portname again since the one we were passed may not have had the correct case
-        if {$use_reg2} {
-            set portname [[lindex $ilist 0] name]
-        } else {
-            set portname [lindex [lindex $ilist 0] 0]
-        }
+        set portname [[lindex $ilist 0] name]
         ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $portname are currently installed:"]"
         foreach i [portlist_sortint $ilist] {
-            if {$use_reg2} {
-                set ispec "[$i version]_[$i revision][$i variants]"
-                if { [string equal [$i state] installed] } {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s (active)"] [$i name] $ispec]"
-                } else {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s"] [$i name] $ispec]"
-                }
+            set ispec "[$i version]_[$i revision][$i variants]"
+            if { [string equal [$i state] installed] } {
+                ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s (active)"] [$i name] $ispec]"
             } else {
-                set iname [lindex $i 0]
-                set iversion [lindex $i 1]
-                set irevision [lindex $i 2]
-                set ivariants [lindex $i 3]
-                set iactive [lindex $i 4]
-                if { $iactive == 1 } {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
-                } else {
-                    ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
-                }
+                ui_msg "$UI_PREFIX [format [msgcat::mc "    %s @%s"] [$i name] $ispec]"
             }
         }
-        if { $valid } {
-            throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
-        } else {
-            throw registry::invalid "Registry error: Invalid version specified. Please specify a version as recorded in the port registry."
-        }
+        throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
     } elseif { [llength $ilist] == 1 } {
-        if {$use_reg2} {
-            set port [lindex $ilist 0]
-            set version [$port version]
-            set revision [$port revision]
-            set variants [$port variants]
-        } else {
-            set version [lindex [lindex $ilist 0] 1]
-            set revision [lindex [lindex $ilist 0] 2]
-            set variants [lindex [lindex $ilist 0] 3]
-            set active [lindex [lindex $ilist 0] 4]
-        }
-        if {$v == ""} {
-            set v "${version}_${revision}${variants}"
-        }
+        set port [lindex $ilist 0]
+        set version [$port version]
+        set revision [$port revision]
+        set variants [$port variants]
+        set composite_spec "${version}_${revision}${variants}"
     } else {
-        throw registry::invalid "Registry error: $portname not registered as installed"
+        if {$composite_spec != ""} {
+            set composite_spec " @${composite_spec}"
+        }
+        throw registry::invalid "Registry error: ${portname}${composite_spec} not registered as installed"
     }
 
-    if {$use_reg2} {
-        # uninstall dependents if requested
-        if {[info exists options(ports_uninstall_follow-dependents)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
-            foreach depport [$port dependents] {
-                # make sure it's still installed, since a previous dep uninstall may have removed it
-                if {[registry::entry exists $depport] && ([$depport state] == "imaged" || [$depport state] == "installed")} {
-                    if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $depport uninstall $optionslist]} {
-                        set depname [$depport name]
-                        set depver "[$depport version]_[$depport revision][$depport variants]"
-                        registry_uninstall::uninstall $depname $depver $optionslist
-                    }
-                }
-            }
-        } else {
-            # check its dependents
-            registry::check_dependents $port ${uninstall.force} "uninstall"
+    # uninstall dependents if requested
+    if {[info exists options(ports_uninstall_follow-dependents)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
+        # don't uninstall dependents' dependencies
+        if {[info exists options(ports_uninstall_follow-dependencies)]} {
+            set orig_follow_dependencies $options(ports_uninstall_follow-dependencies)
+            unset options(ports_uninstall_follow-dependencies)
+            set optionslist [array get options]
         }
-        # if it's active, deactivate it
-        if { [string equal [$port state] installed] } {
-            if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
-                ui_msg "For $portname @${v}: skipping deactivate (dry run)"
-            } else {
-                if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $port deactivate $optionslist]} {
-                    portimage::deactivate $portname $v [array get options]
+        foreach depport [$port dependents] {
+            # make sure it's still installed, since a previous dep uninstall may have removed it
+            if {[registry::entry exists $depport] && ([$depport state] == "imaged" || [$depport state] == "installed")} {
+                if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $depport uninstall $optionslist]} {
+                    registry_uninstall::uninstall [$depport name] [$depport version] [$depport revision] [$depport variants] $optionslist
                 }
             }
         }
+        if {[info exists orig_follow_dependencies]} {
+            set options(ports_uninstall_follow-dependencies) $orig_follow_dependencies
+            set optionslist [array get options]
+        }
     } else {
-        # registry1.0
-        
-        # determine if it's the only installed port with that name or not.
-        if {$v == ""} {
-            set nb_versions_installed 1
+        # check its dependents
+        registry::check_dependents $port ${uninstall.force} "uninstall"
+    }
+    # if it's active, deactivate it
+    if { [string equal [$port state] installed] } {
+        if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
+            ui_msg "For $portname @${composite_spec}: skipping deactivate (dry run)"
         } else {
-            set ilist [registry::installed $portname ""]
-            set nb_versions_installed [llength $ilist]
-        }
-    
-        set ref [registry::open_entry $portname $version $revision $variants]
-    
-        # Check and make sure no ports depend on this one
-        registry::open_dep_map  
-        set deplist [registry::list_dependents $portname $version $revision $variants]
-        if { [llength $deplist] > 0 } {
-            set dl [list]
-            # Check the deps first
-            foreach dep $deplist { 
-                set depport [lindex $dep 2]
-                ui_debug "$depport depends on this port"
-                if {[registry::entry_exists_for_name $depport]} {
-                    lappend dl $depport
-                }
+            if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $port deactivate $optionslist]} {
+                portimage::deactivate $portname $version $revision $variants [array get options]
             }
-            # Now see if we need to error
-            if { [llength $dl] > 0 } {
-                if {[info exists options(ports_uninstall_follow-dependents)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
-                    foreach depport $dl {
-                        # make sure it's still installed, since a previous dep uninstall may have removed it
-                        if {[registry::entry_exists_for_name $depport]} {
-                            registry_uninstall::uninstall $depport "" $optionslist
-                        }
-                    }
-                } else {
-                    # will need to change this when we get version/variant dependencies
-                    if {$nb_versions_installed == 1 || $active == 1} {
-                        ui_msg "$UI_PREFIX [format [msgcat::mc "Unable to uninstall %s %s_%s%s, the following ports depend on it:"] $portname $version $revision $variants]"
-                        foreach depport $dl {
-                            ui_msg "$UI_PREFIX [format [msgcat::mc "    %s"] $depport]"
-                        }
-                        if { [string is true -strict ${uninstall.force}] } {
-                            ui_warn "Uninstall forced.  Proceeding despite dependencies."
-                        } else {
-                            return -code error "Please uninstall the ports that depend on $portname first."
-                        }
-                    }
-                }
-            }
         }
-    
-        if { [registry::property_retrieve $ref active] == 1} {
-            if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
-                ui_msg "For $portname @${version}_${revision}${variants}: skipping deactivate (dry run)"
-            } else {
-                portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
-            }
-        }
     }
 
-    if {$use_reg2} {
-        set ref $port
-    }
+    set ref $port
 
     # note deps before we uninstall if we're going to uninstall them too
     if {[info exists options(ports_uninstall_follow-dependencies)] && [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
         set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
         set all_dependencies {}
         # look up deps from the saved portfile if possible
-        if {$use_reg2 && ![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $optionslist]}]} {
+        if {![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $optionslist]}]} {
             array set depportinfo [mportinfo $mport]
             mportclose_installed $mport
             foreach type $deptypes {
@@ -273,35 +206,10 @@
     }
 
     if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
-        ui_msg "For $portname @${v}: skipping uninstall (dry run)"
+        ui_msg "For $portname @${composite_spec}: skipping uninstall (dry run)"
     } else {
-        ui_msg "$UI_PREFIX [format [msgcat::mc "Uninstalling %s @%s"] $portname $v]"
-    
-        if {!$use_reg2} {
-            # Look to see if the port has registered an uninstall procedure
-            set uninstall [registry::property_retrieve $ref pkg_uninstall] 
-            if { $uninstall != 0 } {
-                if {![catch {eval [string map { \\n \n } $uninstall]} err]} {
-                    ui_info "Executing pkg_uninstall procedure"
-                    if {[catch {pkg_uninstall $portname "${version}_${revision}${variants}" } err]} {
-                        ui_error [format [msgcat::mc "Error executing pkg_uninstall procedure: %s"] $err]
-                    }
-                } else {
-                    global errorInfo
-                    ui_debug "$errorInfo"
-                    ui_error [format [msgcat::mc "Could not evaluate pkg_uninstall procedure: %s"] $err]
-                }
-            }
-        
-            # Remove the port from the dep_map if only one version was installed.
-            # This is a temporary fix for a deeper problem that is that the dependency
-            # map doesn't take the port version into account (but should).
-            # Fixing it means transitioning to a new dependency map format.
-            if {$nb_versions_installed == 1} {
-                registry::unregister_dependencies $portname
-            }
-        }
-    
+        ui_msg "$UI_PREFIX [format [msgcat::mc "Uninstalling %s @%s"] $portname $composite_spec]"
+
         # Get the full path to the image file
         set imagefile [registry::property_retrieve $ref location]
         file delete $imagefile
@@ -309,16 +217,16 @@
         # files so just ignore the failure
         catch {file delete [::file dirname $imagefile]}
 
-        if {$use_reg2} {
-            registry::entry delete $port
-        } else {
-            ui_info "$UI_PREFIX [format [msgcat::mc "Uninstall is removing %s from the port registry."] $portname]"
-            registry::delete_entry $ref
-        }
+        registry::entry delete $port
     }
     
     # uninstall dependencies if requested
     if {[info exists options(ports_uninstall_follow-dependencies)] && [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
+        # don't uninstall dependencies' dependents
+        if {[info exists options(ports_uninstall_follow-dependents)]} {
+            unset options(ports_uninstall_follow-dependents)
+            set optionslist [array get options]
+        }
         while 1 {
             set remaining_list {}
             foreach dep $all_dependencies {
@@ -330,9 +238,8 @@
                         set ivariants [lindex $i 3]
                         if {[llength [registry::list_dependents $dep $iversion $irevision $ivariants]] == 0} {
                             set regref [registry::open_entry $dep $iversion $irevision $ivariants [lindex $i 5]]
-                            if {![registry::property_retrieve $regref requested] && (!$use_reg2 || [info exists options(ports_uninstall_no-exec)] || ![registry::run_target $regref uninstall $optionslist])} {
-                                set depver "${iversion}_${irevision}${ivariants}"
-                                registry_uninstall::uninstall $dep $depver $optionslist
+                            if {![registry::property_retrieve $regref requested] && ([info exists options(ports_uninstall_no-exec)] || ![registry::run_target $regref uninstall $optionslist])} {
+                                registry_uninstall::uninstall $dep $iversion $irevision $ivariants $optionslist
                             }
                         } else {
                             set remaining 1

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_flat.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_flat.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_flat.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,9 +1,10 @@
 # receipt_flat.tcl
 # $Id$
 #
+# Copyright (c) 2005, 2007-2009 The MacPorts Project
 # Copyright (c) 2004 Will Barton <wbb4 at opendarwin.org>
 # Copyright (c) 2004 Paul Guyot, The MacPorts Project.
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -14,7 +15,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,7 +1,7 @@
 # receipt_sqlite.tcl
 # $Id$
 #
-# Copyright (c) 2010 The MacPorts Project
+# Copyright (c) 2010-2011 The MacPorts Project
 # Copyright (c) 2004 Will Barton <wbb4 at opendarwin.org>
 # Copyright (c) 2002 Apple Inc.
 # All rights reserved.
@@ -160,26 +160,22 @@
 # If version is "", return all ports of that name.
 # Otherwise, return only ports that exactly match this version.
 # What we call version here is version_revision+variants.
+# The syntax for that can be ambiguous if there's an underscore and dash in
+# version for example, so we don't attempt to split up the composite version
+# into its components, we just compare the whole thing.
 proc installed {{name ""} {version ""}} {
 	if { $name == "" && $version == "" } {
 	    set ports [registry::entry imaged]
 	} elseif { $name != "" && $version == ""} {
 	    set ports [registry::entry imaged $name]
 	} else {
-	    set cmd "registry::entry imaged $name"
-	    registry::decode_spec $version version revision variants
-	    if {[info exists version] && $version != ""} {
-                append cmd " $version"
-                if {[info exists revision] && $revision != ""} {
-                    append cmd " $revision"
-                    if {![info exists variants]} {
-                        set variants ""
-                    }
-                    append cmd " {$variants}"
-                }
-        }
-	    if {[catch {set ports [eval $cmd]}]} {
-	        set ports [list]
+	    set ports {}
+	    set possible_ports [registry::entry imaged $name]
+	    foreach p $possible_ports {
+	        if {"[$p version]_[$p revision][$p variants]" == $version
+	            || [$p version] == $version} {
+	            lappend ports $p
+	        }
 	    }
 	}
 


Property changes on: branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base/src/registry1.0/receipt_sqlite.tcl:37343-46937
/branches/gsoc09-logging/base/src/registry1.0/receipt_sqlite.tcl:51231-60371
/branches/universal-sanity/base/src/registry1.0/receipt_sqlite.tcl:51872-52323
/branches/variant-descs-14482/base/src/registry1.0/receipt_sqlite.tcl:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/registry1.0/receipt_sqlite.tcl:45682-46060
/users/perry/base-select/src/registry1.0/receipt_sqlite.tcl:44044-44692
   + /branches/gsoc08-privileges/base/src/registry1.0/receipt_sqlite.tcl:37343-46937
/branches/gsoc09-logging/base/src/registry1.0/receipt_sqlite.tcl:51231-60371
/branches/universal-sanity/base/src/registry1.0/receipt_sqlite.tcl:51872-52323
/branches/variant-descs-14482/base/src/registry1.0/receipt_sqlite.tcl:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/registry2.0/receipt_sqlite.tcl:78828-80185
/users/perry/base-bugs_and_notes/src/registry1.0/receipt_sqlite.tcl:45682-46060
/users/perry/base-select/src/registry1.0/receipt_sqlite.tcl:44044-44692

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/registry.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/registry.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/registry.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,7 +1,8 @@
 # registry.tcl
 #
+# Copyright (c) 2004-2005, 2007-2010 The MacPorts Project
 # Copyright (c) 2004 Will Barton <wbb4 at opendarwin.org>
-# Copyright (c) 2002 Apple Computer, Inc.
+# Copyright (c) 2002 Apple Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -12,7 +13,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of Apple Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_autoconf.tcl.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_autoconf.tcl.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_autoconf.tcl.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -12,7 +12,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+# 3. Neither the name of The MacPorts Project nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
 # 

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_util.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_util.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/registry_util.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -3,6 +3,7 @@
 # $Id$
 #
 # Copyright (c) 2007 Chris Pickel
+# Copyright (c) 2010-2011 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: branches/gsoc11-rev-upgrade/base/src/upgrade_sources_conf_default.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/upgrade_sources_conf_default.tcl	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/src/upgrade_sources_conf_default.tcl	2011-07-06 11:59:33 UTC (rev 80186)
@@ -68,18 +68,15 @@
                      regexp {^URL: (.*)} $svnLine -> svnURL
                   }
                   if {[catch {close $svnChannel} err]} {
-                     if {![string match "*This client is too old to work with working copy*" $err]} {
-                        return -code error $err
-                     } else {
-                        puts $err
-                        puts "WARNING: Unable to check svn URL for '$filepath' as it has been checked out with a newer Subversion client; please manually verify $sourcesConf!"
-                     }
+                     puts $err
+                     puts "WARNING: Unable to check svn URL for '$filepath'; please manually verify $sourcesConf!"
                   }
                   if {[regexp {^https?://svn\.(macports|macosforge)\.org/repository/macports/trunk/dports} $svnURL]} {
                      set addDefault true
                   }
                } else {
-                  return -code error $err
+                  puts $err
+                  puts "WARNING: Unable to check svn URL for '$filepath'; please manually verify $sourcesConf!"
                }
             }
          }

Modified: branches/gsoc11-rev-upgrade/base/tests/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -47,7 +47,7 @@
 	for testname in $(TESTS); do\
 		subdir=test/$$testname; \
 		echo ===\> test ${DIRPRFX}$$subdir; \
-		if [ -e ${DIRPRFX}$$subdir/Makefile ]; then \
+		if [ -e $$subdir/Makefile ]; then \
 			( cd $$subdir && \
 				$(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ PORTSRC=$(PWD)/test-macports.conf test) && \
 			success=$$(( success + 1 )); \

Modified: branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Makefile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Makefile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Makefile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,7 +1,7 @@
 include ../../../Mk/macports.autoconf.mk
 
 # see test-macports.conf for the value of prefix
-TESTFILE=/tmp/macports-tests/opt/local/var/macports/case
+TESTFILE=/tmp/macports-tests/opt/local/var/test/case
 TESTPORT1=casesensitive
 TESTPORT2=CaseSensitivE
 

Modified: branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Portfile.in
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Portfile.in	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/Portfile.in	2011-07-06 11:59:33 UTC (rev 80186)
@@ -12,11 +12,10 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
-	system "touch ${destroot}${prefix}/var/macports/case"
+	xinstall -d ${destroot}${prefix}/var/test
+	system "touch ${destroot}${prefix}/var/test/case"
 }

Modified: branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/README
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/README	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/case-insensitive-deactivate/README	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,2 +1,2 @@
 See ticket #11759,
-http://trac.macosforge.org/projects/macports/ticket/11759
+https://trac.macports.org/ticket/11759

Modified: branches/gsoc11-rev-upgrade/base/tests/test/checksums-1/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/checksums-1/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/checksums-1/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,4 +1,3 @@
---->  Computing dependencies for checksum
 --->  Fetching checksum
 --->  Verifying checksum(s) for checksum
 --->  Extracting checksum

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-a/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-a/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-a/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-b/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-b/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-b/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-c/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,4 +1,6 @@
 --->  Computing dependencies for dependencies-c
+--->  Dependencies to be installed: dependencies-a dependencies-b
+--->  Fetching archive for dependencies-b
 --->  Fetching dependencies-b
 --->  Verifying checksum(s) for dependencies-b
 --->  Extracting dependencies-b
@@ -8,6 +10,7 @@
 --->  Installing dependencies-b @1_0
 --->  Activating dependencies-b @1_0
 --->  Cleaning dependencies-b
+--->  Fetching archive for dependencies-a
 --->  Fetching dependencies-a
 --->  Verifying checksum(s) for dependencies-a
 --->  Extracting dependencies-a

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-d/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-d/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-d/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/dependencies-e/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,3 +1,4 @@
 --->  Computing dependencies for dependencies-e
 Error: Dependency 'docbook-xml-4.1.2' not found.
 Error: Status 1 encountered during processing.
+To report a bug, see <http://guide.macports.org/#project.tickets>

Modified: branches/gsoc11-rev-upgrade/base/tests/test/envvariables/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/envvariables/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/envvariables/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/envvariables/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/envvariables/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/envvariables/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,4 +1,3 @@
---->  Computing dependencies for envvariables
 --->  Fetching envvariables
 --->  Verifying checksum(s) for envvariables
 --->  Extracting envvariables

Modified: branches/gsoc11-rev-upgrade/base/tests/test/site-tags/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/site-tags/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/site-tags/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -26,7 +26,7 @@
 					rmd160 3cbae7e39e8c78eca03a0db709cf520003896a12
 
 extract		{}
-configure	{}
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/site-tags/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/site-tags/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/site-tags/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,4 +1,3 @@
---->  Computing dependencies for site-tags
 --->  Fetching site-tags
 --->  Attempting to fetch app-bm.tar.gz from http://www.douglas.stebila.ca/files/code/vim/app/
 --->  Attempting to fetch doc.tar.gz from http://www.douglas.stebila.ca/files/code/vim/doc/

Modified: branches/gsoc11-rev-upgrade/base/tests/test/trace/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/trace/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/trace/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/trace/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/trace/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/trace/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,4 +1,3 @@
---->  Computing dependencies for trace
 --->  Fetching trace
 --->  Verifying checksum(s) for trace
 --->  Extracting trace

Modified: branches/gsoc11-rev-upgrade/base/tests/test/universal/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/universal/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/universal/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,9 +11,7 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
+distfiles
 configure	{}
 build		{}
 destroot	{

Modified: branches/gsoc11-rev-upgrade/base/tests/test/universal-2/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/universal-2/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/universal-2/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,9 +11,7 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
+distfiles
 configure	{}
 build		{}
 destroot	{

Modified: branches/gsoc11-rev-upgrade/base/tests/test/variants/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/variants/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/variants/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,10 +11,8 @@
 
 long_description ${description}
 
-fetch 		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"
@@ -24,8 +22,6 @@
 	# test is actually installing this.
 }
 
-use_configure	no
-
 # We override universal variant.
 variant universal {
 	puts "Universal Variant"

Modified: branches/gsoc11-rev-upgrade/base/tests/test/variants/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/variants/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/variants/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,6 +1,5 @@
 Utopia variant -- 2
 Utopia variant -- 2
---->  Computing dependencies for variants
 --->  Fetching variants
 --->  Verifying checksum(s) for variants
 --->  Extracting variants

Modified: branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/Portfile
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/Portfile	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/Portfile	2011-07-06 11:59:33 UTC (rev 80186)
@@ -11,16 +11,18 @@
 
 long_description ${description}
 
-fetch		{}
-checksum	{}
-extract		{}
-configure	{}
+distfiles
+use_configure no
 build		{}
 destroot	{
 	system "touch ${destroot}${prefix}/lib/${name}"
 }
 
 test {
-	ui_msg "xcodeversion = $xcodeversion"
+	if {$xcodeversion != "" && [rpm-vercomp $xcodeversion 2.1] >= 0} {
+		ui_msg "xcodeversion >= 2.1"
+	} else {
+		ui_msg "xcodeversion = $xcodeversion"
+	}
 	ui_msg "xcodebuildcmd = $xcodebuildcmd"
 }

Modified: branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/master
===================================================================
--- branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/master	2011-07-06 11:36:11 UTC (rev 80185)
+++ branches/gsoc11-rev-upgrade/base/tests/test/xcodeversion/master	2011-07-06 11:59:33 UTC (rev 80186)
@@ -1,9 +1,8 @@
---->  Computing dependencies for xcodeversion
 --->  Fetching xcodeversion
 --->  Verifying checksum(s) for xcodeversion
 --->  Extracting xcodeversion
 --->  Configuring xcodeversion
 --->  Building xcodeversion
 --->  Testing xcodeversion
-xcodeversion = 2.1
-xcodebuildcmd = xcodebuild
+xcodeversion >= 2.1
+xcodebuildcmd = /usr/bin/xcodebuild
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110706/0d1eaa6d/attachment-0001.html>


More information about the macports-changes mailing list