[69682] branches/gsoc10-configfiles/base

and.damore at macports.org and.damore at macports.org
Tue Jul 13 07:41:57 PDT 2010


Revision: 69682
          http://trac.macports.org/changeset/69682
Author:   and.damore at macports.org
Date:     2010-07-13 07:41:56 -0700 (Tue, 13 Jul 2010)
Log Message:
-----------
Merged from trunk, this commit message appears courtesy of Raim

Modified Paths:
--------------
    branches/gsoc10-configfiles/base/ChangeLog
    branches/gsoc10-configfiles/base/Makefile.in
    branches/gsoc10-configfiles/base/NEWS
    branches/gsoc10-configfiles/base/config/RELEASE_URL
    branches/gsoc10-configfiles/base/configure
    branches/gsoc10-configfiles/base/configure.ac
    branches/gsoc10-configfiles/base/doc/Makefile
    branches/gsoc10-configfiles/base/doc/macports.conf.5
    branches/gsoc10-configfiles/base/portmgr/ReleaseProcess
    branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck
    branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck.strings
    branches/gsoc10-configfiles/base/portmgr/dmg/postflight
    branches/gsoc10-configfiles/base/portmgr/jobs/README
    branches/gsoc10-configfiles/base/portmgr/jobs/mprsyncup
    branches/gsoc10-configfiles/base/portmgr/packaging/dpkgall.tcl
    branches/gsoc10-configfiles/base/portmgr/packaging/rpmall.tcl
    branches/gsoc10-configfiles/base/src/cregistry/entry.c
    branches/gsoc10-configfiles/base/src/cregistry/registry.c
    branches/gsoc10-configfiles/base/src/cregistry/sql.c
    branches/gsoc10-configfiles/base/src/macports1.0/macports.tcl
    branches/gsoc10-configfiles/base/src/package1.0/portarchive.tcl
    branches/gsoc10-configfiles/base/src/package1.0/portarchivefetch.tcl
    branches/gsoc10-configfiles/base/src/package1.0/portunarchive.tcl
    branches/gsoc10-configfiles/base/src/pextlib1.0/Pextlib.c
    branches/gsoc10-configfiles/base/src/pextlib1.0/curl.c
    branches/gsoc10-configfiles/base/src/pextlib1.0/strsed.c
    branches/gsoc10-configfiles/base/src/pextlib1.0/xinstall.c
    branches/gsoc10-configfiles/base/src/port/port.tcl
    branches/gsoc10-configfiles/base/src/port/portindex.tcl
    branches/gsoc10-configfiles/base/src/port1.0/fetch_common.tcl
    branches/gsoc10-configfiles/base/src/port1.0/port_autoconf.tcl.in
    branches/gsoc10-configfiles/base/src/port1.0/portactivate.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portchecksum.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portclean.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portconfigure.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portdeactivate.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portdistfiles.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portextract.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portfetch.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portinstall.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portpatch.tcl
    branches/gsoc10-configfiles/base/src/port1.0/porttrace.tcl
    branches/gsoc10-configfiles/base/src/port1.0/portutil.tcl
    branches/gsoc10-configfiles/base/src/registry2.0/portimage.tcl
    branches/gsoc10-configfiles/base/src/registry2.0/portuninstall.tcl

Added Paths:
-----------
    branches/gsoc10-configfiles/base/doc/pubkeys.conf.in
    branches/gsoc10-configfiles/base/macports-pubkey.pem

Removed Paths:
-------------
    branches/gsoc10-configfiles/base/portmgr/jobs/PortIndexRegen.sh
    branches/gsoc10-configfiles/base/portmgr/jobs/org.macports.PortIndexRegen.plist

Property Changed:
----------------
    branches/gsoc10-configfiles/base/
    branches/gsoc10-configfiles/base/doc/


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

Modified: branches/gsoc10-configfiles/base/ChangeLog
===================================================================
--- branches/gsoc10-configfiles/base/ChangeLog	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/ChangeLog	2010-07-13 14:41:56 UTC (rev 69682)
@@ -2,9 +2,40 @@
 # This is a log of major user-visible changes in each MacPorts release.
 # $Id$
 ###
+Release 1.9.2 (future):
+    - Fixed sha256 checksum (snc in r68955)
 
-Release 1.9.0 (unreleased):
+    - Fixed premature privilege dropping (jmr in r68952)
 
+
+Release 1.9.1 (2010-06-18):
+    - Fixed a couple of problems with new 1.9 features when using the flat
+      registry format (jmr in r68910, r68913)
+
+    - Ports using the replaced_by option will once again be deactivated when
+      an upgrade is performed on them (#25270, jmr in r68872)
+
+    - Fixed the possibility of some empty directories being left behind when
+      a port is deactivated (#25268, jmr in r68864)
+
+    - Fixed failure to detect conflicts with files that are not provided by
+      a port before activation starts (#25255, jmr in r68849)
+
+    - Fixed problems with distfile names containing spaces (#25245, #25246;
+      jmr in r68816, r68817)
+
+    - Fixed a problem with uninstall when using direct mode, and started
+      running pre/post activate and deactivate procedures when installing and
+      uninstalling in direct mode, respectively (#11562, jmr in r68697)
+
+    - fixed a crasher that affected Tiger (#25194, jmr in r68675, r68680,
+      r68691)
+
+Release 1.9.0 (2010-06-08 by jmr):
+
+    - It is no longer possible to use include statements in Portfiles
+      (raimue in r68206)
+
     - Command line options can be abbreviated if unambiguous
       (raimue in r66837)
 

Modified: branches/gsoc10-configfiles/base/Makefile.in
===================================================================
--- branches/gsoc10-configfiles/base/Makefile.in	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/Makefile.in	2010-07-13 14:41:56 UTC (rev 69682)
@@ -34,6 +34,7 @@
 install::
 	[ ! -f $(DESTDIR)${sysconfdir}/macports/mp_version ] || rm -vf $(DESTDIR)${sysconfdir}/macports/mp_version
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 setupenv.bash  $(DESTDIR)${datadir}/macports/
+	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 macports-pubkey.pem  $(DESTDIR)${datadir}/macports/
 # Only run these scripts when not building in a destroot
 ifeq ($(DESTDIR),)
 # Add [default] tag to the central MacPorts repository, if it isn't already

Modified: branches/gsoc10-configfiles/base/NEWS
===================================================================
--- branches/gsoc10-configfiles/base/NEWS	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/NEWS	2010-07-13 14:41:56 UTC (rev 69682)
@@ -5,7 +5,7 @@
 *) All output is now logged to a file, whose location will be shown if a port
    target fails. This should be attached to bug reports. The new 'log' action
    can also be used to view the log for a port.
-*) Command line options can be abbreviated if unambigious.
+*) Command line options can be abbreviated if unambiguous.
 *) New actions: rdeps, rdependents, setrequested, unsetrequested
 *) --follow-dependencies option for uninstall (ports with the requested flag
    set or with other dependents are skipped).

Modified: branches/gsoc10-configfiles/base/config/RELEASE_URL
===================================================================
--- branches/gsoc10-configfiles/base/config/RELEASE_URL	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/config/RELEASE_URL	2010-07-13 14:41:56 UTC (rev 69682)
@@ -1 +1 @@
-http://svn.macports.org/repository/macports/tags/release_1_8_2/base
+http://svn.macports.org/repository/macports/tags/release_1_9_1/base

Modified: branches/gsoc10-configfiles/base/configure
===================================================================
--- branches/gsoc10-configfiles/base/configure	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/configure	2010-07-13 14:41:56 UTC (rev 69682)
@@ -1,13 +1,13 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for MacPorts 1.9.99.
+# Generated by GNU Autoconf 2.66 for MacPorts 1.9.99.
 #
 # Report bugs to <macports-dev at lists.macosforge.org>.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -319,7 +319,7 @@
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -359,19 +359,19 @@
 fi # as_fn_arith
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -533,7 +533,7 @@
 exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -688,6 +688,7 @@
 UNZIP
 TAR
 SED
+OPENSSL
 RSYNC
 RMDIR
 PATCH
@@ -816,6 +817,7 @@
 MTREE
 CVS
 SVN
+OPENSSL
 RSYNC
 SED
 TAR
@@ -936,7 +938,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -962,7 +964,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1166,7 +1168,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1182,7 +1184,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1212,8 +1214,8 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
@@ -1221,7 +1223,7 @@
     # Reject names that are not valid shell variable names.
     case $ac_envvar in #(
       '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
     esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
@@ -1239,13 +1241,13 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error "missing argument to $ac_option"
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1268,7 +1270,7 @@
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1282,8 +1284,8 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1298,9 +1300,9 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error "working directory cannot be determined"
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error "pwd does not report name of working directory"
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1339,11 +1341,11 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1383,7 +1385,7 @@
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1495,6 +1497,7 @@
   MTREE       path to mtree command
   CVS         path to cvs command
   SVN         path to svn command
+  OPENSSL     path to openssl command
   RSYNC       path to rsync command
   SED         path to sed command
   TAR         path to tar command
@@ -1575,9 +1578,9 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 MacPorts configure 1.9.99
-generated by GNU Autoconf 2.65
+generated by GNU Autoconf 2.66
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1755,10 +1758,10 @@
 ac_fn_objc_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  if eval "test \"\${$3+set}\"" = set; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1817,17 +1820,15 @@
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( cat <<\_ASBOX
-## ------------------------------------------------ ##
+( $as_echo "## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
-## ------------------------------------------------ ##
-_ASBOX
+## ------------------------------------------------ ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1891,7 +1892,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2046,10 +2047,10 @@
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  if eval "test \"\${$3+set}\"" = set; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -2108,17 +2109,15 @@
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( cat <<\_ASBOX
-## ------------------------------------------------ ##
+( $as_echo "## ------------------------------------------------ ##
 ## Report this to macports-dev at lists.macosforge.org ##
-## ------------------------------------------------ ##
-_ASBOX
+## ------------------------------------------------ ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -2139,7 +2138,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2198,15 +2197,18 @@
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_decl LINENO SYMBOL VAR
-# ------------------------------------
-# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
 ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2215,9 +2217,13 @@
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
 #endif
+#endif
 
   ;
   return 0;
@@ -2241,7 +2247,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by MacPorts $as_me 1.9.99, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+generated by GNU Autoconf 2.66.  Invocation command line was
 
   $ $0 $@
 
@@ -2351,11 +2357,9 @@
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2389,11 +2393,9 @@
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2406,11 +2408,9 @@
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -2424,11 +2424,9 @@
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -2483,7 +2481,12 @@
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -2498,7 +2501,11 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2574,7 +2581,7 @@
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
@@ -2593,16 +2600,22 @@
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  for ac_t in install-sh install.sh shtool; do
-    if test -f "$ac_dir/$ac_t"; then
-      ac_aux_dir=$ac_dir
-      ac_install_sh="$ac_aux_dir/$ac_t -c"
-      break 2
-    fi
-  done
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -2616,7 +2629,7 @@
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
@@ -2627,16 +2640,16 @@
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -2661,7 +2674,7 @@
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
@@ -2669,7 +2682,7 @@
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -2694,7 +2707,7 @@
   ac_cv_target=$ac_cv_host
 else
   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
-    as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
 fi
 
 fi
@@ -2702,7 +2715,7 @@
 $as_echo "$ac_cv_target" >&6; }
 case $ac_cv_target in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
 esac
 target=$ac_cv_target
 ac_save_IFS=$IFS; IFS='-'
@@ -2891,7 +2904,7 @@
 
 case "$MACOSX_VERSION" in
   10.0*|10.1*|10.2*|10.3*)
-    as_fn_error "This version of Mac OS X is not supported
+    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-1])
@@ -3251,8 +3264,8 @@
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3366,9 +3379,8 @@
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3410,8 +3422,8 @@
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3468,9 +3480,9 @@
     else
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
+as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3521,8 +3533,8 @@
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -4090,7 +4102,7 @@
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -4098,7 +4110,7 @@
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -4810,6 +4822,46 @@
 fi
 
 
+# Extract the first word of "openssl", so it can be a program name with args.
+set dummy openssl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_OPENSSL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OPENSSL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OPENSSL="$OPENSSL" # 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_OPENSSL="$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
+OPENSSL=$ac_cv_path_OPENSSL
+if test -n "$OPENSSL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL" >&5
+$as_echo "$OPENSSL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # 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
@@ -5607,6 +5659,7 @@
 
 
 
+
 	# 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
@@ -5649,7 +5702,7 @@
 
 
 	if test "x$SED" = "x"; then
-		as_fn_error "cannot find sed. Is sed installed?" "$LINENO" 5
+		as_fn_error $? "cannot find sed. Is sed installed?" "$LINENO" 5
 	fi
 
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which sed flag to use for extended regexp" >&5
@@ -6398,8 +6451,8 @@
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "Objective C preprocessor \"$OBJCPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "Objective C preprocessor \"$OBJCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=m
@@ -6460,7 +6513,7 @@
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
@@ -6526,7 +6579,7 @@
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -6658,8 +6711,7 @@
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_objc_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 "
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -6687,7 +6739,7 @@
 			no)
 				;;
 			*)
-				as_fn_error "${with_objc_runtime} is not a valid argument to --with-objc-runtime. Please specify either \"GNU\" or \"apple\"" "$LINENO" 5
+				as_fn_error $? "${with_objc_runtime} is not a valid argument to --with-objc-runtime. Please specify either \"GNU\" or \"apple\"" "$LINENO" 5
 				;;
 		esac
 	fi
@@ -6711,7 +6763,7 @@
 _ACEOF
 
 else
-  as_fn_error "Can't locate Objective C runtime headers" "$LINENO" 5
+  as_fn_error $? "Can't locate Objective C runtime headers" "$LINENO" 5
 fi
 
 done
@@ -6956,8 +7008,8 @@
 	else
 			{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "Could not locate a working Objective-C runtime.
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "Could not locate a working Objective-C runtime.
+See \`config.log' for more details" "$LINENO" 5; }
 	fi
 
 	# Restore LIBS & OBJCFLAGS
@@ -6999,7 +7051,7 @@
 			no)
 				;;
 			*)
-				as_fn_error "${with_objc_foundation} is not a valid argument to --with-objc-foundation. Please specify either \"GNU\" or \"apple\"" "$LINENO" 5
+				as_fn_error $? "${with_objc_foundation} is not a valid argument to --with-objc-foundation. Please specify either \"GNU\" or \"apple\"" "$LINENO" 5
 				;;
 		esac
 	fi
@@ -7080,7 +7132,7 @@
 		GNUSTEP_CONFIG=/usr/bin/gnustep-config
 		if test ! -x "${GNUSTEP_CONFIG}" -a x"${GNUSTEP_SYSTEM_ROOT}" == x; then
 			if test x"${with_objc_foundation}" == x"GNUstep"; then
-				as_fn_error "GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library" "$LINENO" 5
+				as_fn_error $? "GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library" "$LINENO" 5
 			else
 				{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library" >&5
 $as_echo "$as_me: WARNING: GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library" >&2;}
@@ -7186,7 +7238,7 @@
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: Not using Foundation implementation" >&5
 $as_echo "$as_me: Not using Foundation implementation" >&6;}
 	else
-		as_fn_error "Could not find a working Foundation implementation" "$LINENO" 5
+		as_fn_error $? "Could not find a working Foundation implementation" "$LINENO" 5
 	fi
 
 
@@ -7476,7 +7528,7 @@
 # Check for paths
 
 if test x$prefix = x/usr/local; then
-    as_fn_error "Installing MacPorts into /usr/local is not supported" "$LINENO" 5
+    as_fn_error $? "Installing MacPorts into /usr/local is not supported" "$LINENO" 5
 fi
 
 
@@ -7495,7 +7547,7 @@
  	  if test -d "$portsdir" -a -e "$portsdir/PortIndex" ; then
  		:
  	  else
- 		as_fn_error "$portsdir not a valid ports tree" "$LINENO" 5
+ 		as_fn_error $? "$portsdir not a valid ports tree" "$LINENO" 5
  	  fi
  	else
  		 		if test "x$PORTS_DIR_DEFAULT" != "x" ; then
@@ -7568,7 +7620,7 @@
 	    TCL_PACKAGE_DIR=${PACKAGE_DIR_NATIVE}
 
 		if test x"${ac_cv_c_tclpkgd}" = x ; then
-			as_fn_error "Tcl package directory not found.  Please specify its location with --with-tclpackage" "$LINENO" 5
+			as_fn_error $? "Tcl package directory not found.  Please specify its location with --with-tclpackage" "$LINENO" 5
 	    else
 			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclpkgd}" >&5
 $as_echo "${ac_cv_c_tclpkgd}" >&6; }
@@ -7908,8 +7960,8 @@
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -8036,7 +8088,7 @@
   as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${$as_ac_Header+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8063,8 +8115,7 @@
 eval ac_res=\$$as_ac_Header
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
 _ACEOF
@@ -8236,8 +8287,7 @@
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -8254,8 +8304,7 @@
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -8383,7 +8432,7 @@
 $as_echo "$as_me: Please install the libmd developer headers for your platform." >&6;}
 					;;
 			esac
-			as_fn_error "libmd was found, but md5.h is missing." "$LINENO" 5
+			as_fn_error $? "libmd was found, but md5.h is missing." "$LINENO" 5
 
 fi
 
@@ -8397,7 +8446,7 @@
 fi
 
 	if test "x$MD5_LIBS" = "x"; then
-		as_fn_error "Neither CommonCrypto nor libmd were found. A working md5 implementation is required." "$LINENO" 5
+		as_fn_error $? "Neither CommonCrypto nor libmd were found. A working md5 implementation is required." "$LINENO" 5
 	fi
 
 
@@ -8593,7 +8642,7 @@
 		if test -f "${with_tclconfig}/tclConfig.sh" ; then
 		    ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
 		else
-		    as_fn_error "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
+		    as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
 		fi
 	    fi
 
@@ -8649,7 +8698,7 @@
 
 	if test x"${ac_cv_c_tclconfig}" = x ; then
 	    TCL_BIN_DIR="# no Tcl configs found"
-	    as_fn_error "Can't find Tcl configuration definitions" "$LINENO" 5
+	    as_fn_error $? "Can't find Tcl configuration definitions" "$LINENO" 5
 	else
 	    no_tcl=
 	    TCL_BIN_DIR=${ac_cv_c_tclconfig}
@@ -8728,7 +8777,7 @@
 	if test -f "${with_tclinclude}/tcl.h" ; then
 	    ac_cv_c_tclh=${with_tclinclude}
 	else
-	    as_fn_error "${with_tclinclude} directory does not contain Tcl public header file tcl.h" "$LINENO" 5
+	    as_fn_error $? "${with_tclinclude} directory does not contain Tcl public header file tcl.h" "$LINENO" 5
 	fi
     else
 	if test "${ac_cv_c_tclh+set}" = set; then :
@@ -8761,7 +8810,7 @@
     # Print a message based on how we determined the include path
 
     if test x"${ac_cv_c_tclh}" = x ; then
-	as_fn_error "tcl.h not found.  Please specify its location with --with-tclinclude" "$LINENO" 5
+	as_fn_error $? "tcl.h not found.  Please specify its location with --with-tclinclude" "$LINENO" 5
     else
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5
 $as_echo "${ac_cv_c_tclh}" >&6; }
@@ -8871,7 +8920,7 @@
 			;;
 	esac
 	if test "x$TCLSH" = "x" ; then
-		as_fn_error "Could not find tclsh" "$LINENO" 5
+		as_fn_error $? "Could not find tclsh" "$LINENO" 5
 	fi
 
 
@@ -8942,7 +8991,7 @@
     fi
 
     if test x"${ac_cv_c_tclpkgd}" = x ; then
-	as_fn_error "Tcl package directory not found.  Please specify its location with --with-tclpackage" "$LINENO" 5
+	as_fn_error $? "Tcl package directory not found.  Please specify its location with --with-tclpackage" "$LINENO" 5
     else
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclpkgd}" >&5
 $as_echo "${ac_cv_c_tclpkgd}" >&6; }
@@ -8968,7 +9017,7 @@
 	else
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-		as_fn_error "tcl wasn't compiled with threads enabled" "$LINENO" 5
+		as_fn_error $? "tcl wasn't compiled with threads enabled" "$LINENO" 5
 	fi
 
 
@@ -9066,7 +9115,7 @@
 	fi
 
 	if test "x$CURL_CONFIG" = "x"; then
-		as_fn_error "cannot find curl-config. Is libcurl installed?" "$LINENO" 5
+		as_fn_error $? "cannot find curl-config. Is libcurl installed?" "$LINENO" 5
 	fi
 
 	CFLAGS_LIBCURL=$($CURL_CONFIG --cflags)
@@ -9141,7 +9190,7 @@
 if test "x$ac_cv_header_sqlite3_h" = x""yes; then :
 
 else
-  as_fn_error "cannot find sqlite3 header" "$LINENO" 5
+  as_fn_error $? "cannot find sqlite3 header" "$LINENO" 5
 fi
 
 
@@ -9340,7 +9389,7 @@
 
 	eval dpversionfile="${sysconfdir}/ports/dp_version"
 	if test -f $dpversionfile; then
-		as_fn_error "Existing MacPorts or DarwinPorts install is too old to be upgraded. Install MacPorts 1.7.1 first." "$LINENO" 5
+		as_fn_error $? "Existing MacPorts or DarwinPorts install is too old to be upgraded. Install MacPorts 1.7.1 first." "$LINENO" 5
 	else
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -9365,7 +9414,7 @@
 
 
 # Output
-ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/prefix.mtree doc/macosx.mtree doc/macports.conf portmgr/freebsd/Makefile src/Makefile src/macports1.0/macports_autoconf.tcl src/port1.0/port_autoconf.tcl src/registry2.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl setupenv.bash"
+ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/prefix.mtree doc/macosx.mtree doc/macports.conf doc/pubkeys.conf portmgr/freebsd/Makefile src/Makefile src/macports1.0/macports_autoconf.tcl src/port1.0/port_autoconf.tcl src/registry2.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl setupenv.bash"
 
 
 ac_config_files="$ac_config_files src/pkg_mkindex.sh"
@@ -9454,6 +9503,7 @@
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -9615,19 +9665,19 @@
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -9823,7 +9873,7 @@
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -9877,7 +9927,7 @@
 # values after options handling.
 ac_log="
 This file was extended by MacPorts $as_me 1.9.99, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+generated by GNU Autoconf 2.66.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -9939,10 +9989,10 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 MacPorts config.status 1.9.99
-configured by $0, generated by GNU Autoconf 2.65,
+configured by $0, generated by GNU Autoconf 2.66,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -9996,7 +10046,7 @@
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error "ambiguous option: \`$1'
+    as_fn_error $? "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
@@ -10005,7 +10055,7 @@
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error "unrecognized option: \`$1'
+  -*) as_fn_error $? "unrecognized option: \`$1'
 Try \`$0 --help' for more information." ;;
 
   *) as_fn_append ac_config_targets " $1"
@@ -10062,6 +10112,7 @@
     "doc/prefix.mtree") CONFIG_FILES="$CONFIG_FILES doc/prefix.mtree" ;;
     "doc/macosx.mtree") CONFIG_FILES="$CONFIG_FILES doc/macosx.mtree" ;;
     "doc/macports.conf") CONFIG_FILES="$CONFIG_FILES doc/macports.conf" ;;
+    "doc/pubkeys.conf") CONFIG_FILES="$CONFIG_FILES doc/pubkeys.conf" ;;
     "portmgr/freebsd/Makefile") CONFIG_FILES="$CONFIG_FILES portmgr/freebsd/Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "src/macports1.0/macports_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/macports1.0/macports_autoconf.tcl" ;;
@@ -10072,7 +10123,7 @@
     "setupenv.bash") CONFIG_FILES="$CONFIG_FILES setupenv.bash" ;;
     "src/pkg_mkindex.sh") CONFIG_FILES="$CONFIG_FILES src/pkg_mkindex.sh" ;;
 
-  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -10109,7 +10160,7 @@
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -10126,7 +10177,7 @@
 fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\r'
+  ac_cs_awk_cr='\\r'
 else
   ac_cs_awk_cr=$ac_cr
 fi
@@ -10140,18 +10191,18 @@
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -10240,20 +10291,28 @@
 else
   cat
 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
@@ -10281,7 +10340,7 @@
   if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -10366,7 +10425,7 @@
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -10379,7 +10438,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -10407,7 +10466,7 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -10434,7 +10493,7 @@
 
     case $ac_tag in
     *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -10565,22 +10624,22 @@
 $ac_datarootdir_hack
 "
 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
   -) cat "$tmp/out" && rm -f "$tmp/out";;
   *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -10591,19 +10650,19 @@
       $as_echo "/* $configure_input  */" \
       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
     } >"$tmp/config.h" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
       mv "$tmp/config.h" "$ac_file" \
-	|| as_fn_error "could not create $ac_file" "$LINENO" 5
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error "could not create -" "$LINENO" 5
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
 
@@ -10623,7 +10682,7 @@
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -10644,7 +10703,7 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit $?
+  $ac_cs_success || as_fn_exit 1
 fi
 
 #
@@ -10785,7 +10844,7 @@
       # The eval makes quoting arguments work.
       eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
 	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
-	as_fn_error "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
     fi
 
     cd "$ac_popdir"

Modified: branches/gsoc10-configfiles/base/configure.ac
===================================================================
--- branches/gsoc10-configfiles/base/configure.ac	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/configure.ac	2010-07-13 14:41:56 UTC (rev 69682)
@@ -103,6 +103,7 @@
 AC_PATH_PROG(PATCH, [patch], [])
 AC_PATH_PROG(RMDIR, [rmdir], [])
 AC_PATH_PROG(RSYNC, [rsync], [])
+AC_PATH_PROG(OPENSSL, [openssl], [])
 AC_PATH_PROG(SED, [sed])
 AC_PATH_PROG(TAR, [tar])
 AC_PATH_PROG(UNZIP, [unzip])
@@ -127,6 +128,7 @@
 AC_ARG_VAR(MTREE, [path to mtree command])
 AC_ARG_VAR(CVS, [path to cvs command])
 AC_ARG_VAR(SVN, [path to svn command])
+AC_ARG_VAR(OPENSSL, [path to openssl command])
 AC_ARG_VAR(RSYNC, [path to rsync command])
 AC_ARG_VAR(SED, [path to sed command])
 AC_ARG_VAR(TAR, [path to tar command])
@@ -346,6 +348,7 @@
 	doc/prefix.mtree
 	doc/macosx.mtree
 	doc/macports.conf
+	doc/pubkeys.conf
 	portmgr/freebsd/Makefile
 	src/Makefile
 	src/macports1.0/macports_autoconf.tcl


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

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


Modified: branches/gsoc10-configfiles/base/doc/Makefile
===================================================================
--- branches/gsoc10-configfiles/base/doc/Makefile	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/doc/Makefile	2010-07-13 14:41:56 UTC (rev 69682)
@@ -1,6 +1,7 @@
 MAN1=		port.1
 MAN5=		macports.conf.5
 MAN7=		portfile.7 portstyle.7 porthier.7 portgroup.7
+CONF=       macports.conf pubkeys.conf sources.conf variants.conf
 INSTALLDIR=	${DESTDIR}${prefix}
 TOPSRCDIR=	..
 
@@ -16,7 +17,7 @@
 test:
 
 distclean: clean
-	rm -f prefix.mtree macports.conf macosx.mtree
+	rm -f macports.conf macosx.mtree prefix.mtree pubkeys.conf
 
 %.1.gz: %.1
 	gzip -c $^ > $@
@@ -40,21 +41,13 @@
 		$(LN_S) share/man ${INSTALLDIR}/man; \
 	fi
 
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 macports.conf ${DESTDIR}${mpconfigdir}/macports.conf.default
-	if test ! -e ${DESTDIR}${mpconfigdir}/macports.conf ; then \
-		set -x; \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macports.conf ${DESTDIR}${mpconfigdir}; \
-	fi
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 sources.conf ${DESTDIR}${mpconfigdir}/sources.conf.default
-	if test ! -e ${DESTDIR}${mpconfigdir}/sources.conf ; then \
-		set -x; \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 sources.conf ${DESTDIR}${mpconfigdir}; \
-	fi
-	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 variants.conf ${DESTDIR}${mpconfigdir}/variants.conf.default
-	if test ! -e ${DESTDIR}${mpconfigdir}/variants.conf ; then \
-		set -x; \
-		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 variants.conf ${DESTDIR}${mpconfigdir}; \
-	fi
+	for f in ${CONF}; do \
+		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$f ${DESTDIR}${mpconfigdir}/$${f}.default; \
+		if test ! -e ${DESTDIR}${mpconfigdir}/$$f ; then \
+			set -x; \
+			$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 $$f ${DESTDIR}${mpconfigdir}; \
+		fi; \
+	done
 
 	# delete old uncompressed man pages if they exist
 	for m in ${MAN1}; do rm -f ${INSTALLDIR}/share/man/man1/$$m ; done

Modified: branches/gsoc10-configfiles/base/doc/macports.conf.5
===================================================================
--- branches/gsoc10-configfiles/base/doc/macports.conf.5	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/doc/macports.conf.5	2010-07-13 14:41:56 UTC (rev 69682)
@@ -62,10 +62,11 @@
 .Ic Default:
 ${prefix}/var/macports
 .It Va portdbformat
-Storage type to use for the MacPorts registry. Currently the only supported format is "flat".
+Storage type to use for the MacPorts registry. The preferred format is "sqlite", with "flat"
+also available as a legacy format.
 .br
 .Ic Default:
-flat
+sqlite
 .It Va portinstalltype
 Sets the mode in which ports are installed by MacPorts. Supported values are 'direct' or 'image'.
 The 'direct' mode is often used on systems that do not support 'image' due to limitations in their

Copied: branches/gsoc10-configfiles/base/doc/pubkeys.conf.in (from rev 69681, trunk/base/doc/pubkeys.conf.in)
===================================================================
--- branches/gsoc10-configfiles/base/doc/pubkeys.conf.in	                        (rev 0)
+++ branches/gsoc10-configfiles/base/doc/pubkeys.conf.in	2010-07-13 14:41:56 UTC (rev 69682)
@@ -0,0 +1,10 @@
+# Downloaded archives will only be used if they can be verified by a public
+# key listed here. Use full paths, one per line.
+
+ at prefix_expanded@/share/macports/macports-pubkey.pem
+
+# To distribute archives of your own, you need a key pair generated like so:
+# openssl genrsa -des3 -out privkey.pem 2048
+# openssl rsa -in privkey.pem -pubout -out pubkey.pem
+# Then sign the archives like this:
+# openssl dgst -ripemd160 -sign privkey.pem -out archive.tbz2.rmd160 archive.tbz2

Copied: branches/gsoc10-configfiles/base/macports-pubkey.pem (from rev 69681, trunk/base/macports-pubkey.pem)
===================================================================
--- branches/gsoc10-configfiles/base/macports-pubkey.pem	                        (rev 0)
+++ branches/gsoc10-configfiles/base/macports-pubkey.pem	2010-07-13 14:41:56 UTC (rev 69682)
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPlw2FSMEavmtuHq5O+f
+XPUXndBnUyoX8iJvQ7NlsNY+hleE307kOAly79WFq2aAGIyKB/Ob8V+qCLW4FGOO
+4NfvOnte1WxQP8oVxOM9ai3CeN6AnUxDWUTYVJ1R+a5ZQVnJyGBKkV+jLlj0PD/z
+d8PCJ/j7Wzizw3d4s9uBIR1zpLY8lVgTivsj5FM3RP6hS7ww7I47goQshoL+YFVg
+NhE9I63oZXqFF130l9jJI9axHUqza7a42WCv04J8iv8SQhgv6fY9ZQnIBMQ4hPDH
+klGusdf4HlCbUViKhxmUpfj6FJabh2jV48ymaoTZB767GJyACF4mvnNDkenEXf41
+/wIDAQAB
+-----END PUBLIC KEY-----

Modified: branches/gsoc10-configfiles/base/portmgr/ReleaseProcess
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/ReleaseProcess	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/ReleaseProcess	2010-07-13 14:41:56 UTC (rev 69682)
@@ -159,8 +159,8 @@
  mv MacPorts-1.6.0.dmg MacPorts-1.6.0-10.5-Leopard.dmg
  for dmg in MacPorts-1.6.0-*.dmg; do for type in -md5 -sha1 -ripemd160; do openssl dgst $type $dmg; done >> MacPorts-1.6.0.chk.txt; done
 
-These new products, along with the new checksums, also have to be posted to the appropriate downloads
-directory of the MacPorts svn repository. Developers are required to validate the generated installer as
+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
 thoroughly as possible through extensive testing, which is mainly why this step of the release process
 is not automated through a Makefile target or similar. A good way of validating the installer is to first
 create the destroot of the port and examine it for:

Modified: branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck	2010-07-13 14:41:56 UTC (rev 69682)
@@ -12,17 +12,22 @@
     exit 112
 fi
 
+if ! [[ -x /usr/bin/xcodebuild ]]; then
+    # message 17
+    exit 113
+fi
+
 base_version=`uname -r | sed 's/\..*//'`
 if [[ ${base_version} != __DARWINVERS__ ]]; then
-   # This maps to message 17 in InstallationCheck.strings (Apple allows
+   # This maps to message 18 in InstallationCheck.strings (Apple allows
    # 16-31 for custom messages); that message should also be customized
    # like this script
-   exit 113
+   exit 114
 fi
 
 if [[ -f __PREFIX__/etc/ports/dp_version ]]; then
-   # message 18 in InstallationCheck.strings
-   exit 114
+   # message 19 in InstallationCheck.strings
+   exit 115
 fi
 
 exit 0

Modified: branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck.strings
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck.strings	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/dmg/InstallationCheck.strings	2010-07-13 14:41:56 UTC (rev 69682)
@@ -1,3 +1,4 @@
 "16" = "Either uname or sed could not be found in PATH. Your system appears to be incomplete or misconfigured.";
-"17" = "This package is meant to be installed on Mac OS X __XVERS__.";
-"18" = "Your existing MacPorts or DarwinPorts installation is too old to be upgraded by this installer. Please install MacPorts 1.7.1 first.";
+"17" = "Xcode is not installed, or was installed with UNIX Development (10.5+) or Command Line Support (10.4) deselected.";
+"18" = "This package is meant to be installed on Mac OS X __XVERS__.";
+"19" = "Your existing MacPorts or DarwinPorts installation is too old to be upgraded by this installer. Please install MacPorts 1.7.1 first.";

Modified: branches/gsoc10-configfiles/base/portmgr/dmg/postflight
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/dmg/postflight	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/dmg/postflight	2010-07-13 14:41:56 UTC (rev 69682)
@@ -55,6 +55,7 @@
 function setup_configs {
     for f in macports.conf sources.conf variants.conf ; do
         if [ ! -f ${CONFIGPATH}/${f} ]; then
+            echo "Copying ${f}.default to ${f}"
             /bin/cp ${CONFIGPATH}/${f}.default ${CONFIGPATH}/${f}
             /bin/chmod 644 ${CONFIGPATH}/${f}
         fi

Deleted: branches/gsoc10-configfiles/base/portmgr/jobs/PortIndexRegen.sh
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/jobs/PortIndexRegen.sh	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/jobs/PortIndexRegen.sh	2010-07-13 14:41:56 UTC (rev 69682)
@@ -1,121 +0,0 @@
-#!/bin/bash
-
-####
-# PortIndex regen automation script.
-# Created by Juan Manuel Palacios,
-# e-mail: jmpp at macports.org
-# Updated by Paul Guyot, <pguyot at kallisys.net>
-# Updated for svn by Daniel J. Luke <dluke at geeklair.net>
-# $Id$
-####
-
-# Configuration
-LOCKFILE=/tmp/.mp_svn_index_regen.lock
-# ROOT directory, where everything is. This needs to exist!
-ROOT=/Users/mp-user/mp_svn_index_regen
-# MP user.
-MP_USER=mp-user
-# MP group.
-MP_GROUP=mp-user
-# e-mail address to spam in case of failure.
-#SPAM_LOVERS=example at hostname.com
-
-# Other settings (probably don't need to be changed).
-SVN_CONFIG_DIR=${ROOT}/svnconfig
-REPO_BASE=http://svn.macports.org/repository/macports
-SVN="/opt/local/bin/svn -q --non-interactive --config-dir $SVN_CONFIG_DIR"
-# Where to checkout the source code. This needs to exist!
-SRCTREE=${ROOT}/source
-# Where MP will install its world. This gets created.
-PREFIX=${ROOT}/opt/local
-# Where MP installs macports1.0. This gets created.
-TCLPKG=${PREFIX}/lib/tcl
-# Path.
-PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin:/usr/X11/bin
-# Log for the e-mail in case of failure.
-FAILURE_LOG=${ROOT}/failure.log
-# Commit message.
-COMMIT_MSG=${ROOT}/commit.msg
-# The date.
-DATE=$(date +'%A %Y-%m-%d at %H:%M:%S')
-
-
-# Function to spam people in charge if something goes wrong during indexing.
-bail () {
-    mail -s "PortIndex Regen failure on ${DATE}" $SPAM_LOVERS < $FAILURE_LOG
-    cleanup; exit 1
-}
-
-# Cleanup function for runtime files.
-cleanup () {
-    rm -f $COMMIT_MSG $FAILURE_LOG
-    rm -f $LOCKFILE
-}
-
-
-if [ ! -e $LOCKFILE ]; then
-    touch $LOCKFILE
-else
-    echo "PortIndex Regen lockfile found, is another regen job running?" > $FAILURE_LOG; bail
-fi
-
-# Checkout/update the ports tree
-if [ -d ${SRCTREE}/dports ]; then
-    $SVN update ${SRCTREE}/dports > $FAILURE_LOG 2>&1 \
-	|| { echo "Updating the ports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG; bail ; }
-else
-    $SVN checkout ${REPO_BASE}/trunk/dports ${SRCTREE}/dports > $FAILURE_LOG 2>&1 \
-	|| { echo "Checking out the ports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG ; bail ; }
-fi
-echo `date -u +%s` > ${ROOT}/PORTS-TIMESTAMP
-
-# Checkout/update HEAD
-TMPDIR=mp_trunk/base
-if [ -d ${ROOT}/${TMPDIR} ]; then
-    $SVN update ${ROOT}/${TMPDIR} > $FAILURE_LOG 2>&1 \
-	|| { echo "Updating the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG; bail ; }
-else
-    $SVN checkout ${REPO_BASE}/trunk/base ${ROOT}/${TMPDIR} > $FAILURE_LOG 2>&1 \
-       || { echo "Checking out the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG ; bail ; }
-fi
-
-echo `date -u +%s` > ${ROOT}/BASE-TIMESTAMP
-
-# (re)configure.
-cd ${ROOT}/${TMPDIR} && \
-    mkdir -p ${TCLPKG} && \
-    ./configure \
-    --prefix=${PREFIX} \
-    --with-tclpackage=${TCLPKG} \
-    --with-install-user=${MP_USER} \
-    --with-install-group=${MP_GROUP} > $FAILURE_LOG 2>&1 \
-    || { echo "./configure script failed." >> $FAILURE_LOG ; bail ; }
-
-# clean
-# (cleaning is useful because we don't want the indexing to fail because dependencies aren't properly computed).
-{ cd ${ROOT}/${TMPDIR} && make clean > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make clean failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)build
-{ cd ${ROOT}/${TMPDIR} && make > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)install
-{ cd ${ROOT}/${TMPDIR} && make install > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make install failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)index
-{ cd ${SRCTREE}/dports/ && ${PREFIX}/bin/portindex > $FAILURE_LOG 2>&1 ; } \
-    || { echo "portindex failed." >> $FAILURE_LOG ; bail ; }
-
-# Commit the new index using the last 5 lines of the log for the commit message,
-tail -n 5 $FAILURE_LOG > $COMMIT_MSG
-# plus parsing failures, if any.
-echo "" >> $COMMIT_MSG
-grep Failed $FAILURE_LOG >> $COMMIT_MSG
-{ cd ${SRCTREE}/dports/ && \
-    $SVN --config-dir $SVN_CONFIG_DIR commit -F $COMMIT_MSG PortIndex PortIndex.quick > $FAILURE_LOG 2>&1 ; } \
-    || { echo "SVN commit failed." >> $FAILURE_LOG ; bail ; }
-
-# At this point the index was committed successfuly, so we cleanup before we exit.
-cleanup && exit 0

Modified: branches/gsoc10-configfiles/base/portmgr/jobs/README
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/jobs/README	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/jobs/README	2010-07-13 14:41:56 UTC (rev 69682)
@@ -4,13 +4,9 @@
 
  1) mprsyncup:
     Runs on Mac OS Forge servers every 30 minutes, on the hour and on the half hour, off launchd through the org.macports.mprsyncup.plist provided.
-    Repopulates the rsync modules that feed the "sync" and "selfupdate" operations for both the ports tree and MacPorts sources, freshly off the svn
-    sources.
+    Repopulates the rsync modules that feed the "sync" and "selfupdate" operations for both the ports tree and MacPorts sources, freshly off the svn sources.
+    Updates the port indexes stored on the rsync server.
 
- 2) PortIndexRegen:
-    Still running on Daniel's box, twice a day every 12 hours off cron. Scheduled for a rewrite in Tcl to employ the macports1.0 API and thus simplify
-    some of its tasks. Once that's done it'll be moved to Mac OS Forge servers. This job regenerates the ports' index employed by operations like "port search".
-
  3) PortIndex2MySQL:
     Running Mac OS Forge servers twice a day every 12 hours off launchd through the org.macports.PortIndex2MySQL.plist provided, 15 minutes after the
     PortIndexRegen job. This jobs repopulates the database that feeds the www.macports.org/ports.php page off the regenerated PortIndex.
@@ -22,3 +18,4 @@
  5) Website:
     There's actually no script for this one, as the job itself is really simple: a post-commit svn hook attached to the /trunk/www dir
     updates the copy of our website on the Mac OS Forge web server whenever a commit to that directory occurs.
+

Modified: branches/gsoc10-configfiles/base/portmgr/jobs/mprsyncup
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/jobs/mprsyncup	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/jobs/mprsyncup	2010-07-13 14:41:56 UTC (rev 69682)
@@ -1,6 +1,4 @@
 #!/bin/sh
-
-
 ####
 # Script to checkout/update base sources from both trunk (ToT) and the current
 # release tag (as determined by the base/config/RELEASE_URL file) and a ports
@@ -30,24 +28,39 @@
 # $Id$
 ####
 
-
 set -e
+set -x
 
 # Commands we need:
 SVN="/opt/local/bin/svn -q --non-interactive"
 CLEANUP="/opt/local/bin/svn --non-interactive cleanup"
-RSYNC="/usr/bin/rsync -q"
+RSYNC="/opt/local/bin/rsync -q"
 RM="/bin/rm"
 MKDIR="/bin/mkdir"
 LN="/bin/ln"
 
 # 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
 TBASE=${SVNROOT}/trunk/base
 RBASE=${SVNROOT}/release/base
 PORTS=${SVNROOT}/release/ports
-RSYNCROOT=/Volumes/data/rsync/macports
+RSYNCROOT=/rsync/macports
+PORTINDEX=${PREFIX}/bin/portindex
 
+PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
+
+# platforms we generate indexes for
+PLATFORMS="8_ppc 8_i386 9_ppc 9_i386 10_i386"
+# 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=http://svn.macports.org/repository/macports
 RELEASE_URL_FILE=config/RELEASE_URL
@@ -64,18 +77,11 @@
     ${SVN} checkout ${SVNURL}/trunk/base ${TBASE}
 fi
 
-# Delete old exports if they exist
-if [ -d ${TBASE}-export ]; then
-    $RM -rf ${TBASE}-export;
-fi
-${SVN} export ${TBASE} ${TBASE}-export
-
 if [ ! -d ${RSYNCROOT}/trunk/base ]; then
     ${MKDIR} -p ${RSYNCROOT}/trunk
 fi
-${RSYNC} -a -I --delete ${TBASE}-export/ ${RSYNCROOT}/trunk/base && ${RM} -rf ${TBASE}-export
+${RSYNC} -aIC --delete ${TBASE}/ ${RSYNCROOT}/trunk/base
 
-
 # Read what tag we're releasing from, switch to/checkout a copy, export and rsync it to ${RSYNCROOT}/release/base:
 read RELEASE_URL < ${TBASE}/${RELEASE_URL_FILE}
 if [ ! -n ${RELEASE_URL} ]; then
@@ -88,16 +94,10 @@
     ${SVN} checkout ${RELEASE_URL} ${RBASE}
 fi
 
-# Delete old exports if they exist
-if [ -d ${RBASE}-export ]; then
-    $RM -rf ${RBASE}-export;
-fi
-${SVN} export ${RBASE} ${RBASE}-export
-
 if [ ! -d ${RSYNCROOT}/release/base ]; then
     ${MKDIR} -p ${RSYNCROOT}/release/base
 fi
-${RSYNC} -a -I --delete ${RBASE}-export/ ${RSYNCROOT}/release/base && ${RM} -rf ${RBASE}-export
+${RSYNC} -aIC --delete ${RBASE}/ ${RSYNCROOT}/release/base 
 
 # clean up the working copy if it is locked
 if [ -f ${PORTS}/.svn/lock ]; then
@@ -111,26 +111,36 @@
     ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
 fi
 
-# Delete old exports if they exist
-if [ -d ${PORTS}-export ]; then
-    $RM -rf ${PORTS}-export;
-fi
-${SVN} export ${PORTS} ${PORTS}-export
+# generate platform-specific indexes
+pushd ${PORTS} >> /dev/null
+# build MP trunk in a private location for indexing
+pushd ${ROOT}/${TMPDIR} >> /dev/null
+mkdir -p ${TCLPKG} 
+./configure \
+    --prefix=${PREFIX} \
+    --with-tclpackage=${TCLPKG} \
+    --with-install-user=${MP_USER} \
+    --with-install-group=${MP_GROUP} 
+make clean 
+make
+make install 
+popd
 
+for PLATFORM in $PLATFORMS; do
+	$PORTINDEX -p darwin_${PLATFORM} -o PortIndex_darwin_${PLATFORM};
+done
+
+# support MP 1.8
+cp PortIndex_darwin_${OLD_INDEX_PLATFORM}/* ./
+popd
+
 if [ ! -d ${RSYNCROOT}/release/ports ]; then
     ${MKDIR} -p ${RSYNCROOT}/release/ports
 fi
-${RSYNC} -a -I --delete ${PORTS}-export/ ${RSYNCROOT}/release/ports && ${RM} -rf ${PORTS}-export
+${RSYNC} -aIC --delete ${PORTS}/ ${RSYNCROOT}/release/ports
 
-
-# Compatibility checks:
+# symlink trunk ports to release ports since we only have 1 set of ports
 cd ${RSYNCROOT}
-if [ ! -h dpupdate ]; then
-    ${RM} -rf dpupdate && ${LN} -s trunk dpupdate
-fi
-if [ ! -h dpupdate1 ]; then
-    ${RM} -rf dpupdate1 && ${LN} -s release dpupdate1
-fi
 if [ ! -h trunk/dports ]; then
     cd trunk
     ${RM} -rf dports && ${LN} -s ../release/ports dports

Deleted: branches/gsoc10-configfiles/base/portmgr/jobs/org.macports.PortIndexRegen.plist
===================================================================
Modified: branches/gsoc10-configfiles/base/portmgr/packaging/dpkgall.tcl
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/packaging/dpkgall.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/packaging/dpkgall.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -690,7 +690,7 @@
 	set variations ""
 
 	foreach port [get_required_ports] {
-		if {[catch {do_portexec $port [array get options] [array get variants] install} result]} {
+		if {[catch {do_portexec $port [array get options] [array get variants] activate} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			ui_noisy_error "Fatal error: $result"
@@ -745,7 +745,7 @@
 		exit 1
 	}
 
-	if {[catch {set result [mportexec $workername install]} result] || $result == 1} {
+	if {[catch {set result [mportexec $workername $target]} result] || $result == 1} {
 
 		# Close the port
 		mportclose $workername

Modified: branches/gsoc10-configfiles/base/portmgr/packaging/rpmall.tcl
===================================================================
--- branches/gsoc10-configfiles/base/portmgr/packaging/rpmall.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/portmgr/packaging/rpmall.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -457,7 +457,7 @@
 				ui_error "Internal error: unable to install ${prebuild}... exiting"
 				exit 1
 			}
-			if {[catch {set result [mportexec $workername install]} result] ||
+			if {[catch {set result [mportexec $workername activate]} result] ||
 				$result == 1} {
 				global errorInfo
 				ui_debug "$errorInfo"

Modified: branches/gsoc10-configfiles/base/src/cregistry/entry.c
===================================================================
--- branches/gsoc10-configfiles/base/src/cregistry/entry.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/cregistry/entry.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -78,10 +78,10 @@
  * @param [in,out] dst_space number of characters `dst` can hold
  * @param [in] src           string to concatenate to `dst`
  */
-static int reg_strcat(char** dst, int* dst_len, int* dst_space, char* src) {
-    int src_len = strlen(src);
-    int result_len = *dst_len + src_len;
-    if (result_len >= *dst_space) {
+static int reg_strcat(char** dst, size_t* dst_len, size_t* dst_space, char* src) {
+    size_t src_len = strlen(src);
+    size_t result_len = *dst_len + src_len;
+    if (result_len > *dst_space) {
         char* new_dst;
         *dst_space *= 2;
         if (*dst_space < result_len) {
@@ -197,7 +197,7 @@
  */
 reg_entry* reg_entry_create(reg_registry* reg, char* name, char* version,
         char* revision, char* variants, char* epoch, reg_error* errPtr) {
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     reg_entry* entry = NULL;
     char* query = "INSERT INTO registry.ports "
         "(name, version, revision, variants, epoch) VALUES (?, ?, ?, ?, ?)";
@@ -239,7 +239,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return entry;
 }
 
@@ -257,7 +259,7 @@
  */
 reg_entry* reg_entry_open(reg_registry* reg, char* name, char* version,
         char* revision, char* variants, char* epoch, reg_error* errPtr) {
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     reg_entry* entry = NULL;
     char* query = "SELECT id FROM registry.ports WHERE name=? AND version=? "
         "AND revision=? AND variants=? AND epoch=?";
@@ -296,7 +298,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return entry;
 }
 
@@ -312,9 +316,9 @@
 int reg_entry_delete(reg_entry* entry, reg_error* errPtr) {
     reg_registry* reg = entry->reg;
     int result = 0;
-    sqlite3_stmt* ports;
-    sqlite3_stmt* files;
-    sqlite3_stmt* dependencies;
+    sqlite3_stmt* ports = NULL;
+    sqlite3_stmt* files = NULL;
+    sqlite3_stmt* dependencies = NULL;
     char* ports_query = "DELETE FROM registry.ports WHERE id=?";
     char* files_query = "DELETE FROM registry.files WHERE id=?";
     char* dependencies_query = "DELETE FROM registry.dependencies WHERE id=?";
@@ -375,9 +379,15 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, NULL);
     }
-    sqlite3_finalize(ports);
-    sqlite3_finalize(files);
-    sqlite3_finalize(dependencies);
+    if (ports) {
+        sqlite3_finalize(ports);
+    }
+    if (files) {
+        sqlite3_finalize(files);
+    }
+    if (dependencies) {
+        sqlite3_finalize(dependencies);
+    }
     return result;
 }
 
@@ -417,7 +427,7 @@
     void** results = malloc(10*sizeof(void*));
     int result_count = 0;
     int result_space = 10;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     if (!results) {
         return -1;
     }
@@ -455,7 +465,9 @@
             }
         }
     } else {
-        sqlite3_finalize(stmt);
+        if (stmt) {
+            sqlite3_finalize(stmt);
+        }
         reg_sqlite_error(reg->db, errPtr, query);
     }
     free(results);
@@ -499,8 +511,7 @@
     int i;
     char* kwd = " WHERE ";
     char* query;
-    int query_len = 29;
-    int query_space = 29;
+    size_t query_len, query_space;
     int result;
     /* get the strategy */
     char* op = reg_strategy_op(strategy, errPtr);
@@ -512,6 +523,7 @@
     if (!query) {
         return -1;
     }
+    query_len = query_space = strlen(query);
     for (i=0; i<key_count; i++) {
         char* cond = sqlite3_mprintf(op, keys[i], vals[i]);
         if (!cond || !reg_strcat(&query, &query_len, &query_space, kwd)
@@ -523,7 +535,7 @@
         kwd = " AND ";
     }
     /* do the query */
-    result = reg_all_entries(reg, query, query_len, entries, errPtr);
+    result = reg_all_entries(reg, query, -1, entries, errPtr);
     free(query);
     return result;
 }
@@ -619,7 +631,7 @@
 int reg_entry_owner(reg_registry* reg, char* path, reg_entry** entry,
         reg_error* errPtr) {
     int result = 0;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query = "SELECT id FROM registry.files WHERE actual_path=? AND active";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
             && (sqlite3_bind_text(stmt, 1, path, -1, SQLITE_STATIC)
@@ -646,7 +658,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 
@@ -663,7 +677,7 @@
  * @return          id of owner, or 0 for none
  */
 sqlite_int64 reg_entry_owner_id(reg_registry* reg, char* path) {
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     sqlite_int64 result = 0;
     char* query = "SELECT id FROM registry.files WHERE actual_path=? AND active";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
@@ -677,7 +691,9 @@
             }
         } while (r == SQLITE_BUSY);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 
@@ -696,7 +712,7 @@
         reg_error* errPtr) {
     reg_registry* reg = entry->reg;
     int result = 0;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query;
     const char *text;
     query = sqlite3_mprintf("SELECT %q FROM registry.ports WHERE id=%lld", key,
@@ -730,7 +746,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     sqlite3_free(query);
     return result;
 }
@@ -753,7 +771,7 @@
         reg_error* errPtr) {
     reg_registry* reg = entry->reg;
     int result = 0;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query;
     query = sqlite3_mprintf("UPDATE registry.ports SET %q = '%q' WHERE id=%lld",
             key, value, entry->id);
@@ -781,7 +799,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     sqlite3_free(query);
     return result;
 }
@@ -800,7 +820,7 @@
         reg_error* errPtr) {
     reg_registry* reg = entry->reg;
     int result = 1;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* insert = "INSERT INTO registry.files (id, path, mtime, active) "
         "VALUES (?, ?, 0, 0)";
     if ((sqlite3_prepare(reg->db, insert, -1, &stmt, NULL) == SQLITE_OK)
@@ -833,7 +853,9 @@
         reg_sqlite_error(reg->db, errPtr, insert);
         result = 0;
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 
@@ -851,7 +873,7 @@
         reg_error* errPtr) {
     reg_registry* reg = entry->reg;
     int result = 1;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query = "DELETE FROM registry.files WHERE path=? AND id=?";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
             && (sqlite3_bind_int64(stmt, 2, entry->id) == SQLITE_OK)) {
@@ -889,7 +911,9 @@
         reg_sqlite_error(reg->db, errPtr, query);
         result = 0;
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 
@@ -906,7 +930,7 @@
  */
 int reg_entry_imagefiles(reg_entry* entry, char*** files, reg_error* errPtr) {
     reg_registry* reg = entry->reg;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query = "SELECT path FROM registry.files WHERE id=? ORDER BY path";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
             && (sqlite3_bind_int64(stmt, 1, entry->id) == SQLITE_OK)) {
@@ -953,7 +977,9 @@
         }
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
-        sqlite3_finalize(stmt);
+        if (stmt) {
+            sqlite3_finalize(stmt);
+        }
         return -1;
     }
 }
@@ -971,7 +997,7 @@
  */
 int reg_entry_files(reg_entry* entry, char*** files, reg_error* errPtr) {
     reg_registry* reg = entry->reg;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query = "SELECT actual_path FROM registry.files WHERE id=? "
         "AND active ORDER BY actual_path";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
@@ -1019,7 +1045,9 @@
         }
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
-        sqlite3_finalize(stmt);
+        if (stmt) {
+            sqlite3_finalize(stmt);
+        }
         return -1;
     }
 }
@@ -1043,8 +1071,8 @@
     reg_registry* reg = entry->reg;
     int result = 1;
     int i;
-    sqlite3_stmt* select;
-    sqlite3_stmt* update;
+    sqlite3_stmt* select = NULL;
+    sqlite3_stmt* update = NULL;
     char* select_query = "SELECT id FROM registry.files WHERE actual_path=? "
         "AND active";
     char* update_query = "UPDATE registry.files SET actual_path=?, active=1 "
@@ -1117,12 +1145,16 @@
             reg_sqlite_error(reg->db, errPtr, update_query);
             result = 0;
         }
-        sqlite3_finalize(update);
+        if (update) {
+            sqlite3_finalize(update);
+        }
     } else {
         reg_sqlite_error(reg->db, errPtr, select_query);
         result = 0;
     }
-    sqlite3_finalize(select);
+    if (select) {
+        sqlite3_finalize(select);
+    }
     return result;
 }
 
@@ -1141,7 +1173,7 @@
     reg_registry* reg = entry->reg;
     int result = 1;
     int i;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query = "UPDATE registry.files SET active=0 WHERE actual_path=? AND id=?";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
             && (sqlite3_bind_int64(stmt, 2, entry->id) == SQLITE_OK)) {
@@ -1178,7 +1210,9 @@
         reg_sqlite_error(reg->db, errPtr, query);
         result = 0;
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 
@@ -1240,7 +1274,7 @@
 int reg_entry_depends(reg_entry* entry, char* name, reg_error* errPtr) {
     reg_registry* reg = entry->reg;
     int result = 0;
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     char* query = "INSERT INTO registry.dependencies (id, name) VALUES (?,?)";
     if ((sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
             && (sqlite3_bind_int64(stmt, 1, entry->id) == SQLITE_OK)
@@ -1263,7 +1297,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 

Modified: branches/gsoc10-configfiles/base/src/cregistry/registry.c
===================================================================
--- branches/gsoc10-configfiles/base/src/cregistry/registry.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/cregistry/registry.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -194,7 +194,7 @@
         }
     }
     if (initialized || can_write) {
-        sqlite3_stmt* stmt;
+        sqlite3_stmt* stmt = NULL;
         char* query = sqlite3_mprintf("ATTACH DATABASE '%q' AS registry", path);
         if (sqlite3_prepare(reg->db, query, -1, &stmt, NULL) == SQLITE_OK) {
             int r;
@@ -220,7 +220,9 @@
         } else {
             reg_sqlite_error(reg->db, errPtr, query);
         }
-        sqlite3_finalize(stmt);
+        if (stmt) {
+            sqlite3_finalize(stmt);
+        }
         sqlite3_free(query);
     } else {
         reg_throw(errPtr, REG_CANNOT_INIT, "port registry doesn't exist at "
@@ -239,7 +241,7 @@
  * @return             true if success; false if failure
  */
 int reg_detach(reg_registry* reg, reg_error* errPtr) {
-    sqlite3_stmt* stmt;
+    sqlite3_stmt* stmt = NULL;
     int result = 0;
     char* query = "DETACH DATABASE registry";
     if (!(reg->status & reg_attached)) {
@@ -279,7 +281,9 @@
     } else {
         reg_sqlite_error(reg->db, errPtr, query);
     }
-    sqlite3_finalize(stmt);
+    if (stmt) {
+        sqlite3_finalize(stmt);
+    }
     return result;
 }
 

Modified: branches/gsoc10-configfiles/base/src/cregistry/sql.c
===================================================================
--- branches/gsoc10-configfiles/base/src/cregistry/sql.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/cregistry/sql.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -51,11 +51,13 @@
 int do_queries(sqlite3* db, char** queries, reg_error* errPtr) {
     char** query;
     for (query = queries; *query != NULL; query++) {
-        sqlite3_stmt* stmt;
+        sqlite3_stmt* stmt = NULL;
         if ((sqlite3_prepare(db, *query, -1, &stmt, NULL) != SQLITE_OK)
                 || (sqlite3_step(stmt) != SQLITE_DONE)) {
             reg_sqlite_error(db, errPtr, *query);
-            sqlite3_finalize(stmt);
+            if (stmt) {
+                sqlite3_finalize(stmt);
+            }
             return 0;
         }
         sqlite3_finalize(stmt);

Modified: branches/gsoc10-configfiles/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/macports1.0/macports.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/macports1.0/macports.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -51,8 +51,8 @@
     variable portinterp_options "\
         portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
         registry.path registry.format registry.installtype portarchivemode portarchivepath \
-        portarchivetype portautoclean porttrace keeplogs portverbose destroot_umask rsync_server \
-        rsync_options rsync_dir startupitem_type place_worksymlink macportsuser \
+        portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \
+        rsync_server rsync_options rsync_dir startupitem_type place_worksymlink macportsuser \
         mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
         applications_dir current_phase frameworks_dir developer_dir universal_archs build_arch \
         os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target $user_options"
@@ -113,7 +113,7 @@
     global macports::channels macports::portdbpath
 
     if {[getuid] == 0 && [geteuid] != 0} {
-        seteuid 0
+        seteuid 0; setegid 0
     }
     if {[catch {macports::ch_logging $mport} err]} {
         ui_debug "Logging disabled, error opening log file: $err"
@@ -155,6 +155,9 @@
         }
     }
     if {$::logenabled} {
+        if {[getuid] == 0 && [geteuid] != 0} {
+            seteuid 0; setegid 0
+        }
         if {[catch {macports::ch_logging $mport} err]} {
             ui_debug "Logging disabled, error opening log file: $err"
             return
@@ -385,6 +388,9 @@
                         set macports::xcodeversion "2.1"
                     }
                 }
+            } else {
+                ui_warn "xcodebuild exists but failed to execute"
+                set macports::xcodeversion "none"
             }
         }
         if {![info exists xcodebuildcmd]} {
@@ -464,6 +470,7 @@
     global macports::os_platform
     global macports::macosx_version
     global macports::macosx_deployment_target
+    global macports::archivefetch_pubkeys
 
     # Set the system encoding to utf-8
     encoding system utf-8
@@ -602,6 +609,21 @@
     global macports::global_variations
     array set macports::global_variations [array get variations]
 
+    # pubkeys.conf
+    set macports::archivefetch_pubkeys {}
+    if {[file isfile [file join ${macports_conf_path} pubkeys.conf]]} {
+        set fd [open [file join ${macports_conf_path} pubkeys.conf] r]
+        while {[gets $fd line] >= 0} {
+            set line [string trim $line]
+            if {![regexp {^[\ \t]*#.*$|^$} $line]} {
+                lappend macports::archivefetch_pubkeys $line
+            }
+        }
+        close $fd
+    } else {
+        ui_debug "pubkeys.conf does not exist."
+    }
+
     if {![info exists portdbpath]} {
         return -code error "portdbpath must be set in ${macports_conf_path}/macports.conf or in your ${macports_user_dir}/macports.conf"
     }
@@ -834,9 +856,10 @@
         set keepenvkeys [concat ${keepenvkeys} ${extra_env}]
     }
 
-    foreach envkey [array names env] {
-        if {[lsearch $keepenvkeys $envkey] == -1} {
-            array unset env $envkey
+    set env_names [array names env]
+    foreach envkey $env_names {
+        if {[lsearch -exact $keepenvkeys $envkey] == -1} {
+            unset env($envkey)
         }
     }
 
@@ -870,9 +893,11 @@
     }
 
     # unset environment an extra time, to work around bugs in Leopard Tcl
-    foreach envkey [array names env] {
-        if {[lsearch $keepenvkeys $envkey] == -1} {
-            unsetenv $envkey
+    if {$macosx_version == "10.5"} {
+        foreach envkey $env_names {
+            if {[lsearch -exact $keepenvkeys $envkey] == -1} {
+                unsetenv $envkey
+            }
         }
     }
 
@@ -1512,6 +1537,7 @@
     # xxx: set the work path?
     set workername [ditem_key $mport workername]
     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} {
         # If auto-clean mode, clean-up after dependency install
         if {[string equal ${macports::portautoclean} "yes"]} {
@@ -1556,29 +1582,26 @@
     }
 
     # Before we build the port, we must build its dependencies.
-    # XXX: need a more general way of comparing against targets
     set dlist {}
-    if {   $target == "fetch" || $target == "checksum"
-        || $target == "extract" || $target == "patch"
-        || $target == "configure" || $target == "build"
-        || $target == "test"
-        || $target == "destroot" || $target == "install"
-        || $target == "archive"
-        || $target == "dmg" || $target == "mdmg"
-        || $target == "pkg" || $target == "mpkg"
-        || $target == "rpm" || $target == "dpkg"
-        || $target == "srpm"|| $target == "portpkg" } {
+    if {[macports::_target_needs_deps $target]} {
 
-        # possibly warn or error out depending on how old xcode is
-        if {[$workername eval _check_xcode_version] != 0} {
-            return 1
+        # see if we actually need to build this port
+        if {![$workername eval registry_exists \$name \$version \$revision \$portvariants]} {
+            # possibly warn or error out depending on how old xcode is
+            if {[$workername eval _check_xcode_version] != 0} {
+                return 1
+            }
+            # error out if selected arch(s) not supported by this port
+            if {[$workername eval check_supported_archs] != 0} {
+                return 1
+            }
+    
+            # upgrade dependencies that are already installed
+            if {![macports::global_option_isset ports_nodeps]} {
+                macports::_upgrade_mport_deps $mport $target
+            }
         }
 
-        # upgrade dependencies that are already installed
-        if {![macports::global_option_isset ports_nodeps]} {
-            macports::_upgrade_mport_deps $mport $target
-        }
-
         ui_msg -nonewline "--->  Computing dependencies for [_mportkey $mport name]"
         if {[macports::ui_isset ports_debug]} {
             # play nice with debug messages
@@ -1612,7 +1635,7 @@
         if { [string equal ${macports::registry.installtype} "image"] } {
             set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
         } else {
-            set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
+            set result [dlist_eval $dlist _mportinstalled [list _mportexec "activate"]]
         }
 
         if {$result != {}} {
@@ -1634,11 +1657,6 @@
     }
 
     set clean 0
-    if {[string equal $target "install"] && [string equal ${macports::registry.installtype} "image"]} {
-        # If we're doing image installs, then we should activate after install
-        # xxx: This isn't pretty
-        set target activate
-    }
     if {[string equal ${macports::portautoclean} "yes"] && ([string equal $target "install"] || [string equal $target "activate"])} {
         # If we're doing an install, check if we should clean after
         set clean 1
@@ -1670,7 +1688,7 @@
 proc macports::_upgrade_mport_deps {mport target} {
     set options [ditem_key $mport options]
     set workername [ditem_key $mport workername]
-    set deptypes [macports::_deptypes_for_target $target]
+    set deptypes [macports::_deptypes_for_target $target $workername]
     array set portinfo [mportinfo $mport]
     array set depscache {}
 
@@ -1910,6 +1928,8 @@
                     ui_debug $rsync_commandline
                     if {[catch {system $rsync_commandline}]} {
                         ui_debug "Synchronization of the PortIndex failed doing rsync"
+                    } else {
+                        mports_generate_quickindex $indexfile
                     }
                 }
                 if {[catch {system "chmod -R a+r \"$destdir\""}]} {
@@ -1937,7 +1957,7 @@
                         continue
                     }
 
-                    file mkdir [file dirname $indexfile]
+                    file mkdir $destdir
 
                     set verboseflag {}
                     if {$macports::portverbose == "yes"} {
@@ -1971,6 +1991,11 @@
                         ui_warn "Setting world read permissions on parts of the ports tree failed, need root?"
                     }
 
+                    set platindex "PortIndex_${macports::os_platform}_${macports::os_major}_${macports::os_arch}/PortIndex"
+                    if {[file isfile ${destdir}/${platindex}] && [file isfile ${destdir}/${platindex}.quick]} {
+                        file rename -force "${destdir}/${platindex}" "${destdir}/${platindex}.quick" $destdir
+                    }
+
                     file delete $tarpath
                     
                     set needs_portindex 1
@@ -2401,18 +2426,22 @@
         flush stdout
     }
     
-    if {[info exists portinfo(conflicts)] && ($target == "" || $target == "install")} {
+    if {[info exists portinfo(conflicts)] && ($target == "" || $target == "install" || $target == "activate")} {
         set conflictports [_mportconflictsinstalled $mport $portinfo(conflicts)]
         if {[llength ${conflictports}] != 0} {
             if {[macports::global_option_isset ports_force]} {
                 ui_warn "Force option set; installing $portinfo(name) despite conflicts with: ${conflictports}"
             } else {
+                if {![macports::ui_isset ports_debug]} {
+                    ui_msg ""
+                }
                 return -code error "Can't install $portinfo(name) because conflicting ports are installed: ${conflictports}"
             }
         }
     }
 
-    set deptypes [macports::_deptypes_for_target $target]
+    set workername [ditem_key $mport workername]
+    set deptypes [macports::_deptypes_for_target $target $workername]
 
     set subPorts {}
     if {[llength $deptypes] > 0} {
@@ -2421,7 +2450,6 @@
         set optionsarray(ports_requested) 0
         set options [array get optionsarray]
         set variations [ditem_key $mport variations]
-        set workername [ditem_key $mport workername]
         set required_archs [$workername eval get_canonical_archs]
         set depends_skip_archcheck [_mportkey $mport depends_skip_archcheck]
     }
@@ -2605,32 +2633,69 @@
     ui_error "and does not have a universal variant."
 }
 
+# check if the given target needs dependencies installed first
+proc macports::_target_needs_deps {target} {
+    # XXX: need a better way than checking this hardcoded list
+    switch -- $target {
+        fetch -
+        checksum -
+        extract -
+        patch -
+        configure -
+        build -
+        test -
+        destroot -
+        install -
+        archive -
+        activate -
+        dmg -
+        mdmg -
+        pkg -
+        mpkg -
+        rpm -
+        dpkg -
+        srpm { return 1 }
+        default { return 0 }
+    }
+}
+
 # Determine dependency types required for target
-proc macports::_deptypes_for_target {target} {
+proc macports::_deptypes_for_target {target workername} {
     switch $target {
         fetch       -
-        checksum    { set deptypes "depends_fetch" }
+        checksum    { return "depends_fetch" }
         extract     -
-        patch       { set deptypes "depends_fetch depends_extract" }
+        patch       { return "depends_fetch depends_extract" }
         configure   -
-        build       { set deptypes "depends_fetch depends_extract depends_build depends_lib" }
-
+        build       { return "depends_fetch depends_extract depends_build depends_lib" }
         test        -
-        destroot    -
-        install     -
-        activate    -
+        srpm        -
+        destroot    { return "depends_fetch depends_extract depends_build depends_lib depends_run" }
         archive     -
         dmg         -
         pkg         -
-        portpkg     -
         mdmg        -
         mpkg        -
         rpm         -
-        srpm        -
-        dpkg        -
-        ""          { set deptypes "depends_fetch depends_extract depends_build depends_lib depends_run" }
+        dpkg        {
+            if {[$workername eval _archive_available]} {
+                return "depends_lib depends_run"
+            } else {
+                return "depends_fetch depends_extract depends_build depends_lib depends_run"
+            }
+        }
+        install     -
+        activate    -
+        ""          {
+            if {[$workername eval registry_exists \$name \$version \$revision \$portvariants]
+                || [$workername eval _archive_available]} {
+                return "depends_lib depends_run"
+            } else {
+                return "depends_fetch depends_extract depends_build depends_lib depends_run"
+            }
+        }
     }
-    return $deptypes
+    return ""
 }
 
 # selfupdate procedure
@@ -2861,7 +2926,7 @@
                     return $status
                 }
                 # now install it
-                if {[catch {set result [mportexec $workername install]} result]} {
+                if {[catch {set result [mportexec $workername activate]} result]} {
                     global errorInfo
                     ui_debug "$errorInfo"
                     ui_error "Unable to exec port: $result"
@@ -3170,7 +3235,8 @@
             # we have to force the uninstall in case of dependents
             set force_cur [info exists options(ports_force)]
             set options(ports_force) yes
-            set newregref [registry::open_entry $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) $epoch_in_tree]
+            set existing_epoch [lindex [lindex [registry::installed $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)] 0] 5]
+            set newregref [registry::open_entry $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) $existing_epoch]
             if {$is_dryrun eq "yes"} {
                 ui_msg "Skipping uninstall $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
             } elseif {!(${registry.format} == "receipt_sqlite" && [registry::run_target $newregref uninstall [array get options]])
@@ -3189,7 +3255,28 @@
                 set anyactive no
             }
         }
-        if {[info exists options(port_uninstall_old)]} {
+        if {$anyactive && $portname != $newname} {
+            # replaced_by in effect, deactivate the old port
+            # we have to force the deactivate in case of dependents
+            set force_cur [info exists options(ports_force)]
+            set options(ports_force) yes
+            if {$is_dryrun eq "yes"} {
+                ui_msg "Skipping deactivate $portname @${version_active}_${revision_active}${variant_active} (dry run)"
+            } elseif {![catch {registry::active $portname}] &&
+                      !(${registry.format} == "receipt_sqlite" && [registry::run_target $regref deactivate [array get options]])
+                      && [catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} [array get options]} result]} {
+                global errorInfo
+                ui_debug "$errorInfo"
+                ui_error "Deactivating $portname @${version_active}_${revision_active}${variant_active} failed: $result"
+                catch {mportclose $workername}
+                return 1
+            }
+            if {!$force_cur} {
+                unset options(ports_force)
+            }
+            set anyactive no
+        }
+        if {[info exists options(port_uninstall_old)] && $portname == $newname} {
             # uninstalling now could fail due to dependents when not forced,
             # because the new version is not installed
             set uninstall_later yes
@@ -3201,7 +3288,7 @@
             ui_msg "Skipping deactivate $portname @${version_active}_${revision_active}${variant_active} (dry run)"
         }
         ui_msg "Skipping activate $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
-    } elseif {[catch {set result [mportexec $workername install]} result]} {
+    } elseif {[catch {set result [mportexec $workername activate]} result]} {
         global errorInfo
         ui_debug "$errorInfo"
         ui_error "Couldn't activate $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants): $result"

Modified: branches/gsoc10-configfiles/base/src/package1.0/portarchive.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/package1.0/portarchive.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/package1.0/portarchive.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -78,11 +78,7 @@
 
     # Define archive destination directory and target filename
     if {![string equal ${archive.destpath} ${workpath}] && ![string equal ${archive.destpath} ""]} {
-        if {[llength [get_canonical_archs]] > 1} {
-            set archive.fulldestpath [file join ${archive.destpath} [option os.platform] "universal"]
-        } else {
-            set archive.fulldestpath [file join ${archive.destpath} [option os.platform] [get_canonical_archs]]
-        }
+        set archive.fulldestpath [file join ${archive.destpath} [option archive.subdir]]
     } else {
         set archive.fulldestpath ${archive.destpath}
     }
@@ -294,14 +290,18 @@
     global archive.meta archive.metaname archive.metapath
     global os.platform
 
+    if {[getuid] == 0 && [geteuid] != 0} {
+        elevateToRoot "archive"
+    }
+
     # Create archive destination path (if needed)
     if {![file isdirectory ${archive.fulldestpath}]} {
-        system "mkdir -p ${archive.fulldestpath}"
+        file mkdir ${archive.fulldestpath}
     }
 
     # Create (if no files) destroot for archiving
     if {![file isdirectory ${destpath}]} {
-        system "mkdir -p ${destpath}"
+        file mkdir ${destpath}
     }
 
     # Copy state file into destroot for archiving

Modified: branches/gsoc10-configfiles/base/src/package1.0/portarchivefetch.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/package1.0/portarchivefetch.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/package1.0/portarchivefetch.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -47,7 +47,8 @@
 
 options archive_sites archivefetch.user archivefetch.password \
     archivefetch.use_epsv archivefetch.ignore_sslcert \
-    archive_sites.mirror_subdir
+    archive_sites.mirror_subdir archivefetch.pubkeys \
+    archive.subdir
 
 # user name & password
 default archivefetch.user ""
@@ -56,13 +57,24 @@
 default archivefetch.use_epsv no
 # Ignore SSL certificate
 default archivefetch.ignore_sslcert no
+default archivefetch.pubkeys {$archivefetch_pubkeys}
 
 default archive_sites macports_archives
 default archive_sites.listfile {"archive_sites.tcl"}
 default archive_sites.listpath {"port1.0/fetch"}
+default archive.subdir {[portarchivefetch::get_archive_subdir]}
 
 set_ui_prefix
 
+proc portarchivefetch::get_archive_subdir {} {
+    set archs [get_canonical_archs]
+    if {[llength $archs] > 1} {
+        return [file join [option os.platform]_[option os.major] "universal" [option name]]
+    } else {
+        return [file join [option os.platform]_[option os.major] $archs [option name]]
+    }
+}
+
 # Checks possible archive files to assemble url lists for later fetching
 proc portarchivefetch::checkarchivefiles {urls} {
     global all_archive_files archivefetch.fulldestpath \
@@ -70,11 +82,7 @@
     upvar $urls fetch_urls
 
     # Define archive directory, file, and path
-    if {[llength [get_canonical_archs]] > 1} {
-        set archivefetch.fulldestpath [file join ${portarchivepath} [option os.platform] "universal"]
-    } else {
-        set archivefetch.fulldestpath [file join ${portarchivepath} [option os.platform] [get_canonical_archs]]
-    }
+    set archivefetch.fulldestpath [file join ${portarchivepath} [option archive.subdir]]
 
     set unsupported 0
     set found 0
@@ -125,7 +133,7 @@
 # Perform a standard fetch, assembling fetch urls from
 # the listed url variable and associated archive file
 proc portarchivefetch::fetchfiles {args} {
-    global archivefetch.fulldestpath UI_PREFIX
+    global portarchivepath archivefetch.fulldestpath UI_PREFIX
     global archivefetch.user archivefetch.password archivefetch.use_epsv \
            archivefetch.ignore_sslcert
     global portverbose ports_binary_only
@@ -141,7 +149,18 @@
             }
         }
     }
+    set incoming_path [file join ${portarchivepath} incoming]
+    if {![file isdirectory $incoming_path]} {
+        if {[catch {file mkdir $incoming_path} result]} {
+            elevateToRoot "archivefetch"
+            set elevated yes
+            if {[catch {file mkdir $incoming_path} result]} {
+                return -code error [format [msgcat::mc "Unable to create archive fetch path: %s"] $result]
+            }
+        }
+    }
     chownAsRoot ${archivefetch.fulldestpath}
+    chownAsRoot $incoming_path
     if {[info exists elevated] && $elevated == yes} {
         dropPrivileges
     }
@@ -168,30 +187,64 @@
             if {![file writable ${archivefetch.fulldestpath}]} {
                 return -code error [format [msgcat::mc "%s must be writable"] ${archivefetch.fulldestpath}]
             }
+            if {![file writable $incoming_path]} {
+                return -code error [format [msgcat::mc "%s must be writable"] $incoming_path]
+            }
             if {!$sorted} {
                 portfetch::sortsites archivefetch_urls {} archive_sites
                 set sorted yes
             }
             if {![info exists urlmap($url_var)]} {
                 ui_error [format [msgcat::mc "No defined site for tag: %s, using archive_sites"] $url_var]
-                set urlmap($url_var) $archive_sites
+                set urlmap($url_var) $urlmap(archive_sites)
             }
             unset -nocomplain fetched
             foreach site $urlmap($url_var) {
-                ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $archive $site]"
+                if {[string index $site end] != "/"} {
+                    append site "/[option archive.subdir]"
+                } else {
+                    append site [option archive.subdir]
+                }
+                ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $archive ${site}]"
                 set file_url [portfetch::assemble_url $site $archive]
                 set effectiveURL ""
-                if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${archivefetch.fulldestpath}/${archive}.TMP} result] &&
-                    ![catch {file rename -force "${archivefetch.fulldestpath}/${archive}.TMP" "${archivefetch.fulldestpath}/${archive}"} result]} {
+                if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} {"${incoming_path}/${archive}.TMP"}} result]} {
                     # Successful fetch
                     set fetched 1
                     break
                 } else {
                     ui_debug "[msgcat::mc "Fetching archive failed:"]: $result"
-                    file delete -force "${archivefetch.fulldestpath}/${archive}.TMP"
+                    file delete -force "${incoming_path}/${archive}.TMP"
                 }
             }
             if {[info exists fetched]} {
+                # there should be an rmd160 digest of the archive signed with one of the trusted keys
+                set signature "${incoming_path}/${archive}.rmd160"
+                ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] ${archive}.rmd160 $site]"
+                # reusing $file_url from the last iteration of the loop above
+                if {[catch {eval curl fetch --effective-url effectiveURL $fetch_options {${file_url}.rmd160} {$signature}} result]} {
+                    ui_debug "$::errorInfo"
+                    return -code error "Failed to fetch signature for archive: $result"
+                }
+                set verified 0
+                foreach pubkey [option archivefetch.pubkeys] {
+                    set openssl [findBinary openssl $portutil::autoconf::openssl_path]
+                    if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature $signature "${incoming_path}/${archive}.TMP"} result]} {
+                        set verified 1
+                        break
+                    } else {
+                        ui_debug "failed verification with key $pubkey"
+                        ui_debug "openssl output: $result"
+                    }
+                }
+                if {!$verified} {
+                    return -code error "Failed to verify signature for archive!"
+                }
+                if {[catch {file rename -force "${incoming_path}/${archive}.TMP" "${archivefetch.fulldestpath}/${archive}"} result]} {
+                    ui_debug "$::errorInfo"
+                    return -code error "Failed to move downloaded archive into place: $result"
+                }
+                file delete -force $signature
                 return 0
             }
         } else {
@@ -207,19 +260,20 @@
 
 # Initialize archivefetch target and call checkfiles.
 proc portarchivefetch::archivefetch_init {args} {
-    variable archivefetch_urls
-
     if {[option portarchivemode] != "yes"} {
         return -code error "Archive mode is not enabled!"
     }
-
-    portarchivefetch::checkfiles archivefetch_urls
 }
 
 proc portarchivefetch::archivefetch_start {args} {
-    global UI_PREFIX name
-
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching archive for %s"] $name]"
+    variable archivefetch_urls
+    global UI_PREFIX name all_archive_files ports_source_only
+    if {![tbool ports_source_only]} {
+        portarchivefetch::checkfiles archivefetch_urls
+    }
+    if {[info exists all_archive_files] && [llength $all_archive_files] > 0} {
+        ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching archive for %s"] $name]"
+    }
 }
 
 # Main archive fetch routine
@@ -229,5 +283,7 @@
     if {[info exists all_archive_files] && [llength $all_archive_files] > 0} {
         # Fetch the files
         return [portarchivefetch::fetchfiles]
+    } else {
+        return 0
     }
 }

Modified: branches/gsoc10-configfiles/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/package1.0/portunarchive.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/package1.0/portunarchive.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -73,11 +73,7 @@
 
     # Define archive directory, file, and path
     if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
-        if {[llength [get_canonical_archs]] > 1} {
-            set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] "universal"]
-        } else {
-            set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] [get_canonical_archs]]
-        }
+        set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option archive.subdir]]
     } else {
         set unarchive.fullsrcpath ${unarchive.srcpath}
     }
@@ -103,7 +99,7 @@
                 set archstring [join [get_canonical_archs] -]
                 set unarchive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${unarchive.type}"
                 set unarchive.path "[file join ${unarchive.fullsrcpath} ${unarchive.file}]"
-                if {[file exist ${unarchive.path}]} {
+                if {[file isfile ${unarchive.path}]} {
                     set found 1
                     break
                 } else {

Modified: branches/gsoc10-configfiles/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/gsoc10-configfiles/base/src/pextlib1.0/Pextlib.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/pextlib1.0/Pextlib.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -94,10 +94,10 @@
 {
 	char *d, *dest;
 	const char *s;
-	int slen, dlen;
+	size_t dlen;
 
 	s = source;
-	slen = dlen = strlen(source) * 2 + 1;
+	dlen = strlen(source) * 2 + 1;
 	d = dest = malloc(dlen);
 	if (dest == NULL) {
 		return NULL;
@@ -132,8 +132,9 @@
 {
 	const char ui_proc_start[] = "ui_info [subst -nocommands -novariables {";
 	const char ui_proc_end[] = "}]";
-	char *script, *string, *p;
-	int scriptlen, len, rval;
+	char *script, *string;
+	size_t scriptlen, len, remaining;
+	int rval;
 
 	string = ui_escape(mesg);
 	if (string == NULL)
@@ -144,14 +145,14 @@
 	script = malloc(scriptlen);
 	if (script == NULL)
 		return TCL_ERROR;
-	else
-		p = script;
 
 	memcpy(script, ui_proc_start, sizeof(ui_proc_start));
-	strcat(script, string);
-	strcat(script, ui_proc_end);
+	remaining = scriptlen - sizeof(ui_proc_start);
+	strncat(script, string, remaining);
+	remaining -= len;
+	strncat(script, ui_proc_end, remaining);
 	free(string);
-	rval = Tcl_EvalEx(interp, script, scriptlen - 1, 0);
+	rval = Tcl_EvalEx(interp, script, -1, 0);
 	free(script);
 	return rval;
 }
@@ -274,7 +275,7 @@
 {
 	Tcl_Obj *tcl_result;
 	char *tcl_mask, *p;
-	const size_t stringlen = 4; /* 3 digits & \0 */
+	const size_t stringlen = 5; /* 4 digits & \0 */
 	int i;
 	mode_t *set;
 	mode_t newmode;
@@ -296,23 +297,18 @@
 
 	oldmode = umask(newmode);
 
-	tcl_mask = malloc(stringlen); /* 3 digits & \0 */
+	tcl_mask = calloc(1, stringlen); /* 4 digits & \0 */
 	if (!tcl_mask) {
 		return TCL_ERROR;
 	}
 
 	/* Totally gross and cool */
-	p = tcl_mask + stringlen;
-	*p = '\0';
+	p = tcl_mask + stringlen - 1;
 	for (i = stringlen - 1; i > 0; i--) {
 		p--;
 		*p = (oldmode & 7) + '0';
 		oldmode >>= 3;
 	}
-	if (*p != '0') {
-		p--;
-		*p = '0';
-	}
 
 	tcl_result = Tcl_NewStringObj(p, -1);
 	free(tcl_mask);

Modified: branches/gsoc10-configfiles/base/src/pextlib1.0/curl.c
===================================================================
--- branches/gsoc10-configfiles/base/src/pextlib1.0/curl.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/pextlib1.0/curl.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -398,7 +398,7 @@
 
 		if (remotetime) {
 			theCurlCode = curl_easy_getinfo(theHandle, CURLINFO_FILETIME, &theFileTime);
-			if (theFileTime > 0) {
+			if (theCurlCode == CURLE_OK && theFileTime > 0) {
 				struct utimbuf times;
 				times.actime = (time_t)theFileTime;
 				times.modtime = (time_t)theFileTime;

Modified: branches/gsoc10-configfiles/base/src/pextlib1.0/strsed.c
===================================================================
--- branches/gsoc10-configfiles/base/src/pextlib1.0/strsed.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/pextlib1.0/strsed.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -592,6 +592,12 @@
      */
 
     do {
+#ifdef HS_REGEX
+	    /* XXX Not even trying to use custom memory routines */
+	    if (!(exp_regs = calloc(str_len, sizeof(regmatch_t)))) {
+		return 0;
+	    }
+#endif
 	if (match_all){
 	    /* Fake a match instead of calling re_search() or regexec(). */
 	    match = 1;
@@ -605,10 +611,6 @@
 	    match = re_search(&re_comp_buf, str, str_len, 0, str_len, &regs);
 #endif
 #ifdef HS_REGEX
-	    /* XXX Not even trying to use custom memory routines */
-	    if (!(exp_regs = calloc(str_len, sizeof(regmatch_t)))) {
-		return 0;
-	    }
 	    match = regexec(&exp, str, str_len, exp_regs, 0) ? NO_MATCH : 1;
 #endif
 	}

Modified: branches/gsoc10-configfiles/base/src/pextlib1.0/xinstall.c
===================================================================
--- branches/gsoc10-configfiles/base/src/pextlib1.0/xinstall.c	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/pextlib1.0/xinstall.c	2010-07-13 14:41:56 UTC (rev 69682)
@@ -146,7 +146,7 @@
 {
 	struct stat from_sb, to_sb;
 	mode_t *set;
-	u_long fset;
+	u_long fset = 0;
 	int no_target, rval;
 	u_int iflags;
 	char *flags, *curdir;
@@ -1026,6 +1026,7 @@
 		if (wait(&status) == -1 || status) {
 			serrno = errno;
 			(void)unlink(to_name);
+			errno = serrno;
 			return;
 		}
 	}

Modified: branches/gsoc10-configfiles/base/src/port/port.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port/port.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port/port.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -267,9 +267,9 @@
             set ivariants [lindex $i 3]
             set iactive [lindex $i 4]
             if { $iactive == 0 } {
-                puts "  $iname ${iversion}_${irevision}${ivariants}"
+                puts "  $iname @${iversion}_${irevision}${ivariants}"
             } elseif { $iactive == 1 } {
-                puts "  $iname ${iversion}_${irevision}${ivariants} (active)"
+                puts "  $iname @${iversion}_${irevision}${ivariants} (active)"
             }
         }
         return -code error "Registry error: Please specify the full version as recorded in the port registry."
@@ -858,6 +858,7 @@
             fatal "port installed failed: $result"
         }
     }
+    registry::open_dep_map
     set results {}
     foreach i $ilist {
         set iname [lindex $i 0]
@@ -2225,7 +2226,7 @@
 
             set i [lindex $ilist 0]
             set regref [registry::entry open $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
-            if {[registry::run_target $regref activate [array get options]]} {
+            if {[$regref installtype] == "image" && [registry::run_target $regref activate [array get options]]} {
                 continue
             }
         }
@@ -2262,7 +2263,7 @@
             set ivariants [lindex $i 3]
             if {$composite_version == "" || $composite_version == "${iversion}_${irevision}${ivariants}"} {
                 set regref [registry::entry open $portname $iversion $irevision $ivariants [lindex $i 5]]
-                if {[registry::run_target $regref deactivate [array get options]]} {
+                if {[$regref installtype] == "image" && [registry::run_target $regref deactivate [array get options]]} {
                     continue
                 }
             }
@@ -2406,6 +2407,7 @@
 
 
 proc action_setrequested { action portlist opts } {
+    global macports::registry.format
     set status 0
     if {[require_portlist portlist]} {
         return 1
@@ -2414,11 +2416,14 @@
     set val [string equal $action setrequested]
     foreachport $portlist {
         set composite_version [composite_version $portversion [array get variations]]
-        if {![catch {set ilist [registry::installed $portname $composite_version]}]} {
+        if {![catch {set ilist [registry::installed $portname $composite_version]} result]} {
             ui_info "Setting requested flag for $portname to $val"
             foreach i $ilist {
-                set regref [registry::entry open $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
+                set regref [registry::open_entry $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
                 registry::property_store $regref requested $val
+                if {${macports::registry.format} != "receipt_sqlite"} {
+                    registry::write_entry $regref
+                }
             }
         } else {
             global errorInfo
@@ -2584,6 +2589,7 @@
     if {[require_portlist portlist]} {
         return 1
     }
+    set separator ""
 
     foreachport $portlist {
         if {[info exists options(ports_${action}_no-build)] && [string is true -strict $options(ports_${action}_no-build)]} {
@@ -2647,8 +2653,10 @@
             ui_warn "port ${action} --index does not work with the 'current' pseudo-port"
             continue
         }
+        set portname $portinfo(name)
 
         set deplist {}
+        set deps_output {}
         set ndeps 0
         array set labeldict {depends_fetch Fetch depends_extract Extract depends_build Build depends_lib Library depends_run Runtime}
         # get list of direct deps
@@ -2665,7 +2673,7 @@
                 }
                 if {$action == "deps"} {
                     set label "$labeldict($type) Dependencies"
-                    puts [wraplabel $label [join $deplist ", "] 0 [string repeat " " 22]]
+                    lappend deps_output [wraplabel $label [join $deplist ", "] 0 [string repeat " " 22]]
                     incr ndeps [llength $deplist]
                     set deplist {}
                 }
@@ -2680,11 +2688,16 @@
             set variants {}
         }
 
+        puts -nonewline $separator
         if {$action == "deps"} {
             if {$ndeps == 0} {
                 ui_notice "$portname @${version}_${revision}${variants} has no dependencies."
+            } else {
+                ui_notice "Full Name: $portname @${version}_${revision}${variants}"
+                puts [join $deps_output "\n"]
             }
-            return $status
+            set separator "--\n"
+            continue
         }
 
         set toplist $deplist
@@ -2779,6 +2792,7 @@
             incr cur_pos
             set pos_stack [lreplace $pos_stack end end $cur_pos]
         }
+        set separator "--\n"
     }
     return $status
 }
@@ -2934,7 +2948,7 @@
 
     set num_outdated 0
     if { [llength $ilist] > 0 } {
-        foreach i $ilist {
+        foreach i [portlist_sortint $ilist] {
         
             # Get information about the installed port
             set portname [lindex $i 0]
@@ -2986,10 +3000,12 @@
                 set comp_result [rpm-vercomp $installed_revision $latest_revision]
             }
             set reason ""
-            if {$comp_result == 0 && $epoch_comp_result != 0} {
-                set reason { (epoch $installed_epoch $relation $latest_epoch)}
+            if {$epoch_comp_result != 0} {
+                if {($comp_result >= 0 && $epoch_comp_result < 0) || ($comp_result <= 0 && $epoch_comp_result > 0)} {
+                    set reason { (epoch $installed_epoch $relation $latest_epoch)}
+                }
                 set comp_result $epoch_comp_result
-            } elseif {$comp_result == 0 && $epoch_comp_result == 0} {
+            } elseif {$comp_result == 0} {
                 set regref [registry::open_entry $portname $installed_version $installed_revision [lindex $i 3] $installed_epoch]
                 set os_platform_installed [registry::property_retrieve $regref os_platform]
                 set os_major_installed [registry::property_retrieve $regref os_major]
@@ -3449,7 +3465,11 @@
                     # We need it to evaluate the editor, and the editor
                     # may want stuff from it as well, like TERM.
                     array unset env_save; array set env_save [array get env]
-                    array unset env *; unsetenv *; array set env [array get boot_env]
+                    array unset env *
+                    if {${macports::macosx_version} == "10.5"} {
+                        unsetenv *
+                    }
+                    array set env [array get boot_env]
                     
                     # Find an editor to edit the portfile
                     set editor ""
@@ -3475,7 +3495,11 @@
                     }
                     
                     # Restore internal MacPorts environment
-                    array unset env *; unsetenv *; array set env [array get env_save]
+                    array unset env *
+                    if {${macports::macosx_version} == "10.5"} {
+                        unsetenv *
+                    }
+                    array set env [array get env_save]
                 }
 
                 dir {
@@ -3566,7 +3590,6 @@
     if {[require_portlist portlist]} {
         return 1
     }
-    set target $action
     foreachport $portlist {
         # If we have a url, use that, since it's most specific
         # otherwise try to map the portname to a url
@@ -3611,8 +3634,12 @@
             set options(ports_version_glob) $portversion
         }
         # if installing, mark the port as explicitly requested
-        if {$target == "install"} {
+        if {$action == "install"} {
             set options(ports_requested) 1
+            # we actually activate as well
+            set target activate
+        } else {
+            set target $action
         }
         if {[catch {set workername [mportopen $porturl [array get options] [array get requested_variations]]} result]} {
             global errorInfo
@@ -3759,7 +3786,6 @@
     test        [list action_target         [ACTION_ARGS_PORTS]] \
     lint        [list action_target         [ACTION_ARGS_PORTS]] \
     submit      [list action_target         [ACTION_ARGS_PORTS]] \
-    trace       [list action_target         [ACTION_ARGS_PORTS]] \
     livecheck   [list action_target         [ACTION_ARGS_PORTS]] \
     distcheck   [list action_target         [ACTION_ARGS_PORTS]] \
     mirror      [list action_target         [ACTION_ARGS_PORTS]] \

Modified: branches/gsoc10-configfiles/base/src/port/portindex.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port/portindex.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port/portindex.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -38,14 +38,14 @@
 }
 
 proc pindex {portdir} {
-    global target oldfd oldmtime qindex fd directory archive outdir stats full_reindex \
+    global target oldfd oldmtime newest qindex fd directory archive outdir stats full_reindex \
            ui_options port_options save_prefix keepkeys
 
     # try to reuse the existing entry if it's still valid
     if {$full_reindex != "1" && $archive != "1" && [info exists qindex([string tolower [file tail $portdir]])]} {
         try {
             set mtime [file mtime [file join $directory $portdir Portfile]]
-            if {$oldmtime > $mtime} {
+            if {$oldmtime >= $mtime} {
                 set offset $qindex([string tolower [file tail $portdir]])
                 seek $oldfd $offset
                 gets $oldfd line
@@ -109,6 +109,10 @@
         set len [expr [string length $output] + 1]
         puts $fd [list $portinfo(name) $len]
         puts $fd $output
+        set mtime [file mtime [file join $directory $portdir Portfile]]
+        if {$mtime > $newest} {
+            set newest $mtime
+        }
     }
 }
 
@@ -188,6 +192,7 @@
 # open old index for comparison
 if {[file isfile $outpath] && [file isfile ${outpath}.quick]} {
     set oldmtime [file mtime $outpath]
+    set newest $oldmtime
     if {![catch {set oldfd [open $outpath r]}] && ![catch {set quickfd [open ${outpath}.quick r]}]} {
         if {![catch {set quicklist [read $quickfd]}]} {
             foreach entry [split $quicklist "\n"] {
@@ -196,6 +201,8 @@
         }
         close $quickfd
     }
+} else {
+    set newest 0
 }
 
 set tempportindex [mktemp "/tmp/mports.portindex.XXXXXXXX"]
@@ -213,6 +220,7 @@
 }
 close $fd
 file rename -force $tempportindex $outpath
+file mtime $outpath $newest
 mports_generate_quickindex $outpath
 puts "\nTotal number of ports parsed:\t$stats(total)\
       \nPorts successfully parsed:\t[expr $stats(total) - $stats(failed)]\

Modified: branches/gsoc10-configfiles/base/src/port1.0/fetch_common.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/fetch_common.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/fetch_common.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -218,7 +218,7 @@
         if {![info exists urlmap($url_var)]} {
             if {$url_var != $default_listvar} {
                 ui_error [format [msgcat::mc "No defined site for tag: %s, using $default_listvar"] $url_var]
-                set urlmap($url_var) [set $default_listvar]
+                set urlmap($url_var) $urlmap($default_listvar)
             } else {
                 set urlmap($url_var) {}
             }
@@ -232,6 +232,14 @@
             continue
         }
 
+        # can't do the ping with dropped privileges (though it works fine if we didn't start as root)
+        if {[getuid] == 0 && [geteuid] != 0} {
+            set oldeuid [geteuid]
+            set oldegid [getegid]
+            seteuid 0
+            setegid 0
+        }
+
         foreach site $urllist {
             regexp $hostregex $site -> host
 
@@ -269,6 +277,11 @@
             ui_debug "$host ping time is $pingtimes($host)"
         }
 
+        if {[info exists oldeuid]} {
+            setegid $oldegid
+            seteuid $oldeuid
+        }
+
         set pinglist {}
         foreach site $urllist {
             regexp $hostregex $site -> host
@@ -294,7 +307,7 @@
     foreach {url_var distfile} $fetch_urls {
         if {![info exists urlmap($url_var)]} {
             ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
-            set urlmap($url_var) $master_sites
+            set urlmap($url_var) $urlmap(master_sites)
         }
         foreach site $urlmap($url_var) {
             lappend urls $site

Modified: branches/gsoc10-configfiles/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/port_autoconf.tcl.in	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/port_autoconf.tcl.in	2010-07-13 14:41:56 UTC (rev 69682)
@@ -44,6 +44,7 @@
 	variable hg_path "@HG@"
 	variable gzip_path "@GZIP@"
 	variable lipo_path "@LIPO@"
+	variable openssl_path "@OPENSSL@"
 	variable patch_path "@PATCH@"
 	variable gnupatch_path "@GNUPATCH@"
 	variable rmdir_path "@RMDIR@"

Modified: branches/gsoc10-configfiles/base/src/port1.0/portactivate.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portactivate.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portactivate.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -54,17 +54,21 @@
 default activate.asroot no
 
 proc portactivate::activate_start {args} {
-    global prefix
-    if { ![file writable $prefix] } {
+    global prefix registry.installtype
+    if { ![file writable $prefix] && ${registry.installtype} == "image"} {
         # if install location is not writable, need root privileges
         elevateToRoot "activate"
     }
 }
 
 proc portactivate::activate_main {args} {
-    global env name version revision portvariants user_options PortInfo
-    registry_activate $name "${version}_${revision}${portvariants}" [array get user_options]
+    global env name version revision portvariants user_options PortInfo registry.installtype
 
+    # skip the actual activation in direct mode (we still want the notes and the pre/post procs)
+    if {${registry.installtype} == "image"} {
+        registry_activate $name "${version}_${revision}${portvariants}" [array get user_options]
+    }
+
     # Display notes at the end of the activation phase.
     if {[info exists PortInfo(notes)] && $PortInfo(notes) ne {}} {
         ui_msg ""

Modified: branches/gsoc10-configfiles/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portchecksum.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portchecksum.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -52,11 +52,14 @@
 set_ui_prefix
 
 # The list of the types of checksums we know.
-set checksum_types "md5 sha1 rmd160"
+set checksum_types "md5 sha1 rmd160 sha256"
 
 # The number of types we know.
 set checksum_types_count [llength $checksum_types]
 
+# types to recommend if none are specified in the portfile
+set default_checksum_types {sha1 rmd160}
+
 # Using global all_dist_files, parse the checksums and store them into the
 # global array checksums_array.
 #
@@ -172,6 +175,15 @@
     return [rmd160 file $file]
 }
 
+# calc_sha256
+#
+# Calculate the sha256 checksum for the given file.
+# Return the checksum.
+#
+proc portchecksum::calc_sha256 {file} {
+    return [sha256 file $file]
+}
+
 # checksum_start
 #
 # Target prerun procedure; simply prints a message about what we're doing.
@@ -188,7 +200,7 @@
 #
 proc portchecksum::checksum_main {args} {
     global UI_PREFIX all_dist_files checksum_types checksums_array portverbose checksum.skip
-    global usealtworkpath altprefix
+    global usealtworkpath altprefix default_checksum_types
 
     # If no files have been downloaded, there is nothing to checksum.
     if {![info exists all_dist_files]} {
@@ -227,11 +239,8 @@
             }
 
             # check that there is at least one checksum for the distfile.
-            if {![info exists checksums_array($distfile)]} {
+            if {![info exists checksums_array($distfile)] || [llength $checksums_array($distfile)] < 1} {
                 ui_error "[format [msgcat::mc "No checksum set for %s"] $distfile]"
-                foreach type $checksum_types {
-                    ui_info "[format [msgcat::mc "Distfile checksum: %s $type %s"] $distfile [calc_$type $fullpath]]"
-                }
                 set fail yes
             } else {
                 # retrieve the list of types/values from the array.
@@ -272,8 +281,16 @@
             if {![file isfile $fullpath] && (!$usealtworkpath && [file isfile "${altprefix}${fullpath}"])} {
                 set fullpath "${altprefix}${fullpath}"
             }
-            foreach type $checksum_types {
-                lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
+            if {![info exists checksums_array($distfile)] || [llength $checksums_array($distfile)] < 1} {
+                # no checksums specified; output the default set
+                foreach type $default_checksum_types {
+                    lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
+                }
+            } else {
+                # output just the types that were already used
+                foreach {type sum} $checksums_array($distfile) {
+                    lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
+                }
             }
         }
         ui_info "The correct checksum line may be:"

Modified: branches/gsoc10-configfiles/base/src/port1.0/portclean.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portclean.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portclean.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -69,8 +69,9 @@
         ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option name]]"
         clean_dist
     }
-    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
-        [info exists ports_clean_archive] && $ports_clean_archive == "yes"} {
+    if {([info exists ports_clean_all] && $ports_clean_all == "yes" || \
+        [info exists ports_clean_archive] && $ports_clean_archive == "yes")
+        && !$usealtworkpath} {
         ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option name]]"
         clean_archive
     }
@@ -80,7 +81,8 @@
          ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option name]]"
          clean_work
     }
-    if {([info exists ports_clean_logs] && $ports_clean_logs == "yes") || ($keeplogs == "no")} {
+    if {(([info exists ports_clean_logs] && $ports_clean_logs == "yes") || ($keeplogs == "no"))
+        && !$usealtworkpath} {
         clean_logs
     }
 
@@ -92,12 +94,14 @@
 # This is crude, but works.
 #
 proc portclean::clean_dist {args} {
-    global ports_force name distpath dist_subdir distfiles usealtworkpath portdbpath altprefix
+    global ports_force name distpath dist_subdir distfiles patchfiles usealtworkpath portdbpath altprefix
 
     # remove known distfiles for sure (if they exist)
     set count 0
     foreach file $distfiles {
-        set distfile [file join $distpath $file]
+        set distfile [getdistname $file]
+        ui_debug "Looking for $distfile"
+        set distfile [file join $distpath $distfile]
         if {[file isfile $distfile]} {
             ui_debug "Removing file: $distfile"
             if {[catch {delete $distfile} result]} {
@@ -121,6 +125,37 @@
         ui_debug "No distfiles found to remove at $distpath"
     }
 
+    set count 0
+    if {![info exists patchfiles]} {
+        set patchfiles ""
+    }
+    foreach file $patchfiles {
+        set patchfile [getdistname $file]
+        ui_debug "Looking for $patchfile"
+        set patchfile [file join $distpath $patchfile]
+        if {[file isfile $patchfile]} {
+            ui_debug "Removing file: $patchfile"
+            if {[catch {delete $patchfile} result]} {
+                ui_debug "$::errorInfo"
+                ui_error "$result"
+            }
+            incr count
+        }
+        if {!$usealtworkpath && [file isfile ${altprefix}${patchfile}]} {
+            ui_debug "Removing file: ${altprefix}${patchfile}"
+            if {[catch {delete ${altprefix}${patchfile}} result]} {
+                ui_debug "$::errorInfo"
+                ui_error "$result"
+            }
+            incr count
+        }
+    }
+    if {$count > 0} {
+        ui_debug "$count patchfile(s) removed."
+    } else {
+        ui_debug "No patchfiles found to remove at $distpath"
+    }
+
     # next remove dist_subdir if only needed for this port,
     # or if user forces us to
     set dirlist [list]
@@ -139,7 +174,11 @@
     # loop through directories
     set count 0
     foreach dir $dirlist {
-        set distdir [file join ${portdbpath} distfiles $dir]
+        if {$usealtworkpath} {
+            set distdir [file join ${altprefix}${portdbpath} distfiles $dir]
+        } else {
+            set distdir [file join ${portdbpath} distfiles $dir]
+        }
         if {[file isdirectory $distdir]} {
             ui_debug "Removing directory: ${distdir}"
             if {[catch {delete $distdir} result]} {
@@ -222,7 +261,7 @@
 
     # Define archive destination directory, target filename, regex for archive name
     if {$portarchivepath ne $workpath && $portarchivepath ne ""} {
-        set archivepath [file join $portarchivepath [option os.platform]]
+        set archivepath [file join $portarchivepath [option os.platform]_[option os.major]]
         set regexstring "^$name-\[\\-_a-zA-Z0-9\\.\]+_\[0-9\]*\[+\\-_a-zA-Z0-9\]*\[\\.\].*\[\\.\]\[a-z2\]+\$"
     }
 
@@ -243,7 +282,7 @@
 
     # Remove the archive files
     set count 0
-    if {![catch {set archivelist [glob [file join $archivepath * $fileglob]]} result]} {
+    if {![catch {set archivelist [glob [file join $archivepath * $name $fileglob]]} result]} {
         foreach path $archivelist {
             set file [file tail $path]
             # Make sure file is truly a port archive file, and not

Modified: branches/gsoc10-configfiles/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portconfigure.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portconfigure.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -226,12 +226,17 @@
     set ret {}
     foreach arch $archs {
         if {[lsearch -exact $supported_archs $arch] != -1} {
-            lappend ret $arch
-        } elseif {$arch == "x86_64" && [lsearch -exact $supported_archs "i386"] != -1 && [lsearch -exact $ret "i386"] == -1} {
-            lappend ret "i386"
-        } elseif {$arch == "ppc64" && [lsearch -exact $supported_archs "ppc"] != -1 && [lsearch -exact $ret "ppc"] == -1} {
-            lappend ret "ppc"
+            set add_arch $arch
+        } elseif {$arch == "x86_64" && [lsearch -exact $supported_archs "i386"] != -1} {
+            set add_arch "i386"
+        } elseif {$arch == "ppc64" && [lsearch -exact $supported_archs "ppc"] != -1} {
+            set add_arch "ppc"
+        } else {
+            continue
         }
+        if {[lsearch -exact $ret $add_arch] == -1} {
+            lappend ret $add_arch
+        }
     }
     return $ret
 }

Modified: branches/gsoc10-configfiles/base/src/port1.0/portdeactivate.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portdeactivate.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portdeactivate.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -49,15 +49,18 @@
 default deactivate.asroot no
 
 proc portdeactivate::deactivate_start {args} {
-    global prefix
-    if { ![file writable $prefix] } {
+    global prefix registry.installtype
+    if { ![file writable $prefix] && ${registry.installtype} == "image"} {
         # if install location is not writable, need root privileges
         elevateToRoot "deactivate"
     }
 }
 
 proc portdeactivate::deactivate_main {args} {
-    global name version revision portvariants user_options
-    registry_deactivate $name "${version}_${revision}${portvariants}" [array get user_options]
+    global name version revision portvariants user_options registry.installtype
+    # we still want to be able to run this target in direct mode for the pre/post procs
+    if {${registry.installtype} == "image"} {
+        registry_deactivate $name "${version}_${revision}${portvariants}" [array get user_options]
+    }
     return 0
 }

Modified: branches/gsoc10-configfiles/base/src/port1.0/portdistfiles.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portdistfiles.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portdistfiles.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -82,7 +82,7 @@
 
         # determine sites to download from
         if {![info exists urlmap($url_var)]} {
-            set urlmap($url_var) $master_sites
+            set urlmap($url_var) $urlmap(master_sites)
         }
         
         # determine URLs to download

Modified: branches/gsoc10-configfiles/base/src/port1.0/portextract.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portextract.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portextract.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -35,7 +35,6 @@
 package require portutil 1.0
 
 set org.macports.extract [target_new org.macports.extract portextract::extract_main]
-target_init ${org.macports.extract} portextract::extract_init
 target_provides ${org.macports.extract} extract
 target_requires ${org.macports.extract} fetch checksum
 target_prerun ${org.macports.extract} portextract::extract_start
@@ -73,9 +72,11 @@
     return $val
 }
 
-proc portextract::extract_init {args} {
-    global extract.only extract.dir extract.cmd extract.pre_args extract.post_args extract.mkdir use_bzip2 use_lzma use_xz use_zip use_7z use_dmg
+proc portextract::extract_start {args} {
+    global UI_PREFIX extract.dir extract.mkdir use_bzip2 use_lzma use_xz use_zip use_7z use_dmg
 
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option name]]"
+
     # should the distfiles be extracted to worksrcpath instead?
     if {[tbool extract.mkdir]} {
         global worksrcpath
@@ -83,7 +84,6 @@
         file mkdir ${worksrcpath}
         set extract.dir ${worksrcpath}
     }
-
     if {[tbool use_bzip2]} {
         option extract.cmd [findBinary bzip2 ${portutil::autoconf::bzip2_path}]
     } elseif {[tbool use_lzma]} {
@@ -93,13 +93,13 @@
     } elseif {[tbool use_zip]} {
         option extract.cmd [findBinary unzip ${portutil::autoconf::unzip_path}]
         option extract.pre_args -q
-        option extract.post_args "-d [option extract.dir]"
+        option extract.post_args "-d ${extract.dir}"
     } elseif {[tbool use_7z]} {
         option extract.cmd [binaryInPath "7za"]
         option extract.pre_args x
         option extract.post_args ""
     } elseif {[tbool use_dmg]} {
-        global distname
+        global distname extract.cmd
         set dmg_mount [mkdtemp "/tmp/mports.XXXXXXXX"]
         option extract.cmd [findBinary hdiutil ${portutil::autoconf::hdiutil_path}]
         option extract.pre_args attach
@@ -107,12 +107,6 @@
     }
 }
 
-proc portextract::extract_start {args} {
-    global UI_PREFIX
-
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option name]]"
-}
-
 proc portextract::extract_main {args} {
     global UI_PREFIX filespath worksrcpath extract.dir usealtworkpath altprefix
 
@@ -124,11 +118,11 @@
     foreach distfile [option extract.only] {
         ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile]"
         if {[file exists $filespath/$distfile]} {
-            option extract.args "$filespath/$distfile"
+            option extract.args "'$filespath/$distfile'"
         } elseif {![file exists "[option distpath]/$distfile"] && !$usealtworkpath && [file exists "${altprefix}[option distpath]/$distfile"]} {
-            option extract.args "${altprefix}[option distpath]/$distfile"
+            option extract.args "'${altprefix}[option distpath]/$distfile'"
         } else {
-            option extract.args "[option distpath]/$distfile"
+            option extract.args "'[option distpath]/$distfile'"
         }
         if {[catch {command_exec extract} result]} {
             return -code error "$result"

Modified: branches/gsoc10-configfiles/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portfetch.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portfetch.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -471,14 +471,14 @@
             }
             if {![info exists urlmap($url_var)]} {
                 ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
-                set urlmap($url_var) $master_sites
+                set urlmap($url_var) $urlmap(master_sites)
             }
             unset -nocomplain fetched
             foreach site $urlmap($url_var) {
                 ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $distfile $site]"
                 set file_url [portfetch::assemble_url $site $distfile]
                 set effectiveURL ""
-                if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} ${distpath}/${distfile}.TMP} result] &&
+                if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} {"${distpath}/${distfile}.TMP"}} result] &&
                     ![catch {file rename -force "${distpath}/${distfile}.TMP" "${distpath}/${distfile}"} result]} {
 
                     # Special hack to check for sourceforge mirrors, which don't return a proper error code on failure

Modified: branches/gsoc10-configfiles/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portinstall.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portinstall.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -62,8 +62,10 @@
     ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $name $version $revision $portvariants]"
     
     # start gsoc08-privileges
-    if { ![file writable $prefix] } {
+    if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
         # if install location is not writable, need root privileges to install
+        # Also elevate if started as root, since 'file writable' doesn't seem
+        # to take euid into account.
         elevateToRoot "install"
     }
     # end gsoc08-privileges

Modified: branches/gsoc10-configfiles/base/src/port1.0/portpatch.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portpatch.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portpatch.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -68,7 +68,7 @@
 }
 
 proc portpatch::patch_main {args} {
-    global UI_PREFIX
+    global UI_PREFIX usealtworkpath altprefix
 
     # First make sure that patchfiles exists and isn't stubbed out.
     if {![exists patchfiles] || [option patchfiles] == ""} {
@@ -83,6 +83,8 @@
             lappend patchlist [option filespath]/$patch_file
         } elseif {[file exists [option distpath]/$patch_file]} {
             lappend patchlist [option distpath]/$patch_file
+        } elseif {!$usealtworkpath && [file exists "${altprefix}[option distpath]/$patch_file"]} {
+            lappend patchlist "${altprefix}[option distpath]/$patch_file"
         } else {
             return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
         }

Modified: branches/gsoc10-configfiles/base/src/port1.0/porttrace.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/porttrace.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/porttrace.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -101,10 +101,12 @@
 # Disable the fence.
 # Unused yet.
 proc porttrace::trace_disable_fence {} {
-    global env
+    global env macosx_version
     if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
         unset env(DARWINTRACE_SANDBOX_BOUNDS)
-        unsetenv DARWINTRACE_SANDBOX_BOUNDS
+        if {$macosx_version == "10.5"} {
+            unsetenv DARWINTRACE_SANDBOX_BOUNDS
+        }
     }
 }
 
@@ -147,10 +149,12 @@
 proc porttrace::trace_stop {} {
     global os.platform
     if {${os.platform} == "darwin"} {
-        global env trace_fifo
+        global env trace_fifo macosx_version
         foreach var {DYLD_INSERT_LIBRARIES DYLD_FORCE_FLAT_NAMESPACE DARWINTRACE_LOG DARWINTRACE_SANDBOX_BOUNDS} {
             array unset env $var
-            unsetenv $var
+            if {$macosx_version == "10.5"} {
+                unsetenv $var
+            }
         }
 
         #kill socket

Modified: branches/gsoc10-configfiles/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/port1.0/portutil.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/port1.0/portutil.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -328,7 +328,7 @@
 # command_prefix    additional command prefix (typically pipe command)
 # command_suffix    additional command suffix (typically redirection)
 proc command_exec {command args} {
-    global ${command}.env ${command}.env_array ${command}.nice env
+    global ${command}.env ${command}.env_array ${command}.nice env macosx_version
     set notty ""
     set command_prefix ""
     set command_suffix ""
@@ -394,7 +394,9 @@
 
     # Restore the environment.
     array unset env *
-    unsetenv *
+    if {$macosx_version == "10.5"} {
+        unsetenv *
+    }
     array set env [array get saved_env]
 
     # Return as if system had been called directly.
@@ -1134,32 +1136,6 @@
     return
 }
 
-# filefindbypath
-# Provides searching of the standard path for included files
-proc filefindbypath {fname} {
-    global distpath filesdir worksrcdir portpath
-
-    if {[file readable $portpath/$fname]} {
-        return $portpath/$fname
-    } elseif {[file readable $portpath/$filesdir/$fname]} {
-        return $portpath/$filesdir/$fname
-    } elseif {[file readable $distpath/$fname]} {
-        return $distpath/$fname
-    }
-    return ""
-}
-
-# include
-# Source a file, looking for it along a standard search path.
-proc include {fname} {
-    set tgt [filefindbypath $fname]
-    if {[string length $tgt]} {
-        uplevel "source $tgt"
-    } else {
-        return -code error "Unable to find include file $fname"
-    }
-}
-
 # makeuserproc
 # This procedure re-writes the user-defined custom target to include
 # all the globals in its scope.  This is undeniably ugly, but I haven't
@@ -1490,7 +1466,11 @@
                 return 0
             } else {
                 # run the activate target but ignore its (completed) dependencies
-                return [target_run [lindex [dlist_search $dlist provides $target] 0]]
+                set result [target_run [lindex [dlist_search $dlist provides $target] 0]]
+                if {[getuid] == 0 && [geteuid] != 0} {
+                    setegid 0; seteuid 0
+                }
+                return $result
             }
         }
     }
@@ -1510,6 +1490,10 @@
 
     set dlist [dlist_eval $dlist "" target_run]
 
+    if {[getuid] == 0 && [geteuid] != 0} {
+        setegid 0; seteuid 0
+    }
+
     if {[llength $dlist] > 0} {
         # somebody broke!
         set errstring "Warning: the following items did not execute (for $name):"
@@ -1531,9 +1515,6 @@
     global workpath worksymlink place_worksymlink name portpath ports_ignore_older ports_dryrun
     global usealtworkpath altprefix env applications_dir portbuildpath
 
-    # de-escalate privileges if MacPorts was started with sudo
-    dropPrivileges
-
     if {$usealtworkpath} {
          ui_warn_once "privileges" "MacPorts running without privileges.\
                 You may be unable to complete certain actions (e.g. install)."
@@ -1567,6 +1548,9 @@
         }
     }
 
+    # de-escalate privileges if MacPorts was started with sudo
+    dropPrivileges
+
     # flock Portfile
     set statefile [file join $workpath .macports.${name}.state]
     if {[file exists $statefile]} {
@@ -1579,6 +1563,7 @@
         if {!([info exists ports_ignore_older] && $ports_ignore_older == "yes") && [file mtime $statefile] < [file mtime ${portpath}/Portfile]} {
             if {![tbool ports_dryrun]} {
                 ui_msg "Portfile changed since last build; discarding previous state."
+                chownAsRoot $portbuildpath
                 delete $workpath
                 file mkdir $workpath
             } else {
@@ -2361,15 +2346,17 @@
 #
 # @param path the file/directory to be chowned
 proc chownAsRoot {path} {
-    global euid macportsuser
+    global euid egid macportsuser
 
     if { [getuid] == 0 } {
         if {[geteuid] != 0} {
             # if started with sudo but have dropped the privileges
+            setegid $egid
             seteuid $euid
             ui_debug "euid changed to: [geteuid]"
             chown  ${path} ${macportsuser}
             ui_debug "chowned $path to $macportsuser"
+            setegid [uname_to_gid "$macportsuser"]
             seteuid [name_to_uid "$macportsuser"]
             ui_debug "euid changed to: [geteuid]"
         } else {
@@ -2385,14 +2372,16 @@
 # @param file the file in question
 # @param attributes the attributes for the file
 proc fileAttrsAsRoot {file attributes} {
-    global euid macportsuser
+    global euid egid macportsuser
     if {[getuid] == 0} {
         if {[geteuid] != 0} {
             # Started as root, but not root now
+            setegid $egid
             seteuid $euid
             ui_debug "euid changed to: [geteuid]"
             ui_debug "setting attributes on $file"
             eval file attributes {$file} $attributes
+            setegid [uname_to_gid "$macportsuser"]
             seteuid [name_to_uid "$macportsuser"]
             ui_debug "euid changed to: [geteuid]"
         } else {
@@ -2583,6 +2572,25 @@
     }
 }
 
+# check that the selected archs are supported
+proc check_supported_archs {} {
+    global supported_archs build_arch universal_archs configure.build_arch configure.universal_archs name
+    if {$supported_archs == "noarch"} {
+        return 0
+    } elseif {[variant_exists universal] && [variant_isset universal]} {
+        if {[llength ${configure.universal_archs}] > 1 || $universal_archs == ${configure.universal_archs}} {
+            return 0
+        } else {
+            ui_error "$name cannot be installed for the configured universal_archs '$universal_archs' because it only supports the arch(s) '$supported_archs'."
+            return 1
+        }
+    } elseif {$build_arch == "" || ${configure.build_arch} != ""} {
+        return 0
+    }
+    ui_error "$name cannot be installed for the configured build_arch '$build_arch' because it only supports the arch(s) '$supported_archs'."
+    return 1
+}
+
 # check if the installed xcode version is new enough
 proc _check_xcode_version {} {
     global os.subplatform macosx_version xcodeversion
@@ -2616,3 +2624,33 @@
     }
     return 0
 }
+
+# check if we can unarchive this port
+proc _archive_available {} {
+    global name version revision portvariants ports_source_only
+    global unarchive.srcpath workpath
+
+    if {[option portarchivemode] != "yes" || [tbool ports_source_only]} {
+        return 0
+    }
+
+    # Define archive directory, file, and path
+    if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
+        set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option archive.subdir]]
+    } else {
+        set unarchive.fullsrcpath ${unarchive.srcpath}
+    }
+
+    set found 0
+    foreach unarchive.type [option portarchivetype] {
+        if {[catch {archiveTypeIsSupported ${unarchive.type}} errmsg] == 0} {
+            set archstring [join [get_canonical_archs] -]
+            set unarchive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${unarchive.type}"
+            if {[file isfile [file join ${unarchive.fullsrcpath} ${unarchive.file}]]} {
+                set found 1
+                break
+            }
+        }
+    }
+    return $found
+}

Modified: branches/gsoc10-configfiles/base/src/registry2.0/portimage.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/registry2.0/portimage.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/registry2.0/portimage.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -381,11 +381,13 @@
 ##
 ## @param [in] srcfile path to file in image
 ## @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] {
         link {
             ui_debug "activating link: $dstfile"
             file copy -force -- $srcfile $dstfile
+            return 1
         }
         directory {
             # Don't recursively copy directories
@@ -398,6 +400,7 @@
                 # set mtime on installed element
                 file mtime $dstfile [file mtime $srcfile]
             }
+            return 0
         }
         default {
             ui_debug "activating file: $dstfile"
@@ -406,6 +409,7 @@
                 ui_debug "hardlinking $srcfile to $dstfile failed, symlinking instead"
                 file link -symbolic $dstfile $srcfile
             }
+            return 1
         }
     }
 }
@@ -486,7 +490,7 @@
                             # the registry
                             if { $owner != {} && $owner != $port } {
                                 throw registry::image-error "Image error: $file is being used by the active [$owner name] port.  Please deactivate this port first, or use 'port -f activate [$port name]' to force the activation."
-                            } elseif { $owner == {} && ![catch {[file type $file]}] } {
+                            } elseif { $owner == {} && ![catch {file type $file}] } {
                                 throw registry::image-error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port [$port name]. Use 'port -f activate [$port name]' to force the activation."
                             }
                         }
@@ -523,16 +527,17 @@
             # directories are before their elements.
             # We don't have to do this as mentioned above, but it makes the
             # debug output of activate make more sense.
-            set theList [lsort -increasing -unique $files]
+            set files [lsort -increasing -unique $files]
             set rollback_filelist {}
             ui_msg "GSOC DBG: let's activate actual files"
             registry::write {
                 # Activate it, and catch errors so we can roll-back
                 try {
                     $port activate $imagefiles
-                    foreach file $theList {
-                        _activate_file "${imagedir}${file}" $file
-                        lappend rollback_filelist $file
+                    foreach file $files {
+                        if {[_activate_file "${imagedir}${file}" $file] == 1} {
+                            lappend rollback_filelist $file
+                        }
                     }
                 } catch {*} {
                     ui_debug "Activation failed, rolling back."
@@ -637,13 +642,14 @@
         # are before their elements.
         # We don't have to do this as mentioned above, but it makes the
         # debug output of activate make more sense.
-        set theList [lsort -increasing -unique $files]
+        set files [lsort -increasing -unique $files]
         set rollback_filelist {}
 
         # Activate it, and catch errors so we can roll-back
-        if { [catch { foreach file $theList {
-                        _activate_file "${imagedir}${file}" $file
-                        lappend rollback_filelist $file
+        if { [catch { foreach file $files {
+                        if {[_activate_file "${imagedir}${file}" $file] == 1} {
+                            lappend rollback_filelist $file
+                        }
                     }} result]} {
             ui_debug "Activation failed, rolling back."
             _deactivate_contents $name $rollback_filelist yes yes
@@ -703,14 +709,14 @@
             # instead of the paths we currently have, users' registry won't
             # match and activate will say that some file exists but doesn't
             # belong to any port.
-            set theFile [file normalize $file]
-            lappend files $theFile
+            # The custom realpath proc is necessary because file normalize
+            # does not resolve symlinks on OS X < 10.6
+            set directory [realpath [file dirname $file]]
+            lappend files [file join $directory [file tail $file]]
 
-            # Split out the filename's subpaths and add them to the image list as
-            # well. The realpath call is necessary because file normalize
-            # does not resolve symlinks on OS X < 10.6
-            set directory [realpath [file dirname $theFile]]
-            while { [lsearch -exact $files $directory] == -1 } { 
+            # Split out the filename's subpaths and add them to the image list
+            # as well.
+            while { [lsearch -exact $files $directory] == -1 } {
                 lappend files $directory
                 set directory [file dirname $directory]
             }
@@ -722,18 +728,18 @@
     # Sort the list in reverse order, removing duplicates.
     # Since the list is sorted in reverse order, we're sure that directories
     # are after their elements.
-    set theList [lsort -decreasing -unique $files]
+    set files [lsort -decreasing -unique $files]
 
     # Remove all elements.
     if {$use_reg2 && !$rollback} {
         registry::write {
             $port deactivate $imagefiles
-            foreach file $theList {
+            foreach file $files {
                 _deactivate_file $file
             }
         }
     } else {
-        foreach file $theList {
+        foreach file $files {
             _deactivate_file $file
         }
     }

Modified: branches/gsoc10-configfiles/base/src/registry2.0/portuninstall.tcl
===================================================================
--- branches/gsoc10-configfiles/base/src/registry2.0/portuninstall.tcl	2010-07-13 14:23:35 UTC (rev 69681)
+++ branches/gsoc10-configfiles/base/src/registry2.0/portuninstall.tcl	2010-07-13 14:41:56 UTC (rev 69682)
@@ -108,18 +108,18 @@
     } elseif { [llength $ilist] == 1 } {
         if {$use_reg2} {
             set port [lindex $ilist 0]
-            if {$v == ""} {
-                set v "[$port version]_[$port revision][$port variants]"
-            }
+            set version [$port version]
+            set revision [$port revision]
+            set variants [$port variants]
         } else {
             set version [lindex [lindex $ilist 0] 1]
             set revision [lindex [lindex $ilist 0] 2]
             set variants [lindex [lindex $ilist 0] 3]
             set active [lindex [lindex $ilist 0] 4]
-            if {$v == ""} {
-                set v "${version}_${revision}${variants}"
-            }
         }
+        if {$v == ""} {
+            set v "${version}_${revision}${variants}"
+        }
     } else {
         throw registry::invalid "Registry error: $portname not registered as installed"
     }
@@ -147,7 +147,9 @@
                 ui_msg "For $portname @${v}: skipping deactivate (dry run)"
             } else {
                 if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $port deactivate $optionslist]} {
-                    portimage::deactivate $portname $v [array get options]
+                    if {[$port installtype] == "image"} {
+                        portimage::deactivate $portname $v [array get options]
+                    }
                 }
             }
         }
@@ -338,17 +340,17 @@
                     catch {file copy $fname "${fname}${bak_suffix}"}
                 }
             }
-            
-            set theFile [file normalize $fname]
-            if { [file exists $theFile] || (![catch {file type $theFile}] && [file type $theFile] == "link") } {
+
+            if { [file exists $fname] || (![catch {file type $fname}] && [file type $fname] == "link") } {
                 # Normalize the file path to avoid removing the intermediate
                 # symlinks (remove the empty directories instead)
-                lappend files $theFile
+                # The custom realpath proc is necessary because file normalize
+                # does not resolve symlinks on OS X < 10.6
+                set directory [realpath [file dirname $fname]]
+                lappend files [file join $directory [file tail $fname]]
     
                 # Split out the filename's subpaths and add them to the
-                # list as well. The realpath call is necessary because file normalize
-                # does not resolve symlinks on OS X < 10.6
-                set directory [realpath [file dirname $theFile]]
+                # list as well.
                 while { [lsearch -exact $files $directory] == -1 } { 
                     lappend files $directory
                     set directory [file dirname $directory]
@@ -359,10 +361,10 @@
         # Sort the list in reverse order, removing duplicates.
         # Since the list is sorted in reverse order, we're sure that directories
         # are after their elements.
-        set theList [lsort -decreasing -unique $files]
+        set files [lsort -decreasing -unique $files]
     
         # Remove all elements.
-        _uninstall_list $theList
+        _uninstall_list $files
     
         if {$use_reg2} {
             registry::entry delete $port
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100713/135eccc1/attachment-0001.html>


More information about the macports-changes mailing list