[82923] branches/gsoc11-statistics/base

derek at macports.org derek at macports.org
Sun Aug 21 19:01:18 PDT 2011


Revision: 82923
          http://trac.macports.org/changeset/82923
Author:   derek at macports.org
Date:     2011-08-21 19:01:16 -0700 (Sun, 21 Aug 2011)
Log Message:
-----------
Merge from trunk

Modified Paths:
--------------
    branches/gsoc11-statistics/base/ChangeLog
    branches/gsoc11-statistics/base/Makefile.in
    branches/gsoc11-statistics/base/Mk/macports.autoconf.mk.in
    branches/gsoc11-statistics/base/aclocal.m4
    branches/gsoc11-statistics/base/config/RELEASE_URL
    branches/gsoc11-statistics/base/config/macports_version
    branches/gsoc11-statistics/base/configure
    branches/gsoc11-statistics/base/configure.ac
    branches/gsoc11-statistics/base/doc/portfile.7
    branches/gsoc11-statistics/base/doc/porthier.7
    branches/gsoc11-statistics/base/portmgr/ReleaseProcess
    branches/gsoc11-statistics/base/portmgr/dmg/InstallationCheck
    branches/gsoc11-statistics/base/portmgr/dmg/postflight
    branches/gsoc11-statistics/base/portmgr/jobs/mprsyncup
    branches/gsoc11-statistics/base/portmgr/jobs/port_binary_distributable.tcl
    branches/gsoc11-statistics/base/portmgr/jobs/portfile_mirror.pl
    branches/gsoc11-statistics/base/src/cregistry/vercomp.c
    branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile
    branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c
    branches/gsoc11-statistics/base/src/images_to_archives.tcl
    branches/gsoc11-statistics/base/src/macports1.0/Makefile
    branches/gsoc11-statistics/base/src/macports1.0/macports.tcl
    branches/gsoc11-statistics/base/src/package1.0/portarchivefetch.tcl
    branches/gsoc11-statistics/base/src/package1.0/portdpkg.tcl
    branches/gsoc11-statistics/base/src/package1.0/portpkg.tcl
    branches/gsoc11-statistics/base/src/pextlib1.0/Makefile
    branches/gsoc11-statistics/base/src/pextlib1.0/Pextlib.c
    branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.c
    branches/gsoc11-statistics/base/src/pextlib1.0/tests/curl.tcl
    branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.c
    branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.h
    branches/gsoc11-statistics/base/src/port/port.tcl
    branches/gsoc11-statistics/base/src/port/portindex.tcl
    branches/gsoc11-statistics/base/src/port1.0/port_autoconf.tcl.in
    branches/gsoc11-statistics/base/src/port1.0/portclean.tcl
    branches/gsoc11-statistics/base/src/port1.0/portconfigure.tcl
    branches/gsoc11-statistics/base/src/port1.0/portdistcheck.tcl
    branches/gsoc11-statistics/base/src/port1.0/portextract.tcl
    branches/gsoc11-statistics/base/src/port1.0/portfetch.tcl
    branches/gsoc11-statistics/base/src/port1.0/portlivecheck.tcl
    branches/gsoc11-statistics/base/src/port1.0/portutil.tcl
    branches/gsoc11-statistics/base/src/programs/daemondo/Makefile.in
    branches/gsoc11-statistics/base/src/registry2.0/Makefile
    branches/gsoc11-statistics/base/src/registry2.0/portimage.tcl
    branches/gsoc11-statistics/base/tests/test/xcodeversion/Portfile

Added Paths:
-----------
    branches/gsoc11-statistics/base/src/pextlib1.0/tests/vercomp.tcl

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


Property changes on: branches/gsoc11-statistics/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
/trunk/base:78736-79671
/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:78736-82922
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/gsoc11-statistics/base/ChangeLog
===================================================================
--- branches/gsoc11-statistics/base/ChangeLog	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/ChangeLog	2011-08-22 02:01:16 UTC (rev 82923)
@@ -3,8 +3,41 @@
 # $Id$
 ###
 
-Release 2.0.0 (unreleased):
+    - Implement new option-replace using lsearch/lreplace. The old behavior is
+      deprecated for option-replace with only one argument, but can still be
+      found in option-strsed.
+      (raimue in r82760, r82761)
 
+Release 2.0.1 (2011-08-02 by jmr):
+    - Fixed errors when installing some archives built on a case-sensitive
+      filesystem onto a case-insensitive one. (#30373, jmr in r81562)
+
+    - Fixed users created by MacPorts showing up in the GUI in some places on
+      Lion. (#30168, jeremyhu in r81558)
+
+    - Added replaced_by pseudo-portname selector. (afb in r81475)
+
+    - Added progress output to port image conversion script.
+      (#30347, jmr in r81464)
+
+    - Now doing a better job of avoiding UID conflicts with non-local users
+      when creating the 'macports' user. (#30464, jmr in r81414, r81415) Also
+      improved Tiger compatibility in this area. (jmr in r81454, r81467)
+
+    - Fixed 'port selfupdate' exiting with non-zero status after installing a
+      new version of base. (jmr in r81371)
+
+    - Added --subports to options accepted by 'port info'. (jmr in r81234)
+
+    - Fixed incorrect info sometimes being added to PortIndex entries when
+      using subports. (#30463, jmr in r81361)
+
+    - Fixed descriptions not being shown for default variants. (jmr in r80971)
+
+    - Fixed 'port variants --index'. (jmr in r80969)
+
+Release 2.0.0 (2011-07-22 by jmr):
+
     - 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)

Modified: branches/gsoc11-statistics/base/Makefile.in
===================================================================
--- branches/gsoc11-statistics/base/Makefile.in	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/Makefile.in	2011-08-22 02:01:16 UTC (rev 82923)
@@ -43,26 +43,45 @@
 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 $$USER = root; then \
+        if ! ${DSCL} -q . -read /Groups/${RUNUSR} > /dev/null 2>&1 ; then \
+            if test `id -u` -eq 0; then \
                 echo "Creating group \"${RUNUSR}\"" ; \
-                ${DSEDITGROUP} -q -o create -n . ${RUNUSR} ; \
+                ${DSEDITGROUP} -q -o create ${RUNUSR} ; \
             else \
                 echo "Not creating group \"${RUNUSR}\" (not root)" ; \
             fi ; \
         fi ; \
         if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then \
-            if test $$USER = root; then \
+            if test `id -u` -eq 0; then \
                 echo "Creating user \"${RUNUSR}\"" ; \
+                NEXTUID=501; \
+                while test -n "`${DSCL} -q /Search -search /Users UniqueID $$NEXTUID`"; do \
+                    let "NEXTUID=NEXTUID+1"; \
+                done; \
+                ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $$NEXTUID ; \
+                \
+                ${DSCL} -q . -delete /Users/${RUNUSR} AuthenticationAuthority ; \
+                ${DSCL} -q . -delete /Users/${RUNUSR} PasswordPolicyOptions ; \
+                ${DSCL} -q . -delete /Users/${RUNUSR} dsAttrTypeNative:KerberosKeys ; \
+                ${DSCL} -q . -delete /Users/${RUNUSR} dsAttrTypeNative:ShadowHashData ; \
+                \
+                ${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts ; \
                 ${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 /dev/null ; \
+                ${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 ; \
+        if test `sw_vers -productVersion | /usr/bin/awk -F . '{print $$2}'` -eq 4 -a `id -u` -eq 0; then \
+            GID=`${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}'` ; \
+            if test "`${DSCL} -q . -read /Users/${RUNUSR} PrimaryGroupID 2>/dev/null | /usr/bin/awk '{print $$2}'`" != "$$GID"; then \
+                echo "Fixing PrimaryGroupID for user \"${RUNUSR}\"" ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$GID ; \
+                ${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts ; \
+            fi ; \
+        fi ; \
     else \
         echo "Can't find ${DSCL} / ${DSEDITGROUP}, not creating user \"${RUNUSR}\"" ; \
     fi

Modified: branches/gsoc11-statistics/base/Mk/macports.autoconf.mk.in
===================================================================
--- branches/gsoc11-statistics/base/Mk/macports.autoconf.mk.in	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/Mk/macports.autoconf.mk.in	2011-08-22 02:01:16 UTC (rev 82923)
@@ -7,12 +7,13 @@
 VPATH			= @srcdir@
 
 CC			= @CC@
-CFLAGS			= @CFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_WERROR)
-OBJCFLAGS		= @OBJCFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_WERROR)
+CFLAGS			= @CFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_PEDANTIC) $(CFLAGS_WERROR)
+OBJCFLAGS		= @OBJCFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_PEDANTIC) $(CFLAGS_WERROR)
 CPPFLAGS		= @CPPFLAGS@ @DEFS@ @INCLUDES@ @TCL_INCLUDES@
 TCL_DEFS		= @TCL_DEFS@
 SHLIB_CFLAGS		= @SHLIB_CFLAGS@
 CFLAGS_QUICHEEATERS	= @CFLAGS_QUICHEEATERS@
+CFLAGS_PEDANTIC		= @CFLAGS_PEDANTIC@
 CFLAGS_WERROR		= @CFLAGS_WERROR@
 
 READLINE_CFLAGS		=

Modified: branches/gsoc11-statistics/base/aclocal.m4
===================================================================
--- branches/gsoc11-statistics/base/aclocal.m4	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/aclocal.m4	2011-08-22 02:01:16 UTC (rev 82923)
@@ -335,7 +335,7 @@
 
 		# Set Tcl package directory to ~/Library/Tcl
 	    AC_MSG_CHECKING(for Tcl package directory)
-		ac_cv_c_tclpkgd="~$DSTUSR/Library/Tcl"
+		ac_cv_c_tclpkgd=`eval echo ~$DSTUSR/Library/Tcl`
 	    # Convert to a native path and substitute into the output files.
 	    PACKAGE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclpkgd}`
 	    TCL_PACKAGE_DIR=${PACKAGE_DIR_NATIVE}
@@ -646,7 +646,7 @@
 			        fi
 			    fi
 			elif test "$path" = "~/Library/Tcl"; then
-			    ac_cv_c_tclpkgd="~$DSTUSR/Library/Tcl"
+			    ac_cv_c_tclpkgd=`eval echo ~$DSTUSR/Library/Tcl`
 			    break
 			fi
 			done

Modified: branches/gsoc11-statistics/base/config/RELEASE_URL
===================================================================
--- branches/gsoc11-statistics/base/config/RELEASE_URL	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/config/RELEASE_URL	2011-08-22 02:01:16 UTC (rev 82923)
@@ -1 +1 @@
-https://svn.macports.org/repository/macports/tags/release_1_9_2/base
+https://svn.macports.org/repository/macports/tags/release_2_0_1/base

Modified: branches/gsoc11-statistics/base/config/macports_version
===================================================================
--- branches/gsoc11-statistics/base/config/macports_version	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/config/macports_version	2011-08-22 02:01:16 UTC (rev 82923)
@@ -1 +1 @@
-1.9.99
+2.0.99

Modified: branches/gsoc11-statistics/base/configure
===================================================================
--- branches/gsoc11-statistics/base/configure	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/configure	2011-08-22 02:01:16 UTC (rev 82923)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for MacPorts 1.9.99.
+# Generated by GNU Autoconf 2.68 for MacPorts 2.0.99.
 #
 # Report bugs to <macports-dev at lists.macosforge.org>.
 #
@@ -560,8 +560,8 @@
 # Identity of this package.
 PACKAGE_NAME='MacPorts'
 PACKAGE_TARNAME='macports'
-PACKAGE_VERSION='1.9.99'
-PACKAGE_STRING='MacPorts 1.9.99'
+PACKAGE_VERSION='2.0.99'
+PACKAGE_STRING='MacPorts 2.0.99'
 PACKAGE_BUGREPORT='macports-dev at lists.macosforge.org'
 PACKAGE_URL=''
 
@@ -674,6 +674,7 @@
 PTHREAD_LIBS
 acx_pthread_config
 CFLAGS_WERROR
+CFLAGS_PEDANTIC
 CFLAGS_QUICHEEATERS
 TAR_CMD
 TAR_Q
@@ -683,6 +684,8 @@
 PAX
 MKBOM
 LSBOM
+XZ
+LZMA
 BZIP2
 GNUPATCH
 GNUMAKE
@@ -838,6 +841,8 @@
 BSDMAKE
 GNUMAKE
 BZIP2
+LZMA
+XZ
 XAR
 OPEN
 OBJCPP
@@ -1384,7 +1389,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures MacPorts 1.9.99 to adapt to many kinds of systems.
+\`configure' configures MacPorts 2.0.99 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1450,7 +1455,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of MacPorts 1.9.99:";;
+     short | recursive ) echo "Configuration of MacPorts 2.0.99:";;
    esac
   cat <<\_ACEOF
 
@@ -1522,6 +1527,8 @@
   BSDMAKE     path to bsdmake/pmake command
   GNUMAKE     path to gnumake command
   BZIP2       path to bzip2 command
+  LZMA        path to lzma command
+  XZ          path to xz command
   XAR         path to xar command
   OPEN        path to open command
   OBJCPP      Objective C preprocessor
@@ -1593,7 +1600,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-MacPorts configure 1.9.99
+MacPorts configure 2.0.99
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2262,7 +2269,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by MacPorts $as_me 1.9.99, which was
+It was created by MacPorts $as_me 2.0.99, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2757,7 +2764,7 @@
 # Read in the MacPorts version from the base/config/macports_version file
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking MacPorts version" >&5
 $as_echo_n "checking MacPorts version... " >&6; }
-MACPORTS_VERSION=1.9.99
+MACPORTS_VERSION=2.0.99
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACPORTS_VERSION" >&5
 $as_echo "$MACPORTS_VERSION" >&6; }
 
@@ -2923,7 +2930,7 @@
     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-6])
+  10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-7])
     { $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
@@ -5502,6 +5509,86 @@
 fi
 
 
+# Extract the first word of "lzma", so it can be a program name with args.
+set dummy lzma; 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_LZMA+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $LZMA in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LZMA="$LZMA" # 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_LZMA="$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
+LZMA=$ac_cv_path_LZMA
+if test -n "$LZMA"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LZMA" >&5
+$as_echo "$LZMA" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "xz", so it can be a program name with args.
+set dummy xz; 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_XZ+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $XZ in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XZ="$XZ" # 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_XZ="$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
+XZ=$ac_cv_path_XZ
+if test -n "$XZ"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XZ" >&5
+$as_echo "$XZ" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "lsbom", so it can be a program name with args.
 set dummy lsbom; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5720,6 +5807,8 @@
 
 
 
+
+
 	# Extract the first word of "sed", so it can be a program name with args.
 set dummy sed; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6051,11 +6140,13 @@
 
 # Quiche eaters options.
 if test x$GCC = xyes; then
-	CFLAGS_QUICHEEATERS='-W -Wall -pedantic'
+	CFLAGS_QUICHEEATERS='-Wextra -Wall'
+	CFLAGS_PEDANTIC='-pedantic'
 fi
 
 
 
+
 	# Check whether --enable-werror was given.
 if test "${enable_werror+set}" = set; then :
   enableval=$enable_werror; enable_werror=${enableval}
@@ -7650,8 +7741,8 @@
   with_unsupported_prefix=no
 fi
 
-if test x$prefix = x/usr/local -a x$with_unsupported_prefix != xyes; then
-    as_fn_error $? "Installing MacPorts into /usr/local is not supported. If \
+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
@@ -7747,7 +7838,7 @@
 		# 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; }
-		ac_cv_c_tclpkgd="~$DSTUSR/Library/Tcl"
+		ac_cv_c_tclpkgd=`eval echo ~$DSTUSR/Library/Tcl`
 	    # Convert to a native path and substitute into the output files.
 	    PACKAGE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclpkgd}`
 	    TCL_PACKAGE_DIR=${PACKAGE_DIR_NATIVE}
@@ -9210,7 +9301,7 @@
 			        fi
 			    fi
 			elif test "$path" = "~/Library/Tcl"; then
-			    ac_cv_c_tclpkgd="~$DSTUSR/Library/Tcl"
+			    ac_cv_c_tclpkgd=`eval echo ~$DSTUSR/Library/Tcl`
 			    break
 			fi
 			done
@@ -10178,7 +10269,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by MacPorts $as_me 1.9.99, which was
+This file was extended by MacPorts $as_me 2.0.99, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10240,7 +10331,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-MacPorts config.status 1.9.99
+MacPorts config.status 2.0.99
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/gsoc11-statistics/base/configure.ac
===================================================================
--- branches/gsoc11-statistics/base/configure.ac	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/configure.ac	2011-08-22 02:01:16 UTC (rev 82923)
@@ -32,7 +32,7 @@
     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-6]])
+  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-7]])
     AC_MSG_WARN([This version of Mac OS X is out of date])
     AC_MSG_WARN([Please run Software Update to update it])
     ;;
@@ -123,6 +123,8 @@
 AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
 AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [], [$PATH:/usr/local/bin])
 AC_PATH_PROG(BZIP2, [bzip2], [])
+AC_PATH_PROG(LZMA, [lzma], [])
+AC_PATH_PROG(XZ, [xz], [])
 AC_PATH_PROG(LSBOM, [lsbom], [])
 AC_PATH_PROG(MKBOM, [mkbom], [])
 AC_PATH_PROG(PAX, [pax], [])
@@ -142,6 +144,8 @@
 AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
 AC_ARG_VAR(GNUMAKE, [path to gnumake command])
 AC_ARG_VAR(BZIP2, [path to bzip2 command])
+AC_ARG_VAR(LZMA, [path to lzma command])
+AC_ARG_VAR(XZ, [path to xz command])
 AC_ARG_VAR(XAR, [path to xar command])
 AC_ARG_VAR(OPEN, [path to open command])
 
@@ -152,9 +156,11 @@
 
 # Quiche eaters options.
 if test x$GCC = xyes; then
-	CFLAGS_QUICHEEATERS='-W -Wall -pedantic'
+	CFLAGS_QUICHEEATERS='-Wextra -Wall'
+	CFLAGS_PEDANTIC='-pedantic'
 fi
 AC_SUBST(CFLAGS_QUICHEEATERS)
+AC_SUBST(CFLAGS_PEDANTIC)
 MP_WERROR
 
 MP_COMPILER_ATTRIBUTE_UNUSED
@@ -180,8 +186,8 @@
 		[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 -a x$with_unsupported_prefix != xyes; then
-    AC_MSG_ERROR([Installing MacPorts into /usr/local is not supported. If \
+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

Modified: branches/gsoc11-statistics/base/doc/portfile.7
===================================================================
--- branches/gsoc11-statistics/base/doc/portfile.7	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/doc/portfile.7	2011-08-22 02:01:16 UTC (rev 82923)
@@ -2119,8 +2119,8 @@
 .Xr mkdtemp 3 .
 .It Ic md5 Ar
 Compute the MD5 hashes of the file(s).
-.It Ic rpm-vercomp Ar versionA Ar versionB
-Compare two RPM-format versions for equality.  The return value is like
+.It Ic vercmp Ar versionA Ar versionB
+Compare two EVR-format versions for equality.  The return value is like
 strcmp(), returning -1, 0, or 1 when versionA is earlier, equal to, or
 later than versionB, respectively.  Note that some comparisions featuring
 floating-point notation may compare incorrectly, e.g. 2.101 is considered

Modified: branches/gsoc11-statistics/base/doc/porthier.7
===================================================================
--- branches/gsoc11-statistics/base/doc/porthier.7	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/doc/porthier.7	2011-08-22 02:01:16 UTC (rev 82923)
@@ -99,7 +99,10 @@
 .It Pa distfiles/
 Holds the distfiles of the fetched ports
 .It Pa receipts/
-Holds the registry information and receipts for the installed ports
+Obsolete. Formerly held the registry information and receipts for the installed ports,
+in flat-file format.
+.It Pa registry/
+Contains the registry database in sqlite format.
 .It Pa software/
 Holds compressed images of the installed ports. These
 are extracted to ${prefix} when activated.

Modified: branches/gsoc11-statistics/base/portmgr/ReleaseProcess
===================================================================
--- branches/gsoc11-statistics/base/portmgr/ReleaseProcess	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/portmgr/ReleaseProcess	2011-08-22 02:01:16 UTC (rev 82923)
@@ -31,17 +31,17 @@
 
 === Create a Release Branch ===
 
-For each major release (i.e. 1.5.x, 1.6.x, etc.) an appropriate branch is created with a
+For each major release (i.e. 1.9.x, 2.0.x, etc.) an appropriate branch is created with a
 consistent name. To do this, two things are required:
 
  * Choose the svn revision from which to create the branch, most likely based off trunk.
- * Create the branch (e.g. release_1_6) through the svn "copy" command for history preservation,
+ * Create the branch (e.g. release_2_0) through the svn "copy" command for history preservation,
    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" https://svn.macports.org/repository/macports/branches/release_1_6
+ svn mkdir -m "commit-message" https://svn.macports.org/repository/macports/branches/release_2_0
  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
+     https://svn.macports.org/repository/macports/branches/release_2_0
 
 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,
@@ -81,19 +81,20 @@
 
 Tagging conventions:
 
- * release_1_6_0-rc1 (release candidate 1 for release 1.6.0)
- * release_1_6_0 (tagged release 1.6.0)
- * release_1_6_0-archive (tagged release 1.6.0 -- complete archive)
- * release_1_6_1 (1.6.1 release)
+ * release_2_0_0-beta2 (beta 2 for release 2.0.0)
+ * release_2_0_0-rc1 (release candidate 1 for release 2.0.0)
+ * release_2_0_0 (tagged release 2.0.0)
+ * release_2_0_0-archive (tagged release 2.0.0 -- complete archive)
+ * release_2_0_1 (2.0.1 release)
 
 We first tag the branched base directory to make up the final release:
 
- 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
+ svn cp -m "commit-message" https://svn.macports.org/repository/macports/branches/release_2_0 \
+     https://svn.macports.org/repository/macports/tags/release_2_0_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
-created (only for major releases, 1.x.0), in order to provide a stake in the ground that specifies a set
+created (only for major releases, x.y.0), in order to provide a stake in the ground that specifies a set
 of ports intended to work with that release. Note that this tag incorporates the entire svn trunk directory
 at the revision number at which the final release was tagged.
 
@@ -101,14 +102,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>] https://svn.macports.org/repository/macports/trunk release_1.6.0-archive
- cd release_1.6.0-archive/base
- svn switch https://svn.macports.org/repository/macports/tags/release_1_6_0/base
+ svn co [-r<rev>] https://svn.macports.org/repository/macports/trunk release_2.0.0-archive
+ cd release_2.0.0-archive/base
+ svn switch https://svn.macports.org/repository/macports/tags/release_2_0_0/base
 
-And finally we tag the entire directory as release_1_6_0-archive:
+And finally we tag the entire directory as release_2_0_0-archive:
 
  cd ../../
- svn cp -m "commit-message" release_1.6.0-archive https://svn.macports.org/repository/macports/tags/release_1_6_0-archive
+ svn cp -m "commit-message" release_2.0.0-archive https://svn.macports.org/repository/macports/tags/release_2_0_0-archive
 
 
 === Create & Post Release Tarballs ===
@@ -116,12 +117,12 @@
 The release tarballs are tar.bz2 and tar.gz archives of the base directory only and of the entire svn tree
 for a particular release. They are named with the following naming convention:
 
- MacPorts-1.6.0.tar.{bz2,gz} (base directory only, corresponding to tag release_1_6_0)
- MacPorts-1.6.0-archive.tar.{bz2,gz} (complete archives corresponding to tag release_1_6_0-archive)
+ MacPorts-2.0.0.tar.{bz2,gz} (base directory only, corresponding to tag release_2_0_0)
+ MacPorts-2.0.0-archive.tar.{bz2,gz} (complete archives corresponding to tag release_2_0_0-archive)
 
 The following commands issued to the top level Makefile will generate all the tarballs and checksums:
 
- make ARC=yes DISTVER=1.6.0 distfromsvn
+ make ARC=yes DISTVER=2.0.0 distfromsvn
 
 Note that if you omit the "ARC=yes" flag at the start of the make call then the full archive tarballs will not be produced.
 
@@ -131,7 +132,7 @@
 Additionally, a file is created, and posted to the same location, that contains md5, sha1, and rmd160 checksums
 for each of the files:
 
- MacPorts-1.6.0.chk.txt
+ MacPorts-2.0.0.chk.txt
  (We should have a way to sign these checksums, and have the signer's keys posted somewhere.
  Security experts in the project, would you be interested in leading this effort? Eric? Mark? Anyone else?)
 
@@ -139,11 +140,12 @@
 === Create Release Disk Image(s) ===
 
 The dmg is a Mac OS X disk image that contains a standalone installer, configured in the usual way, for major
-MacPorts releases (1.x.0), named in a consistent fashion and incorporating the OS version for which it
+MacPorts releases (x.y.0), named in a consistent fashion and incorporating the OS version for which it
 was built.
 
- MacPorts-1.6.0-10.4-Tiger.dmg
- MacPorts-1.6.0-10.5-Leopard.dmg
+ MacPorts-2.0.0-10.5-Leopard.dmg
+ MacPorts-2.0.0-10.6-SnowLeopard.dmg
+ MacPorts-2.0.0-10.7-Lion.dmg
 
 To create a disk image, use the MacPorts port. The Portfile will need to be updated to incorporate the
 proper release version and checksums, and the release tarballs will need to be already uploaded to the
@@ -156,8 +158,8 @@
 file in the downloads directory:
 
  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 -sha256; do openssl dgst $type $dmg; done >> MacPorts-1.6.0.chk.txt; done
+ mv MacPorts-2.0.0.dmg MacPorts-2.0.0-10.6-SnowLeopard.dmg
+ for dmg in MacPorts-2.0.0-*.dmg; do for type in -md5 -sha1 -ripemd160 -sha256; do openssl dgst $type $dmg; done >> MacPorts-2.0.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
@@ -206,8 +208,9 @@
 
 
 === Update trunk's version for next release ===
+
 Once trunk is to be used for development of the next major version, increase its version information to
-indicate it's moved past the release version by setting the patch-level version to 99, e.g., 1.8.99 (in
+indicate it's moved past the release version by setting the patch-level version to 99, e.g. 2.0.99 (in
 trunk/base/config/macports_version).
 
 
@@ -218,10 +221,18 @@
  * 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.
  * [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@)
  * [http://sourceforge.net/projects/macports/ sourceforge] (submitted: rhwood@)
  * [http://www.macupdate.com/info.php/id/21309/macports MacUpdate] (submitter: ???)
  * [http://twitter.com/macports twitter] (submitter: raimue@)
  * (Where else?)
+
+
+=== Use of new features in Portfiles ===
+
+Using new features introduced by a release should be delayed for 14 days. This
+should allow users to upgrade their installations to the new release. This
+delay matches the warning about outdated ports tree sources.
+
+

Modified: branches/gsoc11-statistics/base/portmgr/dmg/InstallationCheck
===================================================================
--- branches/gsoc11-statistics/base/portmgr/dmg/InstallationCheck	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/portmgr/dmg/InstallationCheck	2011-08-22 02:01:16 UTC (rev 82923)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # $Id$
 #

Modified: branches/gsoc11-statistics/base/portmgr/dmg/postflight
===================================================================
--- branches/gsoc11-statistics/base/portmgr/dmg/postflight	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/portmgr/dmg/postflight	2011-08-22 02:01:16 UTC (rev 82923)
@@ -36,7 +36,7 @@
 #set -x
 
 # Script identification ('cause more often than not the svn Id is not expanded):
-VERSION=1.9.0
+VERSION=2.0.0
 
 # Abstraction variables:
 PREFIX=__PREFIX__
@@ -57,7 +57,7 @@
 # Create config files from defaults if not present
 function setup_configs {
     for f in macports.conf pubkeys.conf sources.conf variants.conf ; do
-        if [ ! -f ${CONFIGPATH}/${f} ]; then
+        if [[ ! -f ${CONFIGPATH}/${f} ]]; then
             echo "Copying ${f}.default to ${f}"
             /bin/cp ${CONFIGPATH}/${f}.default ${CONFIGPATH}/${f}
             /bin/chmod 644 ${CONFIGPATH}/${f}
@@ -87,7 +87,7 @@
 # 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."
@@ -117,7 +117,7 @@
 
 # Delete the old registry1.0 directory
 function delete_reg1 {
-    if [ -d ${REG1DIR} ]; then
+    if [[ -d ${REG1DIR} ]]; then
         rm -vrf ${REG1DIR}
     fi
 }
@@ -125,38 +125,63 @@
 # 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
-        rm -vrf "${TCL_PACKAGE_DIR}/macports1.0" || true
-    fi
-    if ! test -e "${TCL_PACKAGE_DIR}/macports1.0" && test -w "${TCL_PACKAGE_DIR}"; then
-		ln -vs "${MACPORTS_TCL_DIR}/macports1.0" "${TCL_PACKAGE_DIR}/macports1.0" || true
+    if [[ ! -L "${TCL_PACKAGE_DIR}/macports1.0" ]]; then
+        if [[ ! -e "${TCL_PACKAGE_DIR}" ]]; then
+            /usr/bin/install -d "${TCL_PACKAGE_DIR}" || true
+        fi
+        if [[ -d "${TCL_PACKAGE_DIR}/macports1.0" ]]; then
+            rm -vrf "${TCL_PACKAGE_DIR}/macports1.0" || true
+        fi
+        if [[ ! -e "${TCL_PACKAGE_DIR}/macports1.0" && -d "${TCL_PACKAGE_DIR}" ]]; then
+            ln -vs "${MACPORTS_TCL_DIR}/macports1.0" "${TCL_PACKAGE_DIR}/macports1.0" || true
+        fi
 	fi
 }
 
 # create the user to use for privilege dropping
 function create_run_user {
     DSEDITGROUP=/usr/sbin/dseditgroup
-    if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then
-        if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then
-            echo "Creating group \"${RUNUSR}\""
-            ${DSEDITGROUP} -q -o create -n . ${RUNUSR}
+    if ! ${DSCL} -q . -read /Groups/${RUNUSR} > /dev/null 2>&1 ; then
+        echo "Creating group \"${RUNUSR}\""
+        ${DSEDITGROUP} -q -o create ${RUNUSR}
+    fi
+    if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then
+        echo "Creating user \"${RUNUSR}\""
+        NEXTUID=501
+        while [[ -n "`${DSCL} -q /Search -search /Users UniqueID $NEXTUID`" ]]; do
+            let "NEXTUID=NEXTUID+1"
+        done
+        ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $NEXTUID
+
+        # These are implicitly added on Mac OSX Lion.  AuthenticationAuthority
+        # causes the user to be visible in the Users & Groups Preference Pane,
+        # and the others are just noise, so delete them.
+        # https://trac.macports.org/ticket/30168
+        ${DSCL} -q . -delete /Users/${RUNUSR} AuthenticationAuthority
+        ${DSCL} -q . -delete /Users/${RUNUSR} PasswordPolicyOptions
+        ${DSCL} -q . -delete /Users/${RUNUSR} dsAttrTypeNative:KerberosKeys
+        ${DSCL} -q . -delete /Users/${RUNUSR} dsAttrTypeNative:ShadowHashData
+
+        ${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts
+        ${DSCL} -q . -create /Users/${RUNUSR} Password \*
+        ${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
+    if [[ $(sw_vers -productVersion | /usr/bin/awk -F . '{print $2}') -eq 4 ]]; then
+        GID=$(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $2}')
+        if [[ "$(${DSCL} -q . -read /Users/${RUNUSR} PrimaryGroupID 2>/dev/null | /usr/bin/awk '{print $2}')" != "$GID" ]]; then
+            echo "Fixing PrimaryGroupID for user \"${RUNUSR}\""
+            ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $GID
+            ${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts
         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 /dev/null
-            ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false
-        fi
-    else
-        echo "Can't find ${DSCL} / ${DSEDITGROUP}, unable to create user \"${RUNUSR}\""
-        exit 1
     fi
 }
 
 echo "The MacPorts Project, postflight script version ${VERSION}: checking the shell environment for user \"${USER}\"."
 
+# create macports user
+create_run_user
 # Set up config files
 setup_configs
 # link macports1.0 pkg
@@ -179,9 +204,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
@@ -192,9 +217,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
@@ -220,15 +245,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"


Property changes on: branches/gsoc11-statistics/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:78736-79671
/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:78736-82922
/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-statistics/base/portmgr/jobs/mprsyncup
===================================================================
--- branches/gsoc11-statistics/base/portmgr/jobs/mprsyncup	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/portmgr/jobs/mprsyncup	2011-08-22 02:01:16 UTC (rev 82923)
@@ -43,7 +43,6 @@
 
 # Paths we'll work on:
 ROOT=/var/tmp/macports
-TMPDIR=mp_trunk/base
 PREFIX=${ROOT}/opt/local
 TCLPKG=${PREFIX}/lib/tcl
 SVNROOT=/var/tmp/macports
@@ -60,9 +59,6 @@
 # copy new index of this platform to old index location for MP v1.8 compatability
 OLD_INDEX_PLATFORM="9_i386"
 
-MP_USER=nobody
-MP_GROUP=nobody
-
 # Sources information:
 SVNURL=https://svn.macports.org/repository/macports
 RELEASE_URL_FILE=config/RELEASE_URL
@@ -120,13 +116,11 @@
 # generate platform-specific indexes
 pushd ${PORTS} >> /dev/null
 # build MP trunk in a private location for indexing
-pushd ${ROOT}/${TMPDIR} >> /dev/null
+pushd ${TBASE} >> /dev/null
 ${MKDIR} -p ${TCLPKG}
 ./configure \
     --prefix=${PREFIX} \
-    --with-tclpackage=${TCLPKG} \
-    --with-install-user=${MP_USER} \
-    --with-install-group=${MP_GROUP}
+    --with-tclpackage=${TCLPKG}
 make clean
 make
 make install

Modified: branches/gsoc11-statistics/base/portmgr/jobs/port_binary_distributable.tcl
===================================================================
--- branches/gsoc11-statistics/base/portmgr/jobs/port_binary_distributable.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/portmgr/jobs/port_binary_distributable.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -20,28 +20,51 @@
 
 set check_deptypes {depends_build depends_lib}
 
-set good_licenses {agpl apache apsl artistic boost bsd cecill cpl curl \
-                   fontconfig freebsd freetype gfdl gpl ibmpl ijg jasper \
-                   lgpl libpng mit mpl openssl php psf qpl public-domain \
-                   ruby sleepycat ssleay x11 zlib zpl}
+
+# Notes:
+# 'Restrictive/Distributable' means a non-free license that nonetheless allows
+# distributing binaries.
+# 'Restrictive' means a non-free license that does not allow distributing
+# binaries, and is thus not in the list.
+# 'Permissive' is a catchall for other licenses that allow
+# modification and distribution of source and binaries.
+# 'Copyleft' means a license that requires source code to be made available,
+# and derivative works to be licensed the same as the original.
+# 'GPLConflict' should be added if the license conflicts with the GPL (and its
+# variants like CeCILL and the AGPL) and is not in the list of licenses known
+# to do so below.
+# 'Noncommercial' means a license that prohibits commercial use.
+set good_licenses {agpl apache apsl artistic autoconf boost bsd cecill copyleft cpl
+                   curl fontconfig freebsd freetype gfdl gpl gplconflict ibmpl ijg
+                   jasper lgpl libpng libtool mit mpl noncommercial openssl permissive
+                   php psf qpl public-domain restrictive/distributable ruby sleepycat
+                   ssleay tcl/tk x11 zlib zpl}
 foreach lic $good_licenses {
     set license_good($lic) 1
 }
 # keep these values sorted
 array set license_conflicts \
-    {agpl {cecill gpl} \
-    apache {cecill gpl} \
-    apsl {cecill gpl} \
-    cpl {cecill gpl} \
-    cecill {agpl apache apsl cpl ibmpl mpl openssl php qpl ssleay zpl-1} \
-    freetype {gpl-2} \
-    gpl {agpl apache apsl cpl ibmpl mpl openssl php qpl ssleay zpl-1} \
-    gpl-2 {freetype} \
-    ibmpl {cecill gpl} \
-    mpl {cecill gpl} \
-    openssl {cecill gpl} \
-    php {cecill gpl} \
-    qpl {cecill gpl} \
+    {agpl {apache-1 apache-1.1 cecill gpl-1 gpl-2 gplconflict noncommercial restrictive/distributable}
+    apache {cecill gpl-1 gpl-2}
+    apache-1 {agpl gpl}
+    apache-1.1 {agpl gpl}
+    apsl {cecill gpl}
+    cpl {cecill gpl}
+    cecill {agpl apache apsl cpl gplconflict ibmpl mpl noncommercial openssl php qpl restrictive/distributable ssleay zpl-1}
+    freetype {gpl-2}
+    gpl {agpl apache-1 apache-1.1 apsl cpl gplconflict ibmpl mpl noncommercial openssl php qpl restrictive/distributable ssleay zpl-1}
+    gpl-1 {apache gpl-3 gpl-3+ lgpl-3 lgpl-3+}
+    gpl-2 {apache freetype gpl-3 gpl-3+ lgpl-3 lgpl-3+}
+    gpl-3 {gpl-1 gpl-2}
+    gpl-3+ {gpl-1 gpl-2}
+    ibmpl {cecill gpl}
+    lgpl-3 {gpl-1 gpl-2}
+    lgpl-3+ {gpl-1 gpl-2}
+    mpl {cecill gpl}
+    openssl {cecill gpl}
+    php {cecill gpl}
+    qpl {cecill gpl}
+    restrictive/distributable {agpl cecill gpl}
     ssleay {cecill gpl}
     zpl-1 {cecill gpl}}
 

Modified: branches/gsoc11-statistics/base/portmgr/jobs/portfile_mirror.pl
===================================================================
--- branches/gsoc11-statistics/base/portmgr/jobs/portfile_mirror.pl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/portmgr/jobs/portfile_mirror.pl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -20,7 +20,7 @@
 my $rev = $ARGV[0] or usage();
 my $TMPROOT = "/tmp/mp_mirror/$rev";
 
-my @changes = `$SVNLOOK changed $REPOPATH -r $rev`;
+my @changes = `$SVNLOOK changed $REPOPATH -r $rev | grep '/Portfile' | grep -vE '^[ ]+D'`;
 
 foreach my $change (@changes) {
     if ($change =~ /Portfile/) { 

Modified: branches/gsoc11-statistics/base/src/cregistry/vercomp.c
===================================================================
--- branches/gsoc11-statistics/base/src/cregistry/vercomp.c	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/cregistry/vercomp.c	2011-08-22 02:01:16 UTC (rev 82923)
@@ -47,7 +47,7 @@
  */
 
 /**
- * RPM version comparison. Shamelessly copied from Pextlib, with some changes to
+ * EVR version comparison. Shamelessly copied from Pextlib, with some changes to
  * use string lengths instead of strlen by default. That's necessary to make it
  * work with sqlite3 collations. It should be shared with Pextlib, rather than
  * just copied though.
@@ -58,7 +58,7 @@
  * @param [in] lengthA  length of second version string, or -1 to use strlen
  * @return              -1 if A < B; 0 if A = B; 1 if A > B
  */
-static int rpm_vercomp (const char *versionA, int lengthA, const char *versionB,
+static int vercmp (const char *versionA, int lengthA, const char *versionB,
         int lengthB) {
     const char *endA, *endB;
 	const char *ptrA, *ptrB;
@@ -173,7 +173,7 @@
 
 /**
  * VERSION collation for sqlite3. This function collates text according to
- * pextlib's rpm-vercomp function. This allows direct comparison and sorting of
+ * pextlib's vercmp function. This allows direct comparison and sorting of
  * version columns, such as port.version and port.revision.
  *
  * @param [in] userdata unused
@@ -185,5 +185,5 @@
  */
 int sql_version(void* userdata UNUSED, int alen, const void* a, int blen,
         const void* b) {
-    return rpm_vercomp((const char*)a, alen, (const char*)b, blen);
+    return vercmp((const char*)a, alen, (const char*)b, blen);
 }

Modified: branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile
===================================================================
--- branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile	2011-08-22 02:01:16 UTC (rev 82923)
@@ -6,7 +6,8 @@
 
 include ../../Mk/macports.autoconf.mk
 
-CFLAGS+= -fPIC
+CFLAGS+= -fPIC -Wno-deprecated-declarations
+CFLAGS_PEDANTIC=
 
 all:: ${SHLIB_NAME}
 

Modified: branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c
===================================================================
--- branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c	2011-08-22 02:01:16 UTC (rev 82923)
@@ -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-statistics/base/src/images_to_archives.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/images_to_archives.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/images_to_archives.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -13,8 +13,10 @@
 
 umask 022
 
-mportinit
+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}]
@@ -31,8 +33,11 @@
 # 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 {}
+set installed_len [llength $ilist]
+set counter 0
 
 foreach installed $ilist {
+    incr counter
     set iname [lindex $installed 0]
     set iversion [lindex $installed 1]
     set irevision [lindex $installed 2]
@@ -82,6 +87,7 @@
 
         # compute new name and location of archive
         set archivename "${iname}-${iversion}_${irevision}${ivariants}.${macports::os_platform}_${macports::os_major}.[join $archs -].${archivetype}"
+        ui_msg "Processing ${counter} of ${installed_len}: ${archivename}"
         if {$installtype == "image"} {
             set targetdir [file dirname $location]
         } else {
@@ -113,8 +119,13 @@
     }
 }
 
+set archived_len [llength $archived_list]
+set counter 0
+
 registry::write {
     foreach archived $archived_list {
+        incr counter
+        ui_msg "Updating registry: ${counter} of ${archived_len}"
         set installtype [lindex $archived 0]
         set iref [lindex $archived 1]
         set newlocation [lindex $archived 3]
@@ -132,8 +143,11 @@
     }
 }
 
+set counter 0
 foreach archived $archived_list {
+    incr counter
     set location [lindex $archived 2]
+    ui_msg "Deleting ${counter} of ${archived_len}: ${location}"
     if {$location != "" && [file isdirectory $location]} {
         if {[catch {file delete -force $location} result]} {
             ui_warn "Failed to delete ${location}: $result"

Modified: branches/gsoc11-statistics/base/src/macports1.0/Makefile
===================================================================
--- branches/gsoc11-statistics/base/src/macports1.0/Makefile	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/macports1.0/Makefile	2011-08-22 02:01:16 UTC (rev 82923)
@@ -33,15 +33,15 @@
 
 	echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
 	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 -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; \
+		if test ! -L "${INSTALLPKGLINK}"; then \
+            if test ! -e "${TCL_PACKAGE_DIR}"; then \
+                $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
+            fi; \
+            if test -d "${INSTALLPKGLINK}"; then \
+                rm -vrf "${INSTALLPKGLINK}" || true; \
+            fi; \
+            if test ! -e "${INSTALLPKGLINK}"; then \
+                ln -vs "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
+            fi; \
+        fi; \
 	fi

Modified: branches/gsoc11-statistics/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/macports1.0/macports.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/macports1.0/macports.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -48,7 +48,7 @@
         mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
         applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip \
-        master_site_local patch_site_local archive_site_local stats_participate stats_url stats_id"
+        master_site_local patch_site_local archive_site_local buildfromsource stats_participate stats_url stats_id"
     variable user_options "submitter_name submitter_email submitter_key"
     variable portinterp_options "\
         portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
@@ -374,8 +374,7 @@
                         set macports::xcodeversion "3.2.6"
                     } elseif {$devtoolscore_v >= 1204.0} {
                         set macports::xcodeversion "3.1.4"
-                    } elseif {$devtoolscore_v > 921.0} {
-                        # XXX find actual version corresponding to 3.1
+                    } elseif {$devtoolscore_v >= 1100.0} {
                         set macports::xcodeversion "3.1"
                     } elseif {$devtoolscore_v >= 921.0} {
                         set macports::xcodeversion "3.0"
@@ -527,6 +526,8 @@
     } else {
         # Otherwise define the user directory as a direcotory that will never exist
         set macports::macports_user_dir "/dev/null/NO_HOME_DIR"
+        # Tcl library code wants to do tilde expansion in various places
+        set env(HOME) ${macports::macports_user_dir}
     }
 
     # set up platform info variables
@@ -721,6 +722,18 @@
             set macports::porttrace $macports::global_options(ports_trace)
         }
     }
+    # Check command line override for source/binary only mode
+    if {![info exists macports::global_options(ports_binary_only)]
+        && ![info exists macports::global_options(ports_source_only)]
+        && [info exists macports::buildfromsource]} {
+        if {${macports::buildfromsource} == "never"} {
+            set macports::global_options(ports_binary_only) yes
+        } elseif {${macports::buildfromsource} == "always"} {
+            set macports::global_options(ports_source_only) yes
+        } elseif {${macports::buildfromsource} != "ifneeded"} {
+            ui_warn "'buildfromsource' set to unknown value '${macports::buildfromsource}', using 'ifneeded' instead"
+        }
+    }
 
     # Duplicate prefix into prefix_frozen, so that port actions
     # can always get to the original prefix, even if a portfile overrides prefix
@@ -883,6 +896,9 @@
         }
     }
 
+    # make tools we run operate in UTF-8 mode
+    set env(LANG) en_US.UTF-8
+
     if {![info exists xcodeversion] || ![info exists xcodebuildcmd]} {
         # We'll resolve these later (if needed)
         trace add variable macports::xcodeversion read macports::setxcodeinfo
@@ -996,7 +1012,7 @@
     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]} {
+    if {$db_exists == 0 && [file exists ${registry.path}/receipts] && [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"
@@ -1210,9 +1226,8 @@
     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"
+    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"
@@ -1234,9 +1249,9 @@
     # 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"
+        set cmdline "$tarcmd ${tarflags}${qflag}xOf \"$fetchfile\" +PORTFILE > Portfile"
     } else {
-        set cmdline "$tarcmd ${tarflags}xf {$fetchfile}"
+        set cmdline "$tarcmd ${tarflags}xf \"$fetchfile\""
     }
     ui_debug "$cmdline"
     if {[catch {eval exec $cmdline} result]} {
@@ -1265,7 +1280,7 @@
     switch ${protocol} {
         file {
             set path [file normalize [string range $url [expr [string length $protocol] + 3] end]]
-            if {[file isdirectory $path]} {
+            if {![file isfile $path]} {
                 return $path
             } else {
                 # need to create a local dir for the exracted port, but only once
@@ -1637,6 +1652,7 @@
     macports::push_log $mport
     # xxx: set the work path?
     set workername [ditem_key $mport workername]
+    $workername eval validate_macportsuser
     if {![catch {$workername eval check_variants $target} result] && $result == 0 &&
         ![catch {$workername eval check_supported_archs} result] && $result == 0 &&
         ![catch {$workername eval eval_targets $target} result] && $result == 0} {
@@ -1672,6 +1688,8 @@
 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
@@ -2635,7 +2653,7 @@
     set workername [ditem_key $mport workername]
     set deptypes [macports::_deptypes_for_target $target $workername]
 
-    set subPorts {}
+    set depPorts {}
     if {[llength $deptypes] > 0} {
         array set optionsarray [ditem_key $mport options]
         # avoid propagating requested flag from parent
@@ -2706,23 +2724,23 @@
                     set check_archs 0
                 }
                 lappend options subport $dep_portname
-                # Figure out the subport. Check the open_mports list first, since
+                # Figure out the depport. Check the open_mports list first, since
                 # we potentially leak mport references if we mportopen each time,
                 # because mportexec only closes each open mport once.
-                set subport [dlist_match_multi $macports::open_mports [list porturl $dep_portinfo(porturl) options $options variations $variations]]
+                set depport [dlist_match_multi $macports::open_mports [list porturl $dep_portinfo(porturl) options $options variations $variations]]
                 
-                if {$subport == {}} {
+                if {$depport == {}} {
                     # We haven't opened this one yet.
-                    set subport [mportopen $dep_portinfo(porturl) $options $variations]
+                    set depport [mportopen $dep_portinfo(porturl) $options $variations]
                 }
             }
 
             # check archs
             if {$parse && $check_archs
-                && ![macports::_mport_supports_archs $subport $required_archs]} {
+                && ![macports::_mport_supports_archs $depport $required_archs]} {
 
-                set supported_archs [_mportkey $subport supported_archs]
-                mportclose $subport
+                set supported_archs [_mportkey $depport supported_archs]
+                mportclose $depport
                 set arch_mismatch 1
                 set has_universal 0
                 if {[info exists dep_portinfo(variants)] && [lsearch -exact $dep_portinfo(variants) universal] != -1} {
@@ -2733,8 +2751,8 @@
                     if {![info exists variation_array(universal)] || $variation_array(universal) != "+"} {
                         set variation_array(universal) +
                         # try again with +universal
-                        set subport [mportopen $dep_portinfo(porturl) $options [array get variation_array]]
-                        if {[macports::_mport_supports_archs $subport $required_archs]} {
+                        set depport [mportopen $dep_portinfo(porturl) $options [array get variation_array]]
+                        if {[macports::_mport_supports_archs $depport $required_archs]} {
                             set arch_mismatch 0
                         }
                     }
@@ -2748,24 +2766,24 @@
             if {$parse} {
                 if {$recurseDeps} {
                     # Add to the list we need to recurse on.
-                    lappend subPorts $subport
+                    lappend depPorts $depport
                 }
-    
+
                 # Append the sub-port's provides to the port's requirements list.
-                set subport_provides "[ditem_key $subport provides]"
-                ditem_append_unique $mport requires $subport_provides
-                set depspec_seen($seenkey) $subport_provides
+                set depport_provides "[ditem_key $depport provides]"
+                ditem_append_unique $mport requires $depport_provides
+                set depspec_seen($seenkey) $depport_provides
             } else {
                 set depspec_seen($seenkey) 0
             }
         }
     }
 
-    # Loop on the subports.
+    # Loop on the depports.
     if {$recurseDeps} {
-        foreach subport $subPorts {
+        foreach depport $depPorts {
             # Sub ports should be installed (all dependencies must be satisfied).
-            set res [mportdepends $subport "" $recurseDeps $skipSatisfied 1]
+            set res [mportdepends $depport "" $recurseDeps $skipSatisfied 1]
             if {$res != 0} {
                 return $res
             }
@@ -3027,7 +3045,7 @@
     }
 
     # check if we we need to rebuild base
-    set comp [rpm-vercomp $macports_version_new $macports::autoconf::macports_version]
+    set comp [vercmp $macports_version_new $macports::autoconf::macports_version]
     if {$use_the_force_luke == "yes" || $comp > 0} {
         if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} {
             ui_msg "--->  MacPorts base is outdated, selfupdate would install $macports_version_new (dry run)"
@@ -3062,15 +3080,14 @@
                 ui_warn "Disabling readline support due to readline in /usr/local"
             }
 
-            if {$prefix == "/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
@@ -3251,9 +3268,9 @@
         set revision [lindex $i 2]
         set epoch [lindex $i 5]
         if { $version_installed == {} || ($epoch > $epoch_installed && $version != $version_installed) ||
-                ($epoch >= $epoch_installed && [rpm-vercomp $version $version_installed] > 0)
+                ($epoch >= $epoch_installed && [vercmp $version $version_installed] > 0)
                 || ($epoch >= $epoch_installed
-                    && [rpm-vercomp $version $version_installed] == 0
+                    && [vercmp $version $version_installed] == 0
                     && $revision > $revision_installed)} {
             set version_installed $version
             set revision_installed $revision
@@ -3385,9 +3402,9 @@
     set build_override 0
     set will_install yes
     # check installed version against version in ports
-    if { ( [rpm-vercomp $version_installed $version_in_tree] > 0
-            || ([rpm-vercomp $version_installed $version_in_tree] == 0
-                && [rpm-vercomp $revision_installed $revision_in_tree] >= 0 ))
+    if { ( [vercmp $version_installed $version_in_tree] > 0
+            || ([vercmp $version_installed $version_in_tree] == 0
+                && [vercmp $revision_installed $revision_in_tree] >= 0 ))
         && ![info exists options(ports_upgrade_force)] } {
         if {$portname != $newname} { 
             ui_debug "ignoring versions, installing replacement port"

Modified: branches/gsoc11-statistics/base/src/package1.0/portarchivefetch.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/package1.0/portarchivefetch.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/package1.0/portarchivefetch.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -66,6 +66,10 @@
 
 proc portarchivefetch::filter_sites {} {
     global prefix porturl
+    set mirrorfile [get_full_archive_sites_path]
+    if {[file exists $mirrorfile]} {
+        source $mirrorfile
+    }
     set ret {}
     foreach site [array names portfetch::mirror_sites::archive_prefix] {
         if {$portfetch::mirror_sites::archive_prefix($site) == $prefix} {
@@ -74,6 +78,7 @@
     }
     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]]]
+        archive.subdir
     }
     return $ret
 }
@@ -93,16 +98,10 @@
     # throws an error if unsupported
     archiveTypeIsSupported $portarchivetype
 
-    if {[file isfile ${archive.path}]} {
-        ui_debug "Found archive: ${archive.path}"
-        set all_archive_files {}
-        set fetch_urls {}
-    } else {
-        set archive.file [file tail ${archive.path}]
-        lappend all_archive_files ${archive.file}
-        if {[info exists archive_sites]} {
-            lappend fetch_urls archive_sites ${archive.file}
-        }
+    set archive.file [file tail ${archive.path}]
+    lappend all_archive_files ${archive.file}
+    if {[info exists archive_sites]} {
+        lappend fetch_urls archive_sites ${archive.file}
     }
 }
 

Modified: branches/gsoc11-statistics/base/src/package1.0/portdpkg.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/package1.0/portdpkg.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/package1.0/portdpkg.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -53,7 +53,7 @@
 set_ui_prefix
 
 proc portdpkg::main {args} {
-	global UI_PREFIX destpath os.arch os.platform
+	global UI_PREFIX destpath os.arch os.platform supported_archs configure.build_arch
     
 	ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option subport] [option version]]"
 
@@ -131,8 +131,9 @@
 	# sparc and sparc64. The operating system, os, is one of: linux, gnu,          
 	# freebsd and openbsd. Use of gnu in this string is reserved for the           
 	# GNU/Hurd operating system.
-	switch -regex ${os.arch} {
+	switch -regex ${configure.build_arch} {
 		i[3-9]86 { set pkg_arch "i386" }
+		x86_64 { set pkg_arch "x86_64" }
 		default { set pkg_arch ${os.arch} }
 	}
 
@@ -140,7 +141,14 @@
 	# the operating system name
 	if {${os.platform} != "linux"} {
 		set pkg_arch "${os.platform}-${pkg_arch}"
+	} elseif {${pkg_arch} == "x86_64"} {
+		set pkg_arch "amd64"
 	}
+	
+	# An architecture-independent package
+	if {$supported_archs == "noarch"} {
+		set pkg_arch "all"
+	}
 
 	puts $controlfd "Package: [option subport]"
 	puts $controlfd "Architecture: ${pkg_arch}"

Modified: branches/gsoc11-statistics/base/src/package1.0/portpkg.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/package1.0/portpkg.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/package1.0/portpkg.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -56,6 +56,10 @@
 
     ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${subport} ${version}]"
 
+    if {[getuid] == 0 && [geteuid] != 0} {
+        elevateToRoot "pkg"
+    }
+
     return [package_pkg $subport $version $revision]
 }
 

Modified: branches/gsoc11-statistics/base/src/pextlib1.0/Makefile
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/Makefile	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/Makefile	2011-08-22 02:01:16 UTC (rev 82923)
@@ -16,9 +16,10 @@
 .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}
+	${TCLSH} tests/vercomp.tcl ./${SHLIB_NAME}

Modified: branches/gsoc11-statistics/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/Pextlib.c	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/Pextlib.c	2011-08-22 02:01:16 UTC (rev 82923)
@@ -399,6 +399,7 @@
 #ifndef __APPLE__
         /* Crashes on Linux without this. */
         setenv("MACPORTS_DUMMY", "", 0);
+        unsetenv("MACPORTS_DUMMY");
 #endif
     } else {
         (void) unsetenv(name);
@@ -483,7 +484,11 @@
 	Tcl_CreateObjCommand(interp, "xinstall", InstallCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "fs-traverse", FsTraverseCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "filemap", FilemapCmd, NULL, NULL);
-	Tcl_CreateObjCommand(interp, "rpm-vercomp", RPMVercompCmd, NULL, NULL);
+#if 1
+	/* the name "rpm-vercomp" is deprecated, use "vercmp" instead */
+	Tcl_CreateObjCommand(interp, "rpm-vercomp", VercompCmd, NULL, NULL);
+#endif
+	Tcl_CreateObjCommand(interp, "vercmp", VercompCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "rmd160", RMD160Cmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "sha256", SHA256Cmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "base32encode", Base32EncodeCmd, NULL, NULL);

Modified: branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.c
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.c	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.c	2011-08-22 02:01:16 UTC (rev 82923)
@@ -146,6 +146,8 @@
             xpath = ".";
         } else if (*(xpath + tlen) == '/') {
             xpath += tlen + 1;
+        } else if (*(target + tlen - 1) == '/') {
+            xpath += tlen;
         }
     }
 


Property changes on: branches/gsoc11-statistics/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
/trunk/base/src/pextlib1.0/sha2.c:78736-79671
/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:78736-82922
/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-statistics/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
/trunk/base/src/pextlib1.0/sha2.h:78736-79671
/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:78736-82922
/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.h:45682-46060
/users/perry/base-select/src/pextlib1.0/sha2.h:44044-44692


Property changes on: branches/gsoc11-statistics/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
/trunk/base/src/pextlib1.0/sha256cmd.c:78736-79671
/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:78736-82922
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.c:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.c:44044-44692


Property changes on: branches/gsoc11-statistics/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
/trunk/base/src/pextlib1.0/sha256cmd.h:78736-79671
/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:78736-82922
/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-statistics/base/src/pextlib1.0/tests/curl.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/tests/curl.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/tests/curl.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -24,8 +24,8 @@
 	test {![curl isnewer $dummyroot/dummy [clock scan 2007-06-17Z]]}
 	
 	# use --disable-epsv
-	curl fetch --disable-epsv ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/archive/netperf-2.2pl5.tar.gz $tempfile
-	test {[md5 file $tempfile] == "a4b0f4a5fbd8bec23002ad8023e01729"}
+	#curl fetch --disable-epsv ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/archive/netperf-2.2pl5.tar.gz $tempfile
+	#test {[md5 file $tempfile] == "a4b0f4a5fbd8bec23002ad8023e01729"}
 	
 	# use -u
 	# This URL does not work anymore, disabled the test

Copied: branches/gsoc11-statistics/base/src/pextlib1.0/tests/vercomp.tcl (from rev 82922, trunk/base/src/pextlib1.0/tests/vercomp.tcl)
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/tests/vercomp.tcl	                        (rev 0)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/tests/vercomp.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -0,0 +1,47 @@
+# Test file for Pextlib's vercmp command.
+# Syntax:
+# tclsh vercomp.tcl <Pextlib name>
+
+proc main {pextlibname} {
+	load $pextlibname
+	
+	# 2.0 > 1.0
+	if {[vercmp 2.0 1.0] <= 0} {
+		puts {[vercmp 2.0 1.0] <= 0}
+		exit 1
+	}
+	# 1.0 = 1.0
+	if {[vercmp 1.0 1.0] != 0} {
+		puts {[vercmp 1.0 1.0] != 0}
+		exit 1
+	}
+	# 1.0 < 2.0
+	if {[vercmp 1.0 2.0] >= 0} {
+		puts {[vercmp 1.0 2.0] >= 0}
+		exit 1
+	}
+
+	# def > abc
+	if {[vercmp def abc] <= 0} {
+		puts {[vercmp def abc] <= 0}
+		exit 1
+	}
+	# abc = abc
+	if {[vercmp abc abc] != 0} {
+		puts {[vercmp abc abc] != 0}
+		exit 1
+	}
+	# abc < def
+	if {[vercmp abc def] >= 0} {
+		puts {[vercmp abc def] >= 0}
+		exit 1
+	}
+
+	# a < 1 (digits beats alpha)
+	if {[vercmp a 1] >= 0} {
+		puts {[vercmp a 1] >= 0}
+		exit 1
+	}
+}
+
+main $argv

Modified: branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.c
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.c	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.c	2011-08-22 02:01:16 UTC (rev 82923)
@@ -1,7 +1,7 @@
 /*
  * vercomp.c
  * $Id$
- * RPM compatible version comparison
+ * version comparison
  *
  * Author: Landon Fuller <landonf at macports.org>
  *
@@ -48,10 +48,10 @@
 /*
  * If A is newer than B, return an integer > 0
  * If A and B are equal, return 0
- * If B is newer than A, retun an integer < 0
+ * If B is newer than A, return an integer < 0
  */
 
-static int rpm_vercomp (const char *versionA, const char *versionB) {
+static int vercmp (const char *versionA, const char *versionB) {
 	const char *ptrA, *ptrB;
 	const char *eptrA, *eptrB;
 
@@ -155,7 +155,7 @@
 		return -1;
 }
 
-int RPMVercompCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+int VercompCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	Tcl_Obj *tcl_result;
 	const char *versionA, *versionB;
@@ -169,7 +169,7 @@
 	versionA = Tcl_GetString(objv[1]);
 	versionB = Tcl_GetString(objv[2]);
 
-	rval = rpm_vercomp(versionA, versionB);
+	rval = vercmp(versionA, versionB);
 
 	tcl_result = Tcl_NewIntObj(rval);
 	Tcl_SetObjResult(interp, tcl_result);

Modified: branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.h
===================================================================
--- branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.h	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.h	2011-08-22 02:01:16 UTC (rev 82923)
@@ -32,4 +32,4 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-int RPMVercompCmd(ClientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+int VercompCmd(ClientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);

Modified: branches/gsoc11-statistics/base/src/port/port.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port/port.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port/port.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -236,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
@@ -480,9 +482,9 @@
     }
     set avr_ [split $a_(version) "_"]
     set bvr_ [split $b_(version) "_"]
-    set vercmp [rpm-vercomp [lindex $avr_ 0] [lindex $bvr_ 0]]
-    if {$vercmp != 0} {
-        return $vercmp
+    set versioncmp [vercmp [lindex $avr_ 0] [lindex $bvr_ 0]]
+    if {$versioncmp != 0} {
+        return $versioncmp
     }
     set ar_ [lindex $avr_ 1]
     set br_ [lindex $bvr_ 1]
@@ -853,7 +855,7 @@
             if {$installed_version != $latest_version} {
                 set comp_result [expr $installed_epoch - $latest_epoch]
                 if { $comp_result == 0 } {
-                    set comp_result [rpm-vercomp $installed_version $latest_version]
+                    set comp_result [vercmp $installed_version $latest_version]
                 }
             }
             if { $comp_result == 0 } {
@@ -1280,6 +1282,7 @@
         ^depends_run:       -
         ^depends_extract:   -
         ^depends_fetch:     -
+        ^replaced_by:       -
         ^revision:          -
         ^license:           { # Handle special port selectors
             advance
@@ -2090,7 +2093,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"
@@ -3269,7 +3272,7 @@
             
             # Compare versions, first checking epoch, then version, then revision
             set epoch_comp_result [expr $installed_epoch - $latest_epoch]
-            set comp_result [rpm-vercomp $installed_version $latest_version]
+            set comp_result [vercmp $installed_version $latest_version]
             if { $comp_result == 0 } {
                 set comp_result [expr $installed_revision - $latest_revision]
             }
@@ -3491,6 +3494,7 @@
             ui_notice "$portname has the variants:"
             foreach v [lsort $portinfo(variants)] {
                 unset -nocomplain vconflicts vdescription vrequires
+                set varmodifier "   "
                 # Retrieve variants' information from the new format.
                 if {[info exists vinfo]} {
                     array unset variant
@@ -3512,9 +3516,7 @@
                         # selected by variants.conf, prefixed with (+)/(-)
                         set varmodifier "($global_variations($v))"
                     } elseif {[info exists variant(is_default)]} {
-                        set varmodifier "\[+]"
-                    } else {
-                        set varmodifier "   "
+                        set varmodifier "\[$variant(is_default)\]"
                     }
                     if {[info exists variant(requires)]} {
                         set vrequires $variant(requires)
@@ -4252,7 +4254,7 @@
                  depends description epoch fullname heading homepage index license
                  line long_description
                  maintainer maintainers name platform platforms portdir pretty
-                 replaced_by revision variant variants version}
+                 replaced_by revision subports variant variants version}
     contents    {size {units 1}}
     deps        {index no-build}
     rdeps       {index no-build full}
@@ -4348,7 +4350,7 @@
                         foreach e $kopts {
                             lappend errlst "--[lindex $e 0]"
                         }
-                        return -code error "${action} --${key} is ambiguous: \n  [join $errlst "\n  "]"
+                        return -code error "\"port ${action} --${key}\" is ambiguous: \n  port ${action} [join $errlst "\n  port ${action} "]"
                     }
                     set key   [lindex [lindex $kopts 0] 0]
                     set kargc [lindex [lindex $kopts 0] 1]
@@ -4505,9 +4507,9 @@
             set action_proc [get_action_proc $action]
         } else {
             if {[llength $actions] > 1} {
-                puts "Ambiguous action \"$action\": could be any of {$actions}."
+                ui_error "\"port ${action}\" is ambiguous: \n  port [join $actions "\n  port "]"
             } else {
-                puts "Unrecognized action \"$action\""
+                ui_error "Unrecognized action \"port $action\""
             }
             set action_status 1
             break
@@ -4865,6 +4867,9 @@
 if { ($exit_status == 0 || [macports::ui_isset ports_processall]) && [info exists ui_options(ports_commandfiles)] } {
     set exit_status [process_command_files $ui_options(ports_commandfiles)]
 }
+if {$exit_status == -999} {
+    set exit_status 0
+}
 
 # shut down macports1.0
 mportshutdown

Modified: branches/gsoc11-statistics/base/src/port/portindex.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port/portindex.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port/portindex.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -146,6 +146,7 @@
                 incr stats(failed)
             } else {
                 set prefix $save_prefix
+                array unset portinfo
                 array set portinfo [mportinfo $interp]
                 mportclose $interp
                 set portinfo(portdir) $portdir

Modified: branches/gsoc11-statistics/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/port_autoconf.tcl.in	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/port_autoconf.tcl.in	2011-08-22 02:01:16 UTC (rev 82923)
@@ -33,6 +33,8 @@
 
 namespace eval portutil::autoconf {
 	variable bzip2_path "@BZIP2@"
+	variable lzma_path "@LZMA@"
+	variable xz_path "@XZ@"
 	variable cp_path "@CP@"
 	variable cpio_path "@CPIO@"
 	variable diff_path "@DIFF@"

Modified: branches/gsoc11-statistics/base/src/port1.0/portclean.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portclean.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portclean.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -55,7 +55,7 @@
 
     ui_notice "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option subport]]"
 
-    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
+    if {[getuid] == 0 && [geteuid] != 0} {
         elevateToRoot "clean"
     }
 }

Modified: branches/gsoc11-statistics/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portconfigure.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portconfigure.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -194,6 +194,7 @@
 
     set name ""
     switch -exact ${configure.compiler} {
+        cc { set name "System cc" }
         gcc { set name "System gcc" }
         gcc-3.3 { set name "Mac OS X gcc 3.3" }
         gcc-4.0 { set name "Mac OS X gcc 4.0" }
@@ -352,13 +353,17 @@
 
 # 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 cc
+    } elseif {[vercmp $xcodeversion 4.2] >= 0} {
+        return clang
+    } elseif {[vercmp $xcodeversion 4.0] >= 0} {
+        return llvm-gcc-4.2
+    } elseif {[vercmp $xcodeversion 3.2] >= 0 && $macosx_deployment_target != "10.4"} {
+        return gcc-4.2
+    } else {
+        return gcc-4.0
     }
 }
 
@@ -367,6 +372,14 @@
     global configure.compiler prefix developer_dir
     set ret ""
     switch -exact ${configure.compiler} {
+        cc {
+            switch -exact ${type} {
+                cc   { set ret /usr/bin/cc }
+                objc { set ret /usr/bin/cc }
+                cxx  { set ret /usr/bin/c++ }
+                cpp  { set ret /usr/bin/cpp }
+            }
+        }
         gcc {
             switch -exact ${type} {
                 cc   { set ret /usr/bin/gcc }
@@ -438,6 +451,7 @@
                 cc   { set ret ${prefix}/bin/gcc-apple-4.2 }
                 objc { set ret ${prefix}/bin/gcc-apple-4.2 }
                 cpp  { set ret ${prefix}/bin/cpp-apple-4.2 }
+                cxx  { set ret ${prefix}/bin/g++-apple-4.2 }
             }
         }
         macports-gcc-4.0 {

Modified: branches/gsoc11-statistics/base/src/port1.0/portdistcheck.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portdistcheck.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portdistcheck.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -47,15 +47,11 @@
 }
 
 # define options
-options distcheck.type distcheck.check
+options distcheck.type
 
 # defaults
 default distcheck.type moddate
-default distcheck.check moddate
 
-# Deprecation
-option_deprecate distcheck.check distcheck.type
-
 proc portdistcheck::distcheck_main {args} {
     global distcheck.type
     global fetch.type

Modified: branches/gsoc11-statistics/base/src/port1.0/portextract.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portextract.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portextract.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -92,9 +92,9 @@
     if {[tbool use_bzip2]} {
         option extract.cmd [findBinary bzip2 ${portutil::autoconf::bzip2_path}]
     } elseif {[tbool use_lzma]} {
-        option extract.cmd [binaryInPath "lzma"]
+        option extract.cmd [findBinary lzma ${portutil::autoconf::lzma_path}]
     } elseif {[tbool use_xz]} {
-        option extract.cmd [binaryInPath "xz"]
+        option extract.cmd [findBinary xz ${portutil::autoconf::xz_path}]
     } elseif {[tbool use_zip]} {
         option extract.cmd [findBinary unzip ${portutil::autoconf::unzip_path}]
         option extract.pre_args -q

Modified: branches/gsoc11-statistics/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portfetch.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portfetch.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -122,9 +122,6 @@
 default mirror_sites.listfile {"mirror_sites.tcl"}
 default mirror_sites.listpath {"port1.0/fetch"}
 
-# Deprecation
-option_deprecate svn.tag svn.revision
-
 # Option-executed procedures
 option_proc use_bzip2 portfetch::set_extract_type
 option_proc use_lzma  portfetch::set_extract_type

Modified: branches/gsoc11-statistics/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portlivecheck.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portlivecheck.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -47,11 +47,10 @@
 }
 
 # define options
-options livecheck.url livecheck.type livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version livecheck.ignore_sslcert
+options livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version livecheck.ignore_sslcert
 
 # defaults
 default livecheck.url {$homepage}
-default livecheck.check default
 default livecheck.type default
 default livecheck.md5 ""
 default livecheck.regex ""
@@ -60,9 +59,6 @@
 default livecheck.version {$version}
 default livecheck.ignore_sslcert yes
 
-# Deprecation
-option_deprecate livecheck.check livecheck.type
-
 proc portlivecheck::livecheck_main {args} {
     global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     global livecheck.ignore_sslcert
@@ -101,6 +97,14 @@
         if {$has_master_sites} {
             foreach {master_site} ${master_sites} {
                 if {[regexp "^($available_types)(?::(\[^:\]+))?" ${master_site} _ site subdir]} {
+                    set subdirs [split $subdir /]
+                    if {[llength $subdirs] > 1} {
+                        if {[lindex $subdirs 0] == "project"} {
+                            set subdir [lindex $subdirs 1]
+                        } else {
+                            set subdir ""
+                        }
+                    }
                     if {${subdir} ne "" && ${livecheck.name} eq "default"} {
                         set livecheck.name ${subdir}
                     }
@@ -167,7 +171,7 @@
                     while {[gets $chan line] >= 0} {
                         if {[regexp $the_re $line matched upver]} {
                             set foundmatch 1
-                            if {$updated_version == 0 || [rpm-vercomp $upver $updated_version] > 0} {
+                            if {$updated_version == 0 || [vercmp $upver $updated_version] > 0} {
                                 set updated_version $upver
                             }
                             ui_debug "The regex matched \"$matched\", extracted \"$upver\""

Modified: branches/gsoc11-statistics/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/port1.0/portutil.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/port1.0/portutil.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -132,11 +132,11 @@
 }
 
 ##
-# Handle option-replace
+# Handle option-strsed
 #
 # @param option name of the option
 # @param args arguments
-proc handle_option-replace {option args} {
+proc handle_option-strsed {option args} {
     global $option user_options option_procs
 
     if {![info exists user_options($option)] && [info exists $option]} {
@@ -148,6 +148,36 @@
     }
 }
 
+##
+# Handle option-replace
+#
+# @param option name of the option
+# @param args arguments
+proc handle_option-replace {option args} {
+    global $option user_options option_procs deprecated_options
+
+    # Deprecate -replace with only one argument, for backwards compatibility call -strsed
+    # XXX: Remove this in 2.2.0
+    if {[llength $args] == 1} {
+        if {![info exists deprecated_options(${option}-replace)]} {
+            set deprecated_options(${option}-replace) [list ${option}-strsed 0]
+        }
+        set refcount [lindex $deprecated_options(${option}-replace) 1]
+        lset deprecated_options(${option}-replace) 1 [expr $refcount + 1]
+        return [eval handle_option-strsed $option $args]
+    }
+
+    if {![info exists user_options($option)] && [info exists $option]} {
+        foreach {old new} $args {
+            set index [lsearch -exact [set $option] $old]
+            if {$index == -1} {
+                continue
+            }
+            set $option [lreplace [set $option] $index $index $new]
+        }
+    }
+}
+
 # options
 # Exports options in an array as externally callable procedures
 # Thus, "options name date" would create procedures named "name"
@@ -160,6 +190,7 @@
         interp alias {} $option {} handle_option $option
         interp alias {} $option-append {} handle_option-append $option
         interp alias {} $option-delete {} handle_option-delete $option
+        interp alias {} $option-strsed {} handle_option-strsed $option
         interp alias {} $option-replace {} handle_option-replace $option
     }
 }
@@ -2020,20 +2051,18 @@
             array set vinfo $PortInfo(vinfo)
 
             foreach v $value {
-                if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant]} {
+                if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant] && ![info exists variations($variant)]} {
                     # Retrieve the information associated with this variant.
                     if {![info exists vinfo($variant)]} {
                         set vinfo($variant) {}
                     }
+                    array unset info
                     array set info $vinfo($variant)
+                    # Set is_default and update vinfo.
+                    set info(is_default) $val
+                    array set vinfo [list $variant [array get info]]
 
-                    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]]
-
-                        set variations($variant) $val
-                    }
+                    set variations($variant) $val
                 }
             }
             # Update PortInfo(vinfo).
@@ -2077,14 +2106,15 @@
         return
     } elseif {[geteuid] != 0} {
         seteuid 0; setegid 0
+        set escalated 1
     }
 
     set passwd {*}
     set uid [nextuid]
     set gid [existsgroup nogroup]
     set realname ${name}
-    set home /dev/null
-    set shell /dev/null
+    set home /var/empty
+    set shell /usr/bin/false
 
     foreach arg $args {
         if {[regexp {([a-z]*)=(.*)} $arg match key val]} {
@@ -2098,10 +2128,20 @@
 
     if {${os.platform} eq "darwin"} {
         set dscl [findBinary dscl $portutil::autoconf::dscl_path]
+        exec $dscl . -create /Users/${name} UniqueID ${uid}
+
+        # These are implicitly added on Mac OSX Lion.  AuthenticationAuthority
+        # causes the user to be visible in the Users & Groups Preference Pane,
+        # and the others are just noise, so delete them.
+        # https://trac.macports.org/ticket/30168
+        exec $dscl . -delete /Users/${name} AuthenticationAuthority
+        exec $dscl . -delete /Users/${name} PasswordPolicyOptions
+        exec $dscl . -delete /Users/${name} dsAttrTypeNative:KerberosKeys
+        exec $dscl . -delete /Users/${name} dsAttrTypeNative:ShadowHashData
+
+        exec $dscl . -create /Users/${name} RealName ${realname}
         exec $dscl . -create /Users/${name} Password ${passwd}
-        exec $dscl . -create /Users/${name} UniqueID ${uid}
         exec $dscl . -create /Users/${name} PrimaryGroupID ${gid}
-        exec $dscl . -create /Users/${name} RealName ${realname}
         exec $dscl . -create /Users/${name} NFSHomeDirectory ${home}
         exec $dscl . -create /Users/${name} UserShell ${shell}
     } else {
@@ -2109,6 +2149,10 @@
         ui_warn "adduser is not implemented on ${os.platform}."
         ui_warn "The requested user '$name' was not created."
     }
+
+    if {[info exists escalated]} {
+        dropPrivileges
+    }
 }
 
 proc addgroup {name args} {
@@ -2120,6 +2164,7 @@
         return
     } elseif {[geteuid] != 0} {
         seteuid 0; setegid 0
+        set escalated 1
     }
 
     set gid [nextgid]
@@ -2150,6 +2195,10 @@
         ui_warn "addgroup is not implemented on ${os.platform}."
         ui_warn "The requested group was not created."
     }
+
+    if {[info exists escalated]} {
+        dropPrivileges
+    }
 }
 
 # proc to calculate size of a directory
@@ -2508,6 +2557,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
@@ -2635,6 +2693,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
@@ -2670,18 +2740,23 @@
                 set ok 3.1
                 set rec 3.1.4
             }
-            default {
+            10.6 {
                 set min 3.2
                 set ok 3.2
                 set rec 3.2.6
             }
+            default {
+                set min 4.1
+                set ok 4.1
+                set rec 4.1
+            }
         }
         if {$xcodeversion == "none"} {
             ui_warn "Xcode does not appear to be installed; most ports will likely fail to build."
-        } elseif {[rpm-vercomp $xcodeversion $min] < 0} {
+        } elseif {[vercmp $xcodeversion $min] < 0} {
             ui_error "The installed version of Xcode (${xcodeversion}) is too old to use on the installed OS version. Version $rec or later is recommended on Mac OS X ${macosx_version}."
             return 1
-        } elseif {[rpm-vercomp $xcodeversion $ok] < 0} {
+        } elseif {[vercmp $xcodeversion $ok] < 0} {
             ui_warn "The installed version of Xcode (${xcodeversion}) is known to cause problems. Version $rec or later is recommended on Mac OS X ${macosx_version}."
         }
     }

Modified: branches/gsoc11-statistics/base/src/programs/daemondo/Makefile.in
===================================================================
--- branches/gsoc11-statistics/base/src/programs/daemondo/Makefile.in	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/programs/daemondo/Makefile.in	2011-08-22 02:01:16 UTC (rev 82923)
@@ -8,7 +8,7 @@
 mandir=		@mandir@
 mandircat8=	${mandir}/cat8
 
-CFLAGS_QUICHEEATERS	= -W -Wall
+CFLAGS_PEDANTIC	=
 CPPFLAGS	+= -I../..
 SRCS		= main.c
 OBJS		= main.o

Modified: branches/gsoc11-statistics/base/src/registry2.0/Makefile
===================================================================
--- branches/gsoc11-statistics/base/src/registry2.0/Makefile	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/registry2.0/Makefile	2011-08-22 02:01:16 UTC (rev 82923)
@@ -20,8 +20,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-statistics/base/src/registry2.0/portimage.tcl
===================================================================
--- branches/gsoc11-statistics/base/src/registry2.0/portimage.tcl	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/src/registry2.0/portimage.tcl	2011-08-22 02:01:16 UTC (rev 82923)
@@ -249,7 +249,17 @@
 ## @param [in] dstfile path to activate file to
 ## @return 1 if file needs to be explicitly deleted if we have to roll back, 0 otherwise
 proc _activate_file {srcfile dstfile} {
-    switch [file type $srcfile] {
+    if {[catch {set filetype [file type $srcfile]} result]} {
+        # this can happen if the archive was built on case-sensitive and we're case-insensitive
+        # we know any existing dstfile is ours because we checked for conflicts earlier
+        if {![catch {file type $dstfile}]} {
+            ui_debug "skipping case-conflicting file: $srcfile"
+            return 0
+        } else {
+            error $result
+        }
+    }
+    switch $filetype {
         directory {
             # Don't recursively copy directories
             ui_debug "activating directory: $dstfile"
@@ -279,10 +289,11 @@
 # extract an archive to a temporary location
 # returns: path to the extracted directory
 proc extract_archive_to_tmpdir {location} {
-    set extractdir [mkdtemp [file join [macports::gettmpdir] mpextractXXXXXXXX]]
+    global macports::registry.path
+    set extractdir [mkdtemp [file dirname $location]/mpextractXXXXXXXX]
+    set startpwd [pwd]
 
     try {
-        set startpwd [pwd]
         if {[catch {cd $extractdir} err]} {
             throw MACPORTS $err
         }
@@ -294,7 +305,7 @@
         set unarchive.pre_args {}
         set unarchive.args {}
         set unarchive.pipe_cmd ""
-        set unarchive.type [file tail $location]
+        set unarchive.type [file extension $location]
         switch -regex ${unarchive.type} {
             cp(io|gz) {
                 set pax "pax"
@@ -463,7 +474,7 @@
                         # 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] } {
+                        if { ![catch {file type $file}] } {
                             set bakfile "${file}${baksuffix}"
                             ui_warn "File $file already exists.  Moving to: $bakfile."
                             file rename -force -- $file $bakfile


Property changes on: branches/gsoc11-statistics/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
/trunk/base/src/registry2.0/receipt_sqlite.tcl:78736-79671
/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:78736-82922
/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-statistics/base/tests/test/xcodeversion/Portfile
===================================================================
--- branches/gsoc11-statistics/base/tests/test/xcodeversion/Portfile	2011-08-22 01:49:40 UTC (rev 82922)
+++ branches/gsoc11-statistics/base/tests/test/xcodeversion/Portfile	2011-08-22 02:01:16 UTC (rev 82923)
@@ -19,6 +19,8 @@
 }
 
 test {
+	# rpm-vercomp is now deprecated, change it here too when removed
+	# from all ports and base (but keep this test here, meanwhile...)
 	if {$xcodeversion != "" && [rpm-vercomp $xcodeversion 2.1] >= 0} {
 		ui_msg "xcodeversion >= 2.1"
 	} else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110821/f0e340e8/attachment-0001.html>


More information about the macports-changes mailing list