[50909] branches/new-help-system/base

raimue at macports.org raimue at macports.org
Tue May 12 10:37:20 PDT 2009


Revision: 50909
          http://trac.macports.org/changeset/50909
Author:   raimue at macports.org
Date:     2009-05-12 10:37:20 -0700 (Tue, 12 May 2009)
Log Message:
-----------
Merge with trunk

Modified Paths:
--------------
    branches/new-help-system/base/ChangeLog
    branches/new-help-system/base/LICENSE
    branches/new-help-system/base/aclocal.m4
    branches/new-help-system/base/configure
    branches/new-help-system/base/configure.ac
    branches/new-help-system/base/doc/macports.conf.in
    branches/new-help-system/base/doc/portfile.7
    branches/new-help-system/base/m4/foundation.m4
    branches/new-help-system/base/m4/pthread.m4
    branches/new-help-system/base/regen.sh
    branches/new-help-system/base/src/config.h.in
    branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c
    branches/new-help-system/base/src/macports1.0/macports.tcl
    branches/new-help-system/base/src/package1.0/portarchive.tcl
    branches/new-help-system/base/src/package1.0/portdpkg.tcl
    branches/new-help-system/base/src/package1.0/portmpkg.tcl
    branches/new-help-system/base/src/package1.0/portrpm.tcl
    branches/new-help-system/base/src/package1.0/portsrpm.tcl
    branches/new-help-system/base/src/package1.0/portunarchive.tcl
    branches/new-help-system/base/src/pextlib1.0/Makefile
    branches/new-help-system/base/src/pextlib1.0/Pextlib.c
    branches/new-help-system/base/src/port/port-help.tcl
    branches/new-help-system/base/src/port/port.tcl
    branches/new-help-system/base/src/port/portindex.tcl
    branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in
    branches/new-help-system/base/src/port1.0/portactivate.tcl
    branches/new-help-system/base/src/port1.0/portbuild.tcl
    branches/new-help-system/base/src/port1.0/portchecksum.tcl
    branches/new-help-system/base/src/port1.0/portclean.tcl
    branches/new-help-system/base/src/port1.0/portconfigure.tcl
    branches/new-help-system/base/src/port1.0/portdepends.tcl
    branches/new-help-system/base/src/port1.0/portdestroot.tcl
    branches/new-help-system/base/src/port1.0/portdistcheck.tcl
    branches/new-help-system/base/src/port1.0/portextract.tcl
    branches/new-help-system/base/src/port1.0/portfetch.tcl
    branches/new-help-system/base/src/port1.0/portinstall.tcl
    branches/new-help-system/base/src/port1.0/portlint.tcl
    branches/new-help-system/base/src/port1.0/portlivecheck.tcl
    branches/new-help-system/base/src/port1.0/portmain.tcl
    branches/new-help-system/base/src/port1.0/portmirror.tcl
    branches/new-help-system/base/src/port1.0/portpatch.tcl
    branches/new-help-system/base/src/port1.0/portsubmit.tcl
    branches/new-help-system/base/src/port1.0/porttest.tcl
    branches/new-help-system/base/src/port1.0/porttrace.tcl
    branches/new-help-system/base/src/port1.0/portutil.tcl
    branches/new-help-system/base/src/registry1.0/portimage.tcl
    branches/new-help-system/base/src/registry1.0/portuninstall.tcl
    branches/new-help-system/base/src/registry1.0/receipt_flat.tcl
    branches/new-help-system/base/src/registry1.0/registry.tcl
    branches/new-help-system/base/src/registry2.0/portimage.tcl
    branches/new-help-system/base/src/registry2.0/portuninstall.tcl
    branches/new-help-system/base/tests/test-macports.conf

Added Paths:
-----------
    branches/new-help-system/base/portmgr/bots/trac.rb

Removed Paths:
-------------
    branches/new-help-system/base/doc/TODO.txt
    branches/new-help-system/base/src/pextlib1.0/compat.c
    branches/new-help-system/base/src/pextlib1.0/compat.h

Property Changed:
----------------
    branches/new-help-system/base/


Property changes on: branches/new-help-system/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/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/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:49341-50867
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/new-help-system/base/ChangeLog
===================================================================
--- branches/new-help-system/base/ChangeLog	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/ChangeLog	2009-05-12 17:37:20 UTC (rev 50909)
@@ -5,6 +5,8 @@
 
 
 Release 1.8.0 (unreleased):
+    - port lint recognizes new top-level category php (#19329, ryandesign)
+
     - Do not print header lines when the quiet option -q is set
     (r48558, raimue)
 

Modified: branches/new-help-system/base/LICENSE
===================================================================
--- branches/new-help-system/base/LICENSE	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/LICENSE	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,5 +1,5 @@
 Copyright (c) 2002 - 2003, Apple Computer, Inc.
-Copyright (c) 2004 - 2007, The MacPorts Project.
+Copyright (c) 2004 - 2009, The MacPorts Project.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

Modified: branches/new-help-system/base/aclocal.m4
===================================================================
--- branches/new-help-system/base/aclocal.m4	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/aclocal.m4	2009-05-12 17:37:20 UTC (rev 50909)
@@ -241,7 +241,7 @@
  	dnl For ease of reading, run after gcc has been found/configured
  	AC_REQUIRE([AC_PROG_CC])
 
- 	AC_ARG_WITH(ports-dir, [AC_HELP_STRING([--with-ports-dir=DIR], [Specify alternate ports directory])], [ portsdir="$withval" ] )
+ 	AC_ARG_WITH(ports-dir, [AS_HELP_STRING([--with-ports-dir=DIR],[Specify alternate ports directory])], [ portsdir="$withval" ] )
 
 
  	AC_MSG_CHECKING([for ports tree])
@@ -297,7 +297,7 @@
 	dnl use ~/Library/Tcl as Tcl package directory
 		AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
-	AC_ARG_WITH(no-root-privileges, [AC_HELP_STRING([--with-no-root-privileges], [Specify that MacPorts should be installed in your home directory])], [ROOTPRIVS=$withval] )
+	AC_ARG_WITH(no-root-privileges, [AS_HELP_STRING([--with-no-root-privileges],[Specify that MacPorts should be installed in your home directory])], [ROOTPRIVS=$withval] )
 
 	if test "${ROOTPRIVS+set}" = set; then
 
@@ -336,7 +336,7 @@
 	dnl use it. otherwise default to platform defaults
        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
-	AC_ARG_WITH(macports-user, [AC_HELP_STRING([--with-macports-user=USER], [Specify user to drop privileges to, if possible, during compiles etc.])], [ RUNUSR=$withval ] )
+	AC_ARG_WITH(macports-user, [AS_HELP_STRING([--with-macports-user=USER],[Specify user to drop privileges to, if possible, during compiles etc.])], [ RUNUSR=$withval ] )
 	
 	AC_MSG_CHECKING([for macports user])
 	if test "x$RUNUSR" = "x" ; then
@@ -357,7 +357,7 @@
 	dnl use 0775 permissions for ${prefix} directories
         AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
-	AC_ARG_WITH(shared-directory, [AC_HELP_STRING([--with-shared-directory], [Use 0775 permissions for installed directories])], [ SHAREDIR=$withval ] )
+	AC_ARG_WITH(shared-directory, [AS_HELP_STRING([--with-shared-directory],[Use 0775 permissions for installed directories])], [ SHAREDIR=$withval ] )
 
 	if test "${SHAREDIR+set}" = set; then	
 		AC_MSG_CHECKING([whether to share the install directory with all members of the install group])
@@ -375,7 +375,7 @@
 	dnl use it. otherwise default to platform defaults
         AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
-	AC_ARG_WITH(install-user, [AC_HELP_STRING([--with-install-user=USER], [Specify user ownership of installed files])], [ DSTUSR=$withval ] )
+	AC_ARG_WITH(install-user, [AS_HELP_STRING([--with-install-user=USER],[Specify user ownership of installed files])], [ DSTUSR=$withval ] )
 	
 	AC_MSG_CHECKING([for install user])
 	if test "x$DSTUSR" = "x" ; then
@@ -393,7 +393,7 @@
 	dnl use it. otherwise default to platform defaults
         AC_REQUIRE([MP_CHECK_INSTALLUSER])
 
-	AC_ARG_WITH(install-group, [AC_HELP_STRING([--with-install-group=GROUP], [Specify group ownership of installed files])], [ DSTGRP=$withval ] )
+	AC_ARG_WITH(install-group, [AS_HELP_STRING([--with-install-group=GROUP],[Specify group ownership of installed files])], [ DSTGRP=$withval ] )
 
 	AC_MSG_CHECKING([for install group])
 	if test "x$DSTGRP" = "x" ; then
@@ -426,7 +426,7 @@
 	dnl otherwise use 0755
         AC_REQUIRE([MP_PATH_MPCONFIGDIR])
 
-	AC_ARG_WITH(directory-mode, [AC_HELP_STRING([--with-directory-mode=MODE], [Specify directory mode of installed directories])], [ DSTMODE=$withval ] )
+	AC_ARG_WITH(directory-mode, [AS_HELP_STRING([--with-directory-mode=MODE],[Specify directory mode of installed directories])], [ DSTMODE=$withval ] )
 	
 	AC_MSG_CHECKING([what permissions to use for installation directories])
 	if test "x$DSTMODE" = "x" ; then
@@ -442,7 +442,7 @@
 AC_DEFUN([MP_PATH_APPLICATIONS],[
         AC_REQUIRE([MP_CHECK_INSTALLUSER])
 
-    AC_ARG_WITH(applications-dir,[AC_HELP_STRING([--with-applications-dir], [Applications installation directory.])], MPAPPLICATIONSDIR=${withval})
+    AC_ARG_WITH(applications-dir,[AS_HELP_STRING([--with-applications-dir],[Applications installation directory.])], MPAPPLICATIONSDIR=${withval})
 
     oldprefix=$prefix
     if test "x$prefix" = "xNONE" ; then
@@ -468,7 +468,7 @@
 AC_DEFUN([MP_PATH_FRAMEWORKS],[
         AC_REQUIRE([MP_CHECK_INSTALLUSER])
 
-    AC_ARG_WITH(frameworks-dir,[AC_HELP_STRING([--with-frameworks-dir], [Frameworks installation directory.])], MPFRAMEWORKSDIR=${withval})
+    AC_ARG_WITH(frameworks-dir,[AS_HELP_STRING([--with-frameworks-dir],[Frameworks installation directory.])], MPFRAMEWORKSDIR=${withval})
 
     oldprefix=$prefix
     if test "x$prefix" = "xNONE" ; then
@@ -490,9 +490,9 @@
 #---------------------------------------
 AC_DEFUN([MP_UNIVERSAL_OPTIONS],[
 
-    AC_ARG_WITH(universal-target,[AC_HELP_STRING([--with-universal-target=MDT], [Universal MACOSX_DEPLOYMENT_TARGET version])], UNIVERSAL_TARGET=${withval})
-    AC_ARG_WITH(universal-sysroot,[AC_HELP_STRING([--with-universal-sysroot=SDK], [Universal SDK sysroot (with complete path)])], UNIVERSAL_SYSROOT=${withval})
-    AC_ARG_WITH(universal-archs,[AC_HELP_STRING([--with-universal-archs="CPU"], [Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
+    AC_ARG_WITH(universal-target,[AS_HELP_STRING([--with-universal-target=MDT],[Universal MACOSX_DEPLOYMENT_TARGET version])], UNIVERSAL_TARGET=${withval})
+    AC_ARG_WITH(universal-sysroot,[AS_HELP_STRING([--with-universal-sysroot=SDK],[Universal SDK sysroot (with complete path)])], UNIVERSAL_SYSROOT=${withval})
+    AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
 
 	MACOSX_MAJOR_VERSION=`$SW_VERS -productVersion | cut -f-2 -d.`
 
@@ -572,126 +572,6 @@
 	AC_SUBST([MD5_LIBS])
 ])
 
-dnl This macro checks for X11 presence. If the libraries are
-dnl present, so must the headers be. If nothing is present,
-dnl print a warning
-
-# MP_CHECK_X11
-# ---------------------
-AC_DEFUN([MP_CHECK_X11], [
-
-        # work around symbolic X11 link in /usr/include by providing explicit defaults
-        case "$host" in
-            *-*-darwin9*)
-                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
-                    x_includes="/usr/X11/include"
-                    x_libraries="/usr/X11/lib"
-                fi
-                ;;
-            *-*-darwin*)
-                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
-                    x_includes="/usr/X11R6/include"
-                    x_libraries="/usr/X11R6/lib"
-                fi
-                ;;
-        esac
-
-	AC_PATH_X
-	AC_PATH_XTRA
-
-	# Check for libX11
-	AC_CHECK_LIB([X11], [XOpenDisplay],[
-		has_x_runtime=yes
-		], [ has_x_runtime=no ], [$X_LIBS])
-
-# 	echo "------done---------"
-# 	echo "x_includes=${x_includes}"
-# 	echo "x_libraries=${x_libraries}"
-# 	echo "no_x=${no_x}"
-# 	echo "X_CFLAGS=${X_CFLAGS}"
-# 	echo "X_LIBS=${X_LIBS}"
-# 	echo "X_DISPLAY_MISSING=${X_DISPLAY_MISSING}"
-# 	echo "has_x_runtime=${has_x_runtime}"
-# 	echo "host_os=${host_os}"
-# 	echo "------done---------"
-
-	state=
-
-	case "__${has_x_runtime}__${no_x}__" in
-		"__no__yes__")
-		# either the user said --without-x, or it was not found
-		# at all (runtime or headers)
-			AC_MSG_WARN([X11 not available. You will not be able to use ports that use X11])
-			state=0
-			;;
-		"__yes__yes__")
-			state=1
-			;;
-		"__yes____")
-			state=2
-			;;
-		*)
-			state=3
-			;;
-	esac
-
-	case $host_os in
-		darwin*)	
-			case $state in
-				1)
-					cat <<EOF;
-Please install the X11 SDK packages from the
-Xcode Developer Tools CD
-EOF
-					AC_MSG_ERROR([Broken X11 install. No X11 headers])
-
-					;;
-				3)
-					cat <<EOF;
-Unknown configuration problem. Please install the X11 runtime
-and/or X11 SDK  packages from the Xcode Developer Tools CD
-EOF
-					AC_MSG_ERROR([Broken X11 install])
-					;;
-			esac
-			;;
-		*)	
-			case $state in
-				1)
-					cat <<EOF;
-Please install the X11 developer headers for your platform
-EOF
-					AC_MSG_ERROR([Broken X11 install. No X11 headers])
-
-					;;
-				3)
-					cat <<EOF;
-Unknown configuration problem. Please install the X11
-implementation for your platform
-EOF
-					AC_MSG_ERROR([Broken X11 install])
-					;;
-			esac
-			;;
-	esac
-
-])
-
-# MP_PROG_XAR
-#---------------------------------------
-AC_DEFUN([MP_PROG_XAR],[
-
-	AC_PATH_PROG([XAR], [xar], ,  [/usr/bin:/usr/sbin:/bin:/sbin])
-
-	if test "x$XAR" = "x" ; then
-		AC_CONFIG_SUBDIRS([src/programs/xar])
-		XAR='$(TOPSRCDIR)/src/programs/xar/xar'
-		REPLACEMENT_PROGS="$REPLACEMENT_PROGS xar"
-	fi
-
-	AC_SUBST(XAR)
-])
-
 # MP_PROG_DAEMONDO
 #---------------------------------------
 AC_DEFUN([MP_PROG_DAEMONDO],[
@@ -912,29 +792,6 @@
 	AC_SUBST(LDFLAGS_LIBCURL)
 ])
 
-# MP_LIBCURL_VERSION
-#	Determine the version of libcurl.
-#
-# Arguments:
-#	None.
-#
-# Requires:
-#	CURL must be set (AC_PATH_PROG(CURL, [curl], []))
-#
-# Results:
-#   sets libcurl_version to "0" or some number
-#---------------------------------------
-AC_DEFUN([MP_LIBCURL_VERSION],[
-	if test "x$CURL" = "x"; then
-		libcurl_version="0"
-	else
-		AC_MSG_CHECKING([libcurl version])
-		libcurl_version=`$CURL -V | sed '2,$d' | awk '{print $ 2}' | sed -e 's/\.//g' -e 's/-.*//g'`
-		AC_MSG_RESULT([$libcurl_version])
-	fi
-])
-
-
 dnl This macro tests if the compiler supports GCC's
 dnl __attribute__ syntax for unused variables/parameters
 AC_DEFUN([MP_COMPILER_ATTRIBUTE_UNUSED], [
@@ -1091,7 +948,7 @@
 #------------------------------------------------------------------------
 AC_DEFUN([MP_WERROR],[
 	AC_REQUIRE([AC_PROG_CC])
-	AC_ARG_ENABLE(werror, AC_HELP_STRING([--enable-werror], [Add -Werror to CFLAGS. Used for development.]), [enable_werror=${enableval}], [enable_werror=no])
+	AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],[Add -Werror to CFLAGS. Used for development.]), [enable_werror=${enableval}], [enable_werror=no])
 	if test x"$enable_werror" != "xno"; then
 		CFLAGS_WERROR="-Werror"
 	else

Modified: branches/new-help-system/base/configure
===================================================================
--- branches/new-help-system/base/configure	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/configure	2009-05-12 17:37:20 UTC (rev 50909)
@@ -673,12 +673,6 @@
 TCL_BIN_DIR
 TCL_VERSION
 READLINE_LIBS
-x11prefix
-X_EXTRA_LIBS
-X_LIBS
-X_PRE_LIBS
-X_CFLAGS
-XMKMF
 MD5_LIBS
 READLINK_IS_NOT_P1003_1A
 CPP
@@ -750,6 +744,8 @@
 LDFLAGS
 CFLAGS
 CC
+XCODE_SELECT
+DEFAULTS
 SW_VERS
 MACPORTS_VERSION
 target_os
@@ -819,8 +815,6 @@
 with_universal_target
 with_universal_sysroot
 with_universal_archs
-with_x11_prefix
-with_x
 enable_readline
 with_tcl
 with_tclinclude
@@ -855,8 +849,7 @@
 XAR
 OPEN
 OBJCPP
-CPP
-XMKMF'
+CPP'
 ac_subdirs_all='src/thread2.6
 src/sqlite-3.1.3'
 
@@ -1467,10 +1460,6 @@
 
   cat <<\_ACEOF
 
-X features:
-  --x-includes=DIR    X include files are in DIR
-  --x-libraries=DIR   X library files are in DIR
-
 System types:
   --build=BUILD     configure for building on BUILD [guessed]
   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
@@ -1520,9 +1509,6 @@
                           Universal SDK sysroot (with complete path)
   --with-universal-archs="CPU"
                           Universal CPU architectures (space separated)
-  --with-x11-prefix=PREFIX
-                          use PREFIX as the X11 base dir (default autodetect)
-  --with-x                use the X Window System
   --with-tcl              directory containing tcl configuration (tclConfig.sh)
   --with-tclinclude       directory containing the public Tcl header files.
   --with-tclpackage       Tcl package installation directory.
@@ -1558,7 +1544,6 @@
   OPEN        path to open command
   OBJCPP      Objective C preprocessor
   CPP         C preprocessor
-  XMKMF       Path to xmkmf, Makefile generator for X Window System
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2011,6 +1996,7 @@
 
 ac_config_headers="$ac_config_headers src/config.h"
 
+
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
@@ -2202,26 +2188,26 @@
 	prefix=$oldprefix
 
 
-for ac_prog in sw_vers
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+# Extract the first word of "sw_vers", so it can be a program name with args.
+set dummy sw_vers; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_SW_VERS+set}" = set; then
+if test "${ac_cv_path_SW_VERS+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$SW_VERS"; then
-  ac_cv_prog_SW_VERS="$SW_VERS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  case $SW_VERS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SW_VERS="$SW_VERS" # 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_prog_SW_VERS="$ac_prog"
+    ac_cv_path_SW_VERS="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -2229,9 +2215,10 @@
 done
 IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-SW_VERS=$ac_cv_prog_SW_VERS
+SW_VERS=$ac_cv_path_SW_VERS
 if test -n "$SW_VERS"; then
   { $as_echo "$as_me:$LINENO: result: $SW_VERS" >&5
 $as_echo "$SW_VERS" >&6; }
@@ -2241,9 +2228,87 @@
 fi
 
 
-  test -n "$SW_VERS" && break
+# Extract the first word of "defaults", so it can be a program name with args.
+set dummy defaults; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DEFAULTS+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $DEFAULTS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DEFAULTS="$DEFAULTS" # 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_DEFAULTS="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+DEFAULTS=$ac_cv_path_DEFAULTS
+if test -n "$DEFAULTS"; then
+  { $as_echo "$as_me:$LINENO: result: $DEFAULTS" >&5
+$as_echo "$DEFAULTS" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "xcode-select", so it can be a program name with args.
+set dummy xcode-select; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_XCODE_SELECT+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $XCODE_SELECT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XCODE_SELECT="$XCODE_SELECT" # 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_XCODE_SELECT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+XCODE_SELECT=$ac_cv_path_XCODE_SELECT
+if test -n "$XCODE_SELECT"; then
+  { $as_echo "$as_me:$LINENO: result: $XCODE_SELECT" >&5
+$as_echo "$XCODE_SELECT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
 if test "x$SW_VERS" != "x"; then
   { $as_echo "$as_me:$LINENO: checking Mac OS X version" >&5
 $as_echo_n "checking Mac OS X version... " >&6; }
@@ -2259,7 +2324,7 @@
     { $as_echo "$as_me:$LINENO: WARNING: Please upgrade at http://store.apple.com/" >&5
 $as_echo "$as_me: WARNING: Please upgrade at http://store.apple.com/" >&2;}
     ;;
-  10.1.[0-4]|10.2.[0-7]|10.3.[0-8]|10.4.[0-9]|10.4.10|10.5.[0-4])
+  10.1.[0-4]|10.2.[0-7]|10.3.[0-8]|10.4.[0-9]|10.4.10|10.5.[0-5])
     { $as_echo "$as_me:$LINENO: WARNING: This version of Mac OS X is out of date" >&5
 $as_echo "$as_me: WARNING: This version of Mac OS X is out of date" >&2;}
     { $as_echo "$as_me:$LINENO: WARNING: Please run Software Update to update it" >&5
@@ -2271,11 +2336,24 @@
     ;;
 esac
 
-XCODEPLIST=/Developer/Applications/Xcode.app/Contents/version.plist
+# locate currently selected Xcode path
+if test "x$XCODE_SELECT" != "x"; then
+  { $as_echo "$as_me:$LINENO: checking Xcode location" >&5
+$as_echo_n "checking Xcode location... " >&6; }
+  DEVELOPER_DIR=`$XCODE_SELECT -print-path`
+  { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5
+$as_echo "$DEVELOPER_DIR" >&6; }
+fi
+
+XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
 if test -r "$XCODEPLIST"; then
   { $as_echo "$as_me:$LINENO: checking Xcode version" >&5
 $as_echo_n "checking Xcode version... " >&6; }
-  XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([0-9.]*\)<\/string>.*/\1/'`
+  if test "x$DEFAULTS" != "x"; then
+    XCODE_VERSION=`$DEFAULTS read $DEVELOPER_DIR/Applications/Xcode.app/Contents/version CFBundleShortVersionString`
+  else
+    XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([0-9.]*\)<\/string>.*/\1/'`
+  fi
   { $as_echo "$as_me:$LINENO: result: $XCODE_VERSION" >&5
 $as_echo "$XCODE_VERSION" >&6; }
 fi
@@ -2287,7 +2365,7 @@
     { $as_echo "$as_me:$LINENO: WARNING: Please upgrade at http://connect.apple.com/" >&5
 $as_echo "$as_me: WARNING: Please upgrade at http://connect.apple.com/" >&2;}
     ;;
-  1.[2-4]*|2.[2-3]*)
+  1.[2-4]*|2.[2-3]*|3.[0]*)
     { $as_echo "$as_me:$LINENO: WARNING: This version of Xcode Tools is out of date" >&5
 $as_echo "$as_me: WARNING: This version of Xcode Tools is out of date" >&2;}
     { $as_echo "$as_me:$LINENO: WARNING: Please consider upgrading as some ports fail compiling" >&5
@@ -4622,7 +4700,6 @@
 # Foundation checks
 
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6894,7 +6971,6 @@
 	{ $as_echo "$as_me:$LINENO: result: ${result}" >&5
 $as_echo "${result}" >&6; }
 
-#MP_PROG_XAR
 
 
 
@@ -7979,91 +8055,21 @@
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
-$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if test "${ac_cv_header_stat_broken+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/stat.h>
 
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
-#endif
 
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
-#endif
 
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
-#endif
 
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
-#endif
 
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_stat_broken=no
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_header_stat_broken=yes
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STAT_MACROS_BROKEN 1
-_ACEOF
 
-fi
 
 
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h libgen.h sys/socket.h \
+for ac_header in limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \
 	readline/readline.h readline/history.h pwd.h sys/paths.h utime.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -8218,340 +8224,19 @@
 INCLUDES="-I.. -I. $INCLUDES"
 
 # Checks for library functions.
-{ $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5
-$as_echo_n "checking whether closedir returns void... " >&6; }
-if test "${ac_cv_func_closedir_void+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_closedir_void=yes
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header_dirent>
-#ifndef __cplusplus
-int closedir ();
-#endif
 
-int
-main ()
-{
-return closedir (opendir (".")) != 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_closedir_void=no
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_func_closedir_void=yes
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-$as_echo "$ac_cv_func_closedir_void" >&6; }
-if test $ac_cv_func_closedir_void = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define CLOSEDIR_VOID 1
-_ACEOF
 
-fi
 
-{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
-$as_echo_n "checking for pid_t... " >&6; }
-if test "${ac_cv_type_pid_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type_pid_t=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof (pid_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof ((pid_t)))
-	  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_pid_t=yes
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
 
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-$as_echo "$ac_cv_type_pid_t" >&6; }
-if test "x$ac_cv_type_pid_t" = x""yes; then
-  :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
-
-fi
-
-
-for ac_header in vfork.h
+for ac_func in bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv
 do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------------------------ ##
-## Report this to macports-dev at lists.macosforge.org ##
-## ------------------------------------------------ ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_func in fork vfork
-do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 $as_echo_n "checking for $ac_func... " >&6; }
@@ -8650,680 +8335,7 @@
 fi
 done
 
-if test "x$ac_cv_func_fork" = xyes; then
-  { $as_echo "$as_me:$LINENO: checking for working fork" >&5
-$as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_fork_works=cross
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
 
-	  /* By Ruediger Kuhlmann. */
-	  return fork () < 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_fork_works=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_fork_works=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
-$as_echo "$ac_cv_func_fork_works" >&6; }
-
-else
-  ac_cv_func_fork_works=$ac_cv_func_fork
-fi
-if test "x$ac_cv_func_fork_works" = xcross; then
-  case $host in
-    *-*-amigaos* | *-*-msdosdjgpp*)
-      # Override, as these systems have only a dummy fork() stub
-      ac_cv_func_fork_works=no
-      ;;
-    *)
-      ac_cv_func_fork_works=yes
-      ;;
-  esac
-  { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
-fi
-ac_cv_func_vfork_works=$ac_cv_func_vfork
-if test "x$ac_cv_func_vfork" = xyes; then
-  { $as_echo "$as_me:$LINENO: checking for working vfork" >&5
-$as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_vfork_works=cross
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Thanks to Paul Eggert for this test.  */
-$ac_includes_default
-#include <sys/wait.h>
-#ifdef HAVE_VFORK_H
-# include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
-   argument registers are propagated back to the parent.  The compiler
-   is told about this with #include <vfork.h>, but some compilers
-   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
-   static variable whose address is put into a register that is
-   clobbered by the vfork.  */
-static void
-#ifdef __cplusplus
-sparc_address_test (int arg)
-# else
-sparc_address_test (arg) int arg;
-#endif
-{
-  static pid_t child;
-  if (!child) {
-    child = vfork ();
-    if (child < 0) {
-      perror ("vfork");
-      _exit(2);
-    }
-    if (!child) {
-      arg = getpid();
-      write(-1, "", 0);
-      _exit (arg);
-    }
-  }
-}
-
-int
-main ()
-{
-  pid_t parent = getpid ();
-  pid_t child;
-
-  sparc_address_test (0);
-
-  child = vfork ();
-
-  if (child == 0) {
-    /* Here is another test for sparc vfork register problems.  This
-       test uses lots of local variables, at least as many local
-       variables as main has allocated so far including compiler
-       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
-       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
-       reuse the register of parent for one of the local variables,
-       since it will think that parent can't possibly be used any more
-       in this routine.  Assigning to the local variable will thus
-       munge parent in the parent process.  */
-    pid_t
-      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
-      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
-    /* Convince the compiler that p..p7 are live; otherwise, it might
-       use the same hardware register for all 8 local variables.  */
-    if (p != p1 || p != p2 || p != p3 || p != p4
-	|| p != p5 || p != p6 || p != p7)
-      _exit(1);
-
-    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
-       from child file descriptors.  If the child closes a descriptor
-       before it execs or exits, this munges the parent's descriptor
-       as well.  Test for this by closing stdout in the child.  */
-    _exit(close(fileno(stdout)) != 0);
-  } else {
-    int status;
-    struct stat st;
-
-    while (wait(&status) != child)
-      ;
-    return (
-	 /* Was there some problem with vforking?  */
-	 child < 0
-
-	 /* Did the child fail?  (This shouldn't happen.)  */
-	 || status
-
-	 /* Did the vfork/compiler bug occur?  */
-	 || parent != getpid()
-
-	 /* Did the file descriptor bug occur?  */
-	 || fstat(fileno(stdout), &st) != 0
-	 );
-  }
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_vfork_works=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_vfork_works=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
-$as_echo "$ac_cv_func_vfork_works" >&6; }
-
-fi;
-if test "x$ac_cv_func_fork_works" = xcross; then
-  ac_cv_func_vfork_works=$ac_cv_func_vfork
-  { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
-fi
-
-if test "x$ac_cv_func_vfork_works" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WORKING_VFORK 1
-_ACEOF
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define vfork fork
-_ACEOF
-
-fi
-if test "x$ac_cv_func_fork_works" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WORKING_FORK 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
-$as_echo_n "checking whether strerror_r is declared... " >&6; }
-if test "${ac_cv_have_decl_strerror_r+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-#ifndef strerror_r
-  (void) strerror_r;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_strerror_r=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_strerror_r=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
-$as_echo "$ac_cv_have_decl_strerror_r" >&6; }
-if test "x$ac_cv_have_decl_strerror_r" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR_R 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR_R 0
-_ACEOF
-
-
-fi
-
-
-
-for ac_func in strerror_r
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-{ $as_echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5
-$as_echo_n "checking whether strerror_r returns char *... " >&6; }
-if test "${ac_cv_func_strerror_r_char_p+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-    ac_cv_func_strerror_r_char_p=no
-    if test $ac_cv_have_decl_strerror_r = yes; then
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-	  char buf[100];
-	  char x = *strerror_r (0, buf, sizeof buf);
-	  char *p = strerror_r (0, buf, sizeof buf);
-	  return !p || x;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_func_strerror_r_char_p=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    else
-      # strerror_r is not declared.  Choose between
-      # systems that have relatively inaccessible declarations for the
-      # function.  BeOS and DEC UNIX 4.0 fall in this category, but the
-      # former has a strerror_r that returns char*, while the latter
-      # has a strerror_r that returns `int'.
-      # This test should segfault on the DEC system.
-      if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-	extern char *strerror_r ();
-int
-main ()
-{
-char buf[100];
-	  char x = *strerror_r (0, buf, sizeof buf);
-	  return ! isalpha (x);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_strerror_r_char_p=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-    fi
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5
-$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
-if test $ac_cv_func_strerror_r_char_p = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRERROR_R_CHAR_P 1
-_ACEOF
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_func in bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
 	{ $as_echo "$as_me:$LINENO: checking if readlink conforms to POSIX 1003.1a" >&5
 $as_echo_n "checking if readlink conforms to POSIX 1003.1a... " >&6; }
 
@@ -9402,23 +8414,6 @@
 
 
 
-
-# Check whether --with-x11-prefix was given.
-if test "${with_x11_prefix+set}" = set; then
-  withval=$with_x11_prefix;  x11prefix="$withval"
-fi
-
-case "$x11prefix" in
-  "")
-    # default to traditional value
-    x11prefix=/usr/X11R6
-    ;;
-  *)
-    x_includes=$x11prefix/include
-    x_libraries=$x11prefix/lib
-    ;;
-esac
-
 # Check for md5 implementation
 
 
@@ -9925,1573 +8920,7 @@
 	fi
 
 
-# Check for X11 and paraphernalia
 
-
-        # work around symbolic X11 link in /usr/include by providing explicit defaults
-        case "$host" in
-            *-*-darwin9*)
-                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
-                    x_includes="/usr/X11/include"
-                    x_libraries="/usr/X11/lib"
-                fi
-                ;;
-            *-*-darwin*)
-                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
-                    x_includes="/usr/X11R6/include"
-                    x_libraries="/usr/X11R6/lib"
-                fi
-                ;;
-        esac
-
-	{ $as_echo "$as_me:$LINENO: checking for X" >&5
-$as_echo_n "checking for X... " >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then
-  withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  case $x_includes,$x_libraries in #(
-    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
-$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
-   { (exit 1); exit 1; }; };; #(
-    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
-  cd conftest.dir
-  cat >Imakefile <<'_ACEOF'
-incroot:
-	@echo incroot='${INCROOT}'
-usrlibdir:
-	@echo usrlibdir='${USRLIBDIR}'
-libdir:
-	@echo libdir='${LIBDIR}'
-_ACEOF
-  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    for ac_var in incroot usrlibdir libdir; do
-      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
-    done
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl dylib la dll; do
-      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
-	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
-	ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case $ac_im_incroot in
-	/usr/include) ac_x_includes= ;;
-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
-    esac
-    case $ac_im_usrlibdir in
-	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
-    esac
-  fi
-  cd ..
-  rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Xlib.h.
-  # First, try using that file with no special directory specified.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Xlib.h"; then
-    ac_x_includes=$ac_dir
-    break
-  fi
-done
-fi
-
-rm -f conftest.err conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
-  # Check for the libraries.
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS=$LIBS
-  LIBS="-lX11 $LIBS"
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	LIBS=$ac_save_LIBS
-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
-  # Don't even attempt the hair of trying to link an X program!
-  for ac_extension in a so sl dylib la dll; do
-    if test -r "$ac_dir/libX11.$ac_extension"; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
-done
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
-  no,* | *,no | *\'*)
-    # Didn't find X, or a directory has "'" in its name.
-    ac_cv_have_x="have_x=no";; #(
-  *)
-    # Record where we found X for the cache.
-    ac_cv_have_x="have_x=yes\
-	ac_x_includes='$ac_x_includes'\
-	ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
-    *) have_x=yes;;
-  esac
-  eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
-  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
-$as_echo "$have_x" >&6; }
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes\
-	ac_x_includes='$x_includes'\
-	ac_x_libraries='$x_libraries'"
-  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
-	if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-
-cat >>confdefs.h <<\_ACEOF
-#define X_DISPLAY_MISSING 1
-_ACEOF
-
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
-
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
-    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
-    ac_xsave_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       X_LIBS="$X_LIBS -R$x_libraries"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-	  X_LIBS="$X_LIBS -R $x_libraries"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
-$as_echo "neither works" >&6; }
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-    ac_c_werror_flag=$ac_xsave_c_werror_flag
-    LIBS=$ac_xsave_LIBS
-  fi
-
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn Johnson says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And Karl Berry says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDisplay ();
-int
-main ()
-{
-return XOpenDisplay ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dnet_dnet_ntoa=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dnet_dnet_ntoa=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-fi
-
-    fi
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-    LIBS="$ac_xsave_LIBS"
-
-    # msh at cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to T.E. Dickey.
-    # The functions gethostbyname, getservbyname, and inet_addr are
-    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
-$as_echo_n "checking for gethostbyname... " >&6; }
-if test "${ac_cv_func_gethostbyname+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define gethostbyname innocuous_gethostbyname
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gethostbyname (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef gethostbyname
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_gethostbyname || defined __stub___gethostbyname
-choke me
-#endif
-
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_gethostbyname=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_gethostbyname=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
-$as_echo "$ac_cv_func_gethostbyname" >&6; }
-
-    if test $ac_cv_func_gethostbyname = no; then
-      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_nsl_gethostbyname=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_nsl_gethostbyname=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
-      if test $ac_cv_lib_nsl_gethostbyname = no; then
-	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_bsd_gethostbyname=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_bsd_gethostbyname=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
-      fi
-    fi
-
-    # lieder at skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says Simon Leinen: it contains gethostby*
-    # variants that don't use the name server (or something).  -lsocket
-    # must be given before -lnsl if both are needed.  We assume that
-    # if connect needs -lnsl, so does gethostbyname.
-    { $as_echo "$as_me:$LINENO: checking for connect" >&5
-$as_echo_n "checking for connect... " >&6; }
-if test "${ac_cv_func_connect+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define connect to an innocuous variant, in case <limits.h> declares connect.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define connect innocuous_connect
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char connect (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef connect
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_connect || defined __stub___connect
-choke me
-#endif
-
-int
-main ()
-{
-return connect ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_connect=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_connect=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
-$as_echo "$ac_cv_func_connect" >&6; }
-
-    if test $ac_cv_func_connect = no; then
-      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
-$as_echo_n "checking for connect in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_connect+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-int
-main ()
-{
-return connect ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_socket_connect=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_socket_connect=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
-$as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = x""yes; then
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-fi
-
-    fi
-
-    # Guillermo Gomez says -lposix is necessary on A/UX.
-    { $as_echo "$as_me:$LINENO: checking for remove" >&5
-$as_echo_n "checking for remove... " >&6; }
-if test "${ac_cv_func_remove+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define remove to an innocuous variant, in case <limits.h> declares remove.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define remove innocuous_remove
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char remove (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef remove
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char remove ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_remove || defined __stub___remove
-choke me
-#endif
-
-int
-main ()
-{
-return remove ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_remove=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_remove=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
-$as_echo "$ac_cv_func_remove" >&6; }
-
-    if test $ac_cv_func_remove = no; then
-      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
-$as_echo_n "checking for remove in -lposix... " >&6; }
-if test "${ac_cv_lib_posix_remove+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char remove ();
-int
-main ()
-{
-return remove ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_posix_remove=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_posix_remove=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
-$as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = x""yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-fi
-
-    fi
-
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
-$as_echo_n "checking for shmat... " >&6; }
-if test "${ac_cv_func_shmat+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shmat innocuous_shmat
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shmat (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shmat
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmat ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_shmat || defined __stub___shmat
-choke me
-#endif
-
-int
-main ()
-{
-return shmat ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_shmat=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_shmat=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
-$as_echo "$ac_cv_func_shmat" >&6; }
-
-    if test $ac_cv_func_shmat = no; then
-      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
-$as_echo_n "checking for shmat in -lipc... " >&6; }
-if test "${ac_cv_lib_ipc_shmat+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmat ();
-int
-main ()
-{
-return shmat ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_ipc_shmat=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ipc_shmat=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-fi
-
-    fi
-  fi
-
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS=$LDFLAGS
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  # John Interrante, Karl Berry
-  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char IceConnectionNumber ();
-int
-main ()
-{
-return IceConnectionNumber ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_ICE_IceConnectionNumber=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
-fi
-
-  LDFLAGS=$ac_save_LDFLAGS
-
-fi
-
-
-	# Check for libX11
-	{ $as_echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5
-$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; }
-if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11 $X_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDisplay ();
-int
-main ()
-{
-return XOpenDisplay ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_X11_XOpenDisplay=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_X11_XOpenDisplay=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5
-$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; }
-if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then
-
-		has_x_runtime=yes
-
-else
-   has_x_runtime=no
-fi
-
-
-# 	echo "------done---------"
-# 	echo "x_includes=${x_includes}"
-# 	echo "x_libraries=${x_libraries}"
-# 	echo "no_x=${no_x}"
-# 	echo "X_CFLAGS=${X_CFLAGS}"
-# 	echo "X_LIBS=${X_LIBS}"
-# 	echo "X_DISPLAY_MISSING=${X_DISPLAY_MISSING}"
-# 	echo "has_x_runtime=${has_x_runtime}"
-# 	echo "host_os=${host_os}"
-# 	echo "------done---------"
-
-	state=
-
-	case "__${has_x_runtime}__${no_x}__" in
-		"__no__yes__")
-		# either the user said --without-x, or it was not found
-		# at all (runtime or headers)
-			{ $as_echo "$as_me:$LINENO: WARNING: X11 not available. You will not be able to use ports that use X11" >&5
-$as_echo "$as_me: WARNING: X11 not available. You will not be able to use ports that use X11" >&2;}
-			state=0
-			;;
-		"__yes__yes__")
-			state=1
-			;;
-		"__yes____")
-			state=2
-			;;
-		*)
-			state=3
-			;;
-	esac
-
-	case $host_os in
-		darwin*)
-			case $state in
-				1)
-					cat <<EOF;
-Please install the X11 SDK packages from the
-Xcode Developer Tools CD
-EOF
-					{ { $as_echo "$as_me:$LINENO: error: Broken X11 install. No X11 headers" >&5
-$as_echo "$as_me: error: Broken X11 install. No X11 headers" >&2;}
-   { (exit 1); exit 1; }; }
-
-					;;
-				3)
-					cat <<EOF;
-Unknown configuration problem. Please install the X11 runtime
-and/or X11 SDK  packages from the Xcode Developer Tools CD
-EOF
-					{ { $as_echo "$as_me:$LINENO: error: Broken X11 install" >&5
-$as_echo "$as_me: error: Broken X11 install" >&2;}
-   { (exit 1); exit 1; }; }
-					;;
-			esac
-			;;
-		*)
-			case $state in
-				1)
-					cat <<EOF;
-Please install the X11 developer headers for your platform
-EOF
-					{ { $as_echo "$as_me:$LINENO: error: Broken X11 install. No X11 headers" >&5
-$as_echo "$as_me: error: Broken X11 install. No X11 headers" >&2;}
-   { (exit 1); exit 1; }; }
-
-					;;
-				3)
-					cat <<EOF;
-Unknown configuration problem. Please install the X11
-implementation for your platform
-EOF
-					{ { $as_echo "$as_me:$LINENO: error: Broken X11 install" >&5
-$as_echo "$as_me: error: Broken X11 install" >&2;}
-   { (exit 1); exit 1; }; }
-					;;
-			esac
-			;;
-	esac
-
-
-
-{ $as_echo "$as_me:$LINENO: checking for X11 prefix" >&5
-$as_echo_n "checking for X11 prefix... " >&6; }
-X_INCLUDES_PREFIX=`echo "$x_includes" | sed "s,/include,,"`
-X_LIBRARIES_PREFIX=`echo "$x_libraries" | sed "s,/lib,,"`
-if test "x$have_x" = "xyes" -a "x$X_INCLUDES_PREFIX" = "x$X_LIBRARIES_PREFIX" -a "x$X_LIBRARIES_PREFIX" != x; then
-    x11prefix=$X_LIBRARIES_PREFIX
-fi
-{ $as_echo "$as_me:$LINENO: result: $x11prefix" >&5
-$as_echo "$x11prefix" >&6; }
-
-
 # Check for readline
 # Check whether --enable-readline was given.
 if test "${enable_readline+set}" = set; then

Modified: branches/new-help-system/base/configure.ac
===================================================================
--- branches/new-help-system/base/configure.ac	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/configure.ac	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,12 +1,13 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-AC_PREREQ(2.52)
+AC_PREREQ(2.63)
 AC_DEFUN([MACPORTS_VERSION_MACRO], [esyscmd(cat config/macports_version | tr -d '\n')])
-AC_INIT([MacPorts], [MACPORTS_VERSION_MACRO], [macports-dev at lists.macosforge.org], [macports])
+AC_INIT([MacPorts],[MACPORTS_VERSION_MACRO],[macports-dev at lists.macosforge.org],[macports])
 AC_CONFIG_SRCDIR([src/pextlib1.0/Pextlib.c])
 AC_CONFIG_HEADERS([src/config.h])
-AC_CANONICAL_SYSTEM
 
+AC_CANONICAL_TARGET
+
 # Read in the MacPorts version from the base/config/macports_version file
 AC_MSG_CHECKING(MacPorts version)
 MACPORTS_VERSION=MACPORTS_VERSION_MACRO
@@ -16,7 +17,10 @@
 # Check user PATH for MP paths, and remove as necessary.
 MP_PATH_SCAN
 
-AC_CHECK_PROGS(SW_VERS, sw_vers)
+AC_PATH_PROG(SW_VERS, sw_vers)
+AC_PATH_PROG(DEFAULTS, defaults)
+AC_PATH_PROG(XCODE_SELECT, xcode-select)
+
 if test "x$SW_VERS" != "x"; then
   AC_MSG_CHECKING(Mac OS X version)
   MACOSX_VERSION=`$SW_VERS -productVersion`
@@ -25,12 +29,12 @@
 
 case "$MACOSX_VERSION" in
   10.0*|10.1*|10.2*)
-    AC_WARN(This version of Mac OS X is not supported)
-    AC_WARN(Please upgrade at http://store.apple.com/)
+    AC_MSG_WARN([This version of Mac OS X is not supported])
+    AC_MSG_WARN([Please upgrade at http://store.apple.com/])
     ;;
-  10.1.[[0-4]]|10.2.[[0-7]]|10.3.[[0-8]]|10.4.[[0-9]]|10.4.10|10.5.[[0-4]])
-    AC_WARN(This version of Mac OS X is out of date)
-    AC_WARN(Please run Software Update to update it)
+  10.1.[[0-4]]|10.2.[[0-7]]|10.3.[[0-8]]|10.4.[[0-9]]|10.4.10|10.5.[[0-5]])
+    AC_MSG_WARN([This version of Mac OS X is out of date])
+    AC_MSG_WARN([Please run Software Update to update it])
     ;;
   10.3*|10.4*|10.5*)
     dnl Supported version
@@ -39,21 +43,32 @@
     ;;
 esac
 
-XCODEPLIST=/Developer/Applications/Xcode.app/Contents/version.plist
+# locate currently selected Xcode path
+if test "x$XCODE_SELECT" != "x"; then
+  AC_MSG_CHECKING(Xcode location)
+  DEVELOPER_DIR=`$XCODE_SELECT -print-path`
+  AC_MSG_RESULT([$DEVELOPER_DIR])
+fi
+
+XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
 if test -r "$XCODEPLIST"; then
   AC_MSG_CHECKING(Xcode version)
-  XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([[0-9.]]*\)<\/string>.*/\1/'`
+  if test "x$DEFAULTS" != "x"; then
+    XCODE_VERSION=`$DEFAULTS read $DEVELOPER_DIR/Applications/Xcode.app/Contents/version CFBundleShortVersionString`
+  else
+    XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([[0-9.]]*\)<\/string>.*/\1/'`
+  fi
   AC_MSG_RESULT([$XCODE_VERSION])
 fi
 
 case "$XCODE_VERSION" in
   1.[[0-1]]*|2.[[0-1]]*)
-    AC_WARN(This version of Xcode Tools is not supported)
-    AC_WARN(Please upgrade at http://connect.apple.com/)
+    AC_MSG_WARN([This version of Xcode Tools is not supported])
+    AC_MSG_WARN([Please upgrade at http://connect.apple.com/])
     ;;
-  1.[[2-4]]*|2.[[2-3]]*)
-    AC_WARN(This version of Xcode Tools is out of date)
-    AC_WARN(Please consider upgrading as some ports fail compiling)
+  1.[[2-4]]*|2.[[2-3]]*|3.[[0]]*)
+    AC_MSG_WARN([This version of Xcode Tools is out of date])
+    AC_MSG_WARN([Please consider upgrading as some ports fail compiling])
     ;;
   1.5*|2.4*|3.*)
     dnl Supported version
@@ -126,7 +141,6 @@
 fi
 
 MP_PROG_DAEMONDO
-#MP_PROG_XAR
 
 AC_SUBST(REPLACEMENT_PROGS)
 AC_SUBST(EXTRA_PROGS)
@@ -160,47 +174,20 @@
 AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_HEADER_SYS_WAIT
-AC_HEADER_STAT
-AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h libgen.h sys/socket.h \
+AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \
 	readline/readline.h readline/history.h pwd.h sys/paths.h utime.h])
 
 INCLUDES="-I.. -I. $INCLUDES"
 
 # Checks for library functions.
-AC_FUNC_CLOSEDIR_VOID
-AC_FUNC_FORK
-AC_FUNC_STRERROR_R
-AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv])
+AC_CHECK_FUNCS([bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv])
 MP_CHECK_READLINK_IS_P1003_1A
 
-AC_ARG_WITH(x11-prefix, [AC_HELP_STRING([--with-x11-prefix=PREFIX], [use PREFIX as the X11 base dir (default autodetect)])], [ x11prefix="$withval" ] )
-case "$x11prefix" in
-  "")
-    # default to traditional value
-    x11prefix=/usr/X11R6
-    ;;
-  *)
-    x_includes=$x11prefix/include
-    x_libraries=$x11prefix/lib
-    ;;
-esac
-
 # Check for md5 implementation
 MP_LIB_MD5
-# Check for X11 and paraphernalia
-MP_CHECK_X11
 
-AC_MSG_CHECKING(for X11 prefix)
-X_INCLUDES_PREFIX=`echo "$x_includes" | sed "s,/include,,"`
-X_LIBRARIES_PREFIX=`echo "$x_libraries" | sed "s,/lib,,"`
-if test "x$have_x" = "xyes" -a "x$X_INCLUDES_PREFIX" = "x$X_LIBRARIES_PREFIX" -a "x$X_LIBRARIES_PREFIX" != x; then
-    x11prefix=$X_LIBRARIES_PREFIX
-fi
-AC_MSG_RESULT([$x11prefix])
-AC_SUBST(x11prefix)
-
 # Check for readline
-AC_ARG_ENABLE(readline, AC_HELP_STRING([--enable-readline], [Enable addition of readline support, if readline present.]),
+AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[Enable addition of readline support, if readline present.]),
 [
 	AC_CHECK_LIB([readline], [readline], [
 				  READLINE_LIBS=-lreadline

Deleted: branches/new-help-system/base/doc/TODO.txt
===================================================================
--- branches/new-help-system/base/doc/TODO.txt	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/doc/TODO.txt	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,11 +0,0 @@
-#
-# $Id$
-#
-# MacPorts TODO List
-#
-# This is a partial list of items to be completed, or considered, for future
-# revisions.
-#
-
-Outstanding ToDos:
-

Modified: branches/new-help-system/base/doc/macports.conf.in
===================================================================
--- branches/new-help-system/base/doc/macports.conf.in	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/doc/macports.conf.in	2009-05-12 17:37:20 UTC (rev 50909)
@@ -19,11 +19,8 @@
 
 # PATH settings that are used for external tools (configure, make, etc.) while installing ports. The default
 # paths are given in the example; it need not be uncommented.  Customizing binpath is intended for advanced users only.
-#binpath		@prefix_expanded@/bin:@prefix_expanded@/sbin:/bin:/sbin:/usr/bin:/usr/sbin:@x11prefix@/bin
+#binpath		@prefix_expanded@/bin:@prefix_expanded@/sbin:/bin:/sbin:/usr/bin:/usr/sbin
 
-# Directory containing the X11 installation.
-x11prefix		@x11prefix@
-
 # Directory containing Applications from ports.
 applications_dir	@MPAPPLICATIONSDIR@
 
@@ -68,7 +65,7 @@
 # Number of simultaneous make jobs (commands) to use when building ports. This
 # value may be set to 0 so the number of simultaneous make jobs will be set to
 # the number of CPU cores that are automatically detected.
-buildmakejobs		1
+#buildmakejobs		0
 
 # Set whether to automatically execute "clean" after "install" of ports
 portautoclean		yes

Modified: branches/new-help-system/base/doc/portfile.7
===================================================================
--- branches/new-help-system/base/doc/portfile.7	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/doc/portfile.7	2009-05-12 17:37:20 UTC (rev 50909)
@@ -479,12 +479,6 @@
 .br
 .Sy Default:
 .Em ${prefix}/Library/Frameworks
-.It Ic x11prefix
-Absolute path to X11 (eg
-.Pa /usr/X11R6 )
-.br
-.Sy Type:
-.Em read-only
 .El
 .Sh DEPENDENCY OPTIONS
 Port dependencies should refer to other MacPort ports
@@ -1904,9 +1898,6 @@
 .It Ic variant_set Ar variant
 Set the given
 .Ar variant .
-.It Ic variant_unset Ar variant
-Unset the given
-.Ar variant .
 .It Va variable Ns - Ns Ic append Ar item
 Append
 .Ar item

Modified: branches/new-help-system/base/m4/foundation.m4
===================================================================
--- branches/new-help-system/base/m4/foundation.m4	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/m4/foundation.m4	2009-05-12 17:37:20 UTC (rev 50909)
@@ -79,7 +79,7 @@
 #------------------------------------------------------------------------
 AC_DEFUN([MP_OBJC_RUNTIME],[
 	AC_REQUIRE([AC_PROG_OBJC])
-	AC_ARG_WITH(objc-runtime, AC_HELP_STRING([--with-objc-runtime], [Specify either "GNU" or "apple"]), [with_objc_runtime=${withval}])
+	AC_ARG_WITH(objc-runtime, AS_HELP_STRING([--with-objc-runtime],[Specify either "GNU" or "apple"]), [with_objc_runtime=${withval}])
 
 	if test x"${with_objc_runtime}" != x; then
 		case "${with_objc_runtime}" in

Modified: branches/new-help-system/base/m4/pthread.m4
===================================================================
--- branches/new-help-system/base/m4/pthread.m4	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/m4/pthread.m4	2009-05-12 17:37:20 UTC (rev 50909)
@@ -49,8 +49,7 @@
 
 AC_DEFUN([ACX_PTHREAD], [
 AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
+AC_LANG_PUSH([C])
 acx_pthread_ok=no
 
 # We used to check for pthread.h first, but this fails if pthread.h
@@ -167,11 +166,9 @@
         # pthread_cleanup_push because it is one of the few pthread
         # functions on Solaris that doesn't have a non-functional libc stub.
         # We try pthread_create on general principles.
-        AC_TRY_LINK([#include <pthread.h>],
-                    [pthread_t th; pthread_join(th, 0);
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t th; pthread_join(th, 0);
                      pthread_attr_init(0); pthread_cleanup_push(0, 0);
-                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
-                    [acx_pthread_ok=yes])
+                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ]])],[acx_pthread_ok=yes],[])
 
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
@@ -197,8 +194,7 @@
 	AC_MSG_CHECKING([for joinable pthread attribute])
 	attr_name=unknown
 	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
-	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr;],
-                        [attr_name=$attr; break])
+	    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[int attr=$attr;]])],[attr_name=$attr; break],[])
 	done
         AC_MSG_RESULT($attr_name)
         if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
@@ -234,5 +230,5 @@
         acx_pthread_ok=no
         $2
 fi
-AC_LANG_RESTORE
+AC_LANG_POP([C])
 ])dnl ACX_PTHREAD

Copied: branches/new-help-system/base/portmgr/bots/trac.rb (from rev 50867, trunk/base/portmgr/bots/trac.rb)
===================================================================
--- branches/new-help-system/base/portmgr/bots/trac.rb	                        (rev 0)
+++ branches/new-help-system/base/portmgr/bots/trac.rb	2009-05-12 17:37:20 UTC (rev 50909)
@@ -0,0 +1,61 @@
+#
+#	trac.rb
+#
+#	Plugin to rbot (http://ruby-rbot.org/), an irc bot, to provide
+#	services related to MacPorts trac systemfor the #macports channel
+#	on freenode.net, created from PortPlugin by James D. Berry
+#
+#	By Andrea D'Amore
+#
+#	$Id: $
+
+require 'stringio'
+
+class TracPlugin < Plugin
+
+	def help(plugin, topic="")
+		case topic
+		  when "ticket"
+			return "ticket <ticket no.> => show http link for ticket # <ticket no.>"
+		  when "faq"
+			return "faq => show FAQs' URL"
+		  when "guide"
+			return "guide [chunked] => show The Guide's URL. Don't Panic."		 
+		  else
+			return "trac module provides: !ticket, !faq, !guide"
+		end
+	end
+
+	def ticket(m, params)
+		number = params[:number][/^#?(\d*)$/,1]
+		if ( number )
+			url = "http://trac.macports.org/ticket/"+number
+			m.reply "#{url}"
+		else
+			m.reply "Use either #1234 or 1234 for ticket number"
+		end
+	end
+
+	def faq(m, params)
+		m.reply "FAQs are at: http://trac.macports.org/wiki/FAQ"
+	end
+
+	def guide(m, params)
+		if ( params[:parm] == "chunked" )
+			m.reply "http://guide.macports.org/chunked/index.html"
+		else
+			m.reply "http://guide.macports.org/"
+		end
+	end
+	
+	def team(m, params)
+		m.reply "http://trac.macports.org/wiki/MacPortsDevelopers"
+	end
+
+end
+
+plugin = TracPlugin.new
+plugin.map 'ticket :number', :action => 'ticket'
+plugin.map 'faq :parm', :action => 'faq', :defaults => {:parm => ""}
+plugin.map 'guide :parm', :action => 'guide', :defaults => {:parm => ""}
+plugin.map 'team', :action => 'team'
\ No newline at end of file

Modified: branches/new-help-system/base/regen.sh
===================================================================
--- branches/new-help-system/base/regen.sh	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/regen.sh	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-autoconf
-autoheader
+autoconf --warnings=all
+autoheader --warnings=all

Modified: branches/new-help-system/base/src/config.h.in
===================================================================
--- branches/new-help-system/base/src/config.h.in	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/config.h.in	2009-05-12 17:37:20 UTC (rev 50909)
@@ -6,9 +6,6 @@
 /* Define if using the Apple Objective-C runtime and compiler. */
 #undef APPLE_RUNTIME
 
-/* Define to 1 if the `closedir' function returns void instead of `int'. */
-#undef CLOSEDIR_VOID
-
 /* Define if using the GNUstep Foundation library */
 #undef GNUSTEP_FOUNDATION
 
@@ -50,10 +47,6 @@
    `rl_username_completion_function', and to 0 if you don't. */
 #undef HAVE_DECL_RL_USERNAME_COMPLETION_FUNCTION
 
-/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR_R
-
 /* Define to 1 if you have the declaration of `username_completion_function',
    and to 0 if you don't. */
 #undef HAVE_DECL_USERNAME_COMPLETION_FUNCTION
@@ -62,9 +55,6 @@
    */
 #undef HAVE_DIRENT_H
 
-/* Define to 1 if you have the `dup2' function. */
-#undef HAVE_DUP2
-
 /* Define to 1 if you have the <err.h> header file. */
 #undef HAVE_ERR_H
 
@@ -77,9 +67,6 @@
 /* Define to 1 if you have the `flock' function. */
 #undef HAVE_FLOCK
 
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
 /* Define if CoreFoundation framework is available */
 #undef HAVE_FRAMEWORK_COREFOUNDATION
 
@@ -99,9 +86,6 @@
 /* Define if you have the `crypto' library (-lcrypto). */
 #undef HAVE_LIBCRYPTO
 
-/* Define to 1 if you have the <libgen.h> header file. */
-#undef HAVE_LIBGEN_H
-
 /* Define if you have the `md' library (-lmd). */
 #undef HAVE_LIBMD
 
@@ -147,9 +131,6 @@
 /* Define to 1 if you have the <readline/readline.h> header file. */
 #undef HAVE_READLINE_READLINE_H
 
-/* Define to 1 if you have the `regcomp' function. */
-#undef HAVE_REGCOMP
-
 /* Define to 1 if you have the `setmode' function. */
 #undef HAVE_SETMODE
 
@@ -162,15 +143,6 @@
 /* Define to 1 if you have the `strcasecmp' function. */
 #undef HAVE_STRCASECMP
 
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the `strerror_r' function. */
-#undef HAVE_STRERROR_R
-
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
@@ -183,9 +155,6 @@
 /* Define to 1 if you have the `strncasecmp' function. */
 #undef HAVE_STRNCASECMP
 
-/* Define to 1 if you have the `strtol' function. */
-#undef HAVE_STRTOL
-
 /* Define to 1 if you have the <sys/cdefs.h> header file. */
 #undef HAVE_SYS_CDEFS_H
 
@@ -224,18 +193,6 @@
 /* Define to 1 if you have the <utime.h> header file. */
 #undef HAVE_UTIME_H
 
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
 /* Lowest non-system-reserved GID. */
 #undef MIN_USABLE_GID
 
@@ -271,26 +228,11 @@
 /* Define to 1 if static build is requested */
 #undef STATIC_BUILD
 
-/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* Define to 1 if strerror_r returns char *. */
-#undef STRERROR_R_CHAR_P
-
 /* SDK for SDK redirect in tracelib */
 #undef TRACE_SDK
 
 /* Attribute to mark unused variables */
 #undef UNUSED
-
-/* Define to 1 if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork

Modified: branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c
===================================================================
--- branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c	2009-05-12 17:37:20 UTC (rev 50909)
@@ -324,6 +324,7 @@
 		filemap=0;
 }
 
+__attribute__((always_inline))
 inline void __darwintrace_setup() {
 #define open(x,y,z) syscall(SYS_open, (x), (y), (z))
 #define close(x) syscall(SYS_close, (x))
@@ -354,6 +355,7 @@
  * path:		the path of the file
  * fd:			a fd to the file, or 0 if we don't have any.
  */
+__attribute__((always_inline))
 inline void __darwintrace_log_op(const char* op, const char* path, int fd) {
 	int size;
 	char somepath[MAXPATHLEN];
@@ -530,6 +532,7 @@
 /*
  * return 1 if path (once normalized) is in sandbox or redirected, 0 otherwise.
  */
+__attribute__((always_inline))
 inline int __darwintrace_is_in_sandbox(const char* path, char * newpath) {
 	char * t, * p, * _;
 	int result=-1;
@@ -923,4 +926,4 @@
 	
 	return result;
 #undef stat
-}
\ No newline at end of file
+}

Modified: branches/new-help-system/base/src/macports1.0/macports.tcl
===================================================================
--- branches/new-help-system/base/src/macports1.0/macports.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/macports1.0/macports.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -40,7 +40,7 @@
 namespace eval macports {
     namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
     variable bootstrap_options "\
-        portdbpath libpath binpath auto_path extra_env sources_conf prefix x11prefix portdbformat \
+        portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
         portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
         porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
         rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
@@ -49,7 +49,7 @@
         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip"
     variable user_options "submitter_name submitter_email submitter_key"
     variable portinterp_options "\
-        portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen x11prefix portsharepath \
+        portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
         registry.path registry.format registry.installtype portarchivemode portarchivepath \
         portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
         rsync_options rsync_dir startupitem_type place_worksymlink \
@@ -338,7 +338,6 @@
     global macports::prefix
     global macports::macportsuser
     global macports::prefix_frozen
-    global macports::x11prefix
     global macports::registry.installtype
     global macports::rsync_dir
     global macports::rsync_options
@@ -604,7 +603,7 @@
     }
 
     if {![info exists binpath]} {
-        set env(PATH) "${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:${x11prefix}/bin"
+        set env(PATH) "${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
     } else {
         set env(PATH) "$binpath"
     }
@@ -643,7 +642,7 @@
         set macports::buildnicevalue 0
     }
     if {![info exists macports::buildmakejobs]} {
-        set macports::buildmakejobs 1
+        set macports::buildmakejobs 0
     }
 
     # Default mp universal options
@@ -792,6 +791,7 @@
     $workername alias mport_open mportopen
     $workername alias mport_close mportclose
     $workername alias mport_search mportsearch
+    $workername alias mport_lookup mportlookup
 
     # instantiate the UI call-backs
     foreach priority ${macports::ui_priorities} {
@@ -816,6 +816,7 @@
     $workername alias registry_prop_retr registry::property_retrieve
     $workername alias registry_delete registry::delete_entry
     $workername alias registry_exists registry::entry_exists
+    $workername alias registry_exists_for_name registry::entry_exists_for_name
     $workername alias registry_activate portimage::activate
     $workername alias registry_deactivate portimage::deactivate
     $workername alias registry_register_deps registry::register_dependencies
@@ -1189,7 +1190,6 @@
     set depline [lindex [split $depspec :] 1]
     set prefix [_mportkey $mport prefix]
     set frameworks_dir [_mportkey $mport frameworks_dir]
-    set x11prefix [_mportkey $mport x11prefix]
     
     if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
         lappend search_path $env(DYLD_FRAMEWORK_PATH)
@@ -1202,7 +1202,7 @@
     if {[info exists env(DYLD_LIBRARY_PATH)]} {
         lappend search_path $env(DYLD_LIBRARY_PATH)
     }
-    lappend search_path /lib /usr/lib ${x11prefix}/lib ${prefix}/lib
+    lappend search_path /lib /usr/lib ${prefix}/lib
     if {[info exists env(DYLD_FALLBACK_LIBRARY_PATH)]} {
         lappend search_path $env(DYLD_FALLBACK_LIBRARY_PATH)
     }
@@ -1269,13 +1269,9 @@
 
 # Determine if a port is already *installed*, as in "in the registry".
 proc _mportinstalled {mport} {
-    # Check for the presense of the port in the registry
+    # Check for the presence of the port in the registry
     set workername [ditem_key $mport workername]
-    if {[catch {set reslist [$workername eval registry_installed \${portname}]}]} {
-        return 0
-    } else {
-        return [expr [llength $reslist] > 0]
-    }
+    return [$workername eval registry_exists_for_name \${portname}]
 }
 
 # Determine if a port is active (only for image mode)
@@ -2157,18 +2153,16 @@
     global macports::portarchivemode
     array set options $optionslist
 
-	# Note $variationslist is left alone and so retains the original
+    # Note $variationslist is left alone and so retains the original
     # requested variations, which should be passed to recursive calls to
-	# upgrade; while variations gets existing variants and global variations
+    # upgrade; while variations gets existing variants and global variations
     # merged in later on, so it applies only to this port's upgrade
     array set variations $variationslist
 
     if {![string match "" $depscachename]} {
         upvar $depscachename depscache
-    } 
+    }
 
-    # set to 1 if epoch overrides version
-    set epoch_override 0
     # Is this a dry run?
     set is_dryrun no
     if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq "yes"} {
@@ -2201,40 +2195,31 @@
     set revision_in_tree "$portinfo(revision)"
     set epoch_in_tree "$portinfo(epoch)"
 
-    # Sooner or later we may have to open this port to update the portinfo
-	# by evaluating the variants. Keep track of whether this has happened
-	set portwasopened 0
-
-    # set version_installed and revision_installed
     set ilist {}
     if { [catch {set ilist [registry::installed $portname ""]} result] } {
         if {$result == "Registry error: $portname not registered as installed." } {
             ui_debug "$portname is *not* installed by MacPorts"
-            # open porthandle    
+            # open porthandle
             set porturl $portinfo(porturl)
             if {![info exists porturl]} {
-                set porturl file://./    
-            }    
-			# Merge the global variations into the specified
-			foreach { variation value } $globalvarlist {
-				if { ![info exists variations($variation)] } {
-					set variations($variation) $value
-				}
-			}
-		
-			if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
+                set porturl file://./
+            }
+            # Merge the global variations into the specified
+            foreach { variation value } $globalvarlist {
+                if { ![info exists variations($variation)] } {
+                    set variations($variation) $value
+                }
+            }
+
+            if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
                     global errorInfo
                     ui_debug "$errorInfo"
-                    ui_error "Unable to open port: $result"        
+                    ui_error "Unable to open port: $result"
                     return 1
             }
-			# While we're at it, update the portinfo
-			array unset portinfo
-			array set portinfo [mportinfo $workername]
-			set portwasopened 1
-			set version_in_tree "$portinfo(version)"
-			set revision_in_tree "$portinfo(revision)"
-			set epoch_in_tree "$portinfo(epoch)"
+            # While we're at it, update the portinfo
+            array unset portinfo
+            array set portinfo [mportinfo $workername]
 
             if {![_mportispresent $workername $dspec ] } {
                 # upgrade its dependencies first
@@ -2247,23 +2232,21 @@
                     return 1
                 }
                 if {$result > 0} {
-					ui_error "Problem while installing $portname"
-					return $result
+                    ui_error "Problem while installing $portname"
+                    return $result
                 }
-                # we just installed it, so mark it done in the cache 
-                # and update ilist 
+                # we just installed it, so mark it done in the cache
+                # and update ilist
                 set depscache(port:${portname}) 1
-                if {$is_dryrun eq "no"} {
-                    set ilist [registry::installed $portname ""]
-                }
             } else {
                 # dependency is satisfied by something other than the named port
                 ui_debug "$portname not installed, soft dependency satisfied"
                 # mark this depspec as satisfied in the cache
                 set depscache($dspec) 1
-                return
             }
-
+            # the rest of the proc doesn't matter for a port that is freshly
+            # installed or not installed
+            return 0
         } else {
             ui_error "Checking installed version failed: $result"
             exit 1
@@ -2314,83 +2297,75 @@
         ui_debug "no version of $portname is active"
     }
 
-    # set the nodeps option  
-    if {![info exists options(ports_nodeps)]} {
-        set nodeps no
+    # save existing variant for later use
+    if {$anyactive} {
+        set oldvariant $variant_active
     } else {
-        set nodeps yes
+        set oldvariant $variant_installed
     }
 
-	# save existing variant for later use
-	if {$anyactive} {
-	    set oldvariant $variant_active
-	} else {
-	    set oldvariant $variant_installed
-	}
-	if {$portwasopened == 0} {
-		# If the port has not been opened, then before we do 
-		# dependencies, we need to figure out the final variants, 
-		# open the port, and update the portinfo. (If it was opened,
-		# then the variants must still be the ones we opened it with,
-		# and the portinfo is correct.)
+    # Before we do
+    # dependencies, we need to figure out the final variants,
+    # open the port, and update the portinfo.
 
-		set porturl $portinfo(porturl)
-		if {![info exists porturl]} {
-			set porturl file://./
-		}
+    set porturl $portinfo(porturl)
+    if {![info exists porturl]} {
+        set porturl file://./
+    }
 
-		# check if the variants is present in $version_in_tree
-		set variant [split $oldvariant +]
-		ui_debug "Merging existing variants $variant into variants"
-		if {[info exists portinfo(variants)]} {
-			set avariants $portinfo(variants)
-		} else {
-			set avariants {}
-		}
-		ui_debug "available variants are : $avariants"
-		foreach v $variant {
-			if {[lsearch $avariants $v] == -1} {
-			} else {
-				ui_debug "variant $v is present in $portname $version_in_tree"
-				if { ![info exists variations($v)]} {
-					set variations($v) "+"
-				}
-			}
-		}
-		
-		# Now merge in the global (i.e. variants.conf) variations.
-		# We wait until now so that existing variants for this port
-		# override global variations
-		foreach { variation value } $globalvarlist {
-			if { ![info exists variations($variation)] } {
-				set variations($variation) $value
-			}
-		}
-		
-		ui_debug "new fully merged portvariants: [array get variations]"
-	
-		if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
-			global errorInfo
-			ui_debug "$errorInfo"
-			ui_error "Unable to open port: $result"
-			return 1
-		}
+    # check if the variants is present in $version_in_tree
+    set variant [split $oldvariant +]
+    ui_debug "Merging existing variants $variant into variants"
+    if {[info exists portinfo(variants)]} {
+        set avariants $portinfo(variants)
+    } else {
+        set avariants {}
+    }
+    ui_debug "available variants are : $avariants"
+    foreach v $variant {
+        if {[lsearch $avariants $v] == -1} {
+        } else {
+            ui_debug "variant $v is present in $portname $version_in_tree"
+            if { ![info exists variations($v)]} {
+                set variations($v) "+"
+            }
+        }
+    }
 
-		array unset portinfo
-		array set portinfo [mportinfo $workername]
-		set portwasopened 1
-		set version_in_tree "$portinfo(version)"
-		set revision_in_tree "$portinfo(revision)"
-		set epoch_in_tree "$portinfo(epoch)"
-	}
-		
+    # Now merge in the global (i.e. variants.conf) variations.
+    # We wait until now so that existing variants for this port
+    # override global variations
+    foreach { variation value } $globalvarlist {
+        if { ![info exists variations($variation)] } {
+            set variations($variation) $value
+        }
+    }
 
-    if {$nodeps == "yes"} {
-        ui_debug "Not following dependencies"
-    } else {
+    ui_debug "new fully merged portvariants: [array get variations]"
+
+    if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
+        global errorInfo
+        ui_debug "$errorInfo"
+        ui_error "Unable to open port: $result"
+        return 1
+    }
+
+    array unset portinfo
+    array set portinfo [mportinfo $workername]
+    set portwasopened 1
+    set version_in_tree "$portinfo(version)"
+    set revision_in_tree "$portinfo(revision)"
+    set epoch_in_tree "$portinfo(epoch)"
+
+
+    # first upgrade dependencies
+    if {![info exists options(ports_nodeps)]} {
         _upgrade_dependencies portinfo depscache globalvarlist variationslist options
+    } else {
+        ui_debug "Not following dependencies"
     }
 
+    set epoch_override 0
     # check installed version against version in ports
     if { ( [rpm-vercomp $version_installed $version_in_tree] > 0
             || ([rpm-vercomp $version_installed $version_in_tree] == 0
@@ -2422,24 +2397,28 @@
 
             return 0
         } else {
-            ui_debug "epoch override ... upgrading!"
             set epoch_override 1
+            ui_debug "epoch override ... upgrading!"
         }
     }
 
 
-    # install version_in_tree
+    # build or unarchive version_in_tree
     if {0 == [string compare "yes" ${macports::portarchivemode}]} {
         set upgrade_action "archive"
     } else {
         set upgrade_action "destroot"
     }
 
-    if {[catch {set result [mportexec $workername $upgrade_action]} result] || $result != 0} {
-        global errorInfo
-        ui_debug "$errorInfo"
-        ui_error "Unable to upgrade port: $result"
-        return 1
+    # avoid building again unnecessarily
+    if {[info exists options(ports_force)] || $epoch_override == 1
+        || ![registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
+        if {[catch {set result [mportexec $workername $upgrade_action]} result] || $result != 0} {
+            global errorInfo
+            ui_debug "$errorInfo"
+            ui_error "Unable to upgrade port: $result"
+            return 1
+        }
     }
 
     # always uninstall old port in direct mode
@@ -2462,8 +2441,7 @@
         }
     } else {
         # are we installing an existing version due to force or epoch override?
-        if {([info exists options(ports_force)] || $epoch_override == 1)
-            && [registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
+        if {[registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
              ui_debug "Uninstalling $portname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)"
             # we have to force the uninstall in case of dependents
             set force_cur [info exists options(ports_force)]

Modified: branches/new-help-system/base/src/package1.0/portarchive.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portarchive.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/package1.0/portarchive.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -37,7 +37,7 @@
 set org.macports.archive [target_new org.macports.archive portarchive::archive_main]
 target_init ${org.macports.archive} portarchive::archive_init
 target_provides ${org.macports.archive} archive
-target_requires ${org.macports.archive} main fetch extract checksum patch configure build destroot
+target_requires ${org.macports.archive} main unarchive fetch extract checksum patch configure build destroot
 target_prerun ${org.macports.archive} portarchive::archive_start
 target_postrun ${org.macports.archive} portarchive::archive_finish
 
@@ -107,15 +107,24 @@
 		set skipped 1
 	} else {
 		set unsupported 0
+		set any_missing no
 		foreach archive.type [option portarchivetype] {
 			if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
 				set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
 				set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
+				if {![file exists ${archive.path}]} {
+				    set any_missing yes
+				}
 			} else {
 				ui_debug "Skipping [string toupper ${archive.type}] archive: $errmsg"
 				set unsupported [expr $unsupported + 1]
 			}
 		}
+		if {!$any_missing} {
+			# might be nice to allow forcing, but let's fix #16061 first
+			ui_debug "Skipping archive ($portname) since archive(s) already exist"
+			set skipped 1
+		}
 		if {${archive.type} == "xpkg"} {
 			set archive.meta true
 		}
@@ -407,7 +416,7 @@
                 puts $sd "</item>"
             puts $sd "</provides>"
             
-    set res [mport_search ^$portname\$]
+    set res [mport_lookup $portname]
     if {[llength $res] < 2} {
         ui_error "Dependency $portname not found"
     } else {

Modified: branches/new-help-system/base/src/package1.0/portdpkg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portdpkg.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/package1.0/portdpkg.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -161,10 +161,10 @@
 
 proc portdpkg::make_dependency_list {portname} {
 	set result {}
-	if {[catch {set res [mport_search "^$portname\$"]} error]} {
+	if {[catch {set res [mport_lookup $portname]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
-		ui_error "port search failed: $error"
+		ui_error "port lookup failed: $error"
 		return 1
 	}
 	foreach {name array} $res {

Modified: branches/new-help-system/base/src/package1.0/portmpkg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portmpkg.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/package1.0/portmpkg.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -57,10 +57,10 @@
 
 proc portmpkg::make_dependency_list {portname} {
 	set result {}
-	if {[catch {set res [mport_search "^$portname\$"]} error]} {
+	if {[catch {set res [mport_lookup $portname]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
-		ui_error "port search failed: $error"
+		ui_error "port lookup failed: $error"
 		return 1
 	}
 	foreach {name array} $res {
@@ -91,10 +91,10 @@
 
 proc portmpkg::make_one_package {portname portversion destination} {
 	global prefix package.destpath package.flat
-	if {[catch {set res [mport_search "^$portname\$"]} result]} {
+	if {[catch {set res [mport_lookup $portname]} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
-		ui_error "port search failed: $result"
+		ui_error "port lookup failed: $result"
 		return 1
 	}
 	foreach {name array} $res {
@@ -137,9 +137,9 @@
 	system "cp -PR ${pkgpath} ${mpkgpath}/Contents/Packages/"
 	lappend dependencies ${portname}-${portversion}.pkg
 	
-    write_PkgInfo ${mpkgpath}/Contents/PkgInfo
+    portpkg::write_PkgInfo ${mpkgpath}/Contents/PkgInfo
     mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $portrevision $prefix $dependencies
-    write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
+    portpkg::write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
     # long_description, description, or homepage may not exist
     foreach variable {long_description description homepage} {
 	if {![info exists $variable]} {
@@ -148,7 +148,7 @@
 	    set pkg_$variable [set $variable]
 	}
     }
-    write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
+    portpkg::write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
     file copy -force -- [getportresourcepath $porturl "port1.0/package/background.tiff"] ${mpkgpath}/Contents/Resources/background.tiff
 
 	return 0

Modified: branches/new-help-system/base/src/package1.0/portrpm.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portrpm.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/package1.0/portrpm.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -129,10 +129,10 @@
 
 proc portrpm::make_dependency_list {portname} {
     set result {}
-    if {[catch {set res [mport_search "^$portname\$"]} error]} {
+    if {[catch {set res [mport_lookup $portname]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
-        ui_error "port search failed: $error"
+        ui_error "port lookup failed: $error"
         return 1
     }
     foreach {name array} $res {

Modified: branches/new-help-system/base/src/package1.0/portsrpm.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portsrpm.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/package1.0/portsrpm.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -126,10 +126,10 @@
 
 proc portsrpm::make_dependency_list {portname} {
     set result {}
-    if {[catch {set res [mport_search "^$portname\$"]} error]} {
+    if {[catch {set res [mport_lookup $portname]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
-        ui_error "port search failed: $error"
+        ui_error "port lookup failed: $error"
         return 1
     }
     foreach {name array} $res {

Modified: branches/new-help-system/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portunarchive.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/package1.0/portunarchive.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -308,9 +308,6 @@
 
     # Update the state from unpacked archive version
     set target_state_fd [open_statefile]
-
-	# Archive unpacked, skip archive target
-	write_statefile target "org.macports.archive" $target_state_fd
     
 	# Cleanup all control files when finished
 	set control_files [glob -nocomplain -types f [file join $destpath +*]]

Modified: branches/new-help-system/base/src/pextlib1.0/Makefile
===================================================================
--- branches/new-help-system/base/src/pextlib1.0/Makefile	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/pextlib1.0/Makefile	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,6 +1,6 @@
 OBJS=		Pextlib.o strsed.o fgetln.o md5cmd.o setmode.o xinstall.o \
 		fs-traverse.o strcasecmp.o vercomp.o filemap.o \
-		sha1cmd.o compat.o curl.o rmd160cmd.o readline.o uid.o\
+		sha1cmd.o curl.o rmd160cmd.o readline.o uid.o\
 		tracelib.o tty.o get_systemconfiguration_proxies.o
 SHLIB_NAME=	Pextlib${SHLIB_SUFFIX}
 INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/pextlib1.0

Modified: branches/new-help-system/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/new-help-system/base/src/pextlib1.0/Pextlib.c	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/pextlib1.0/Pextlib.c	2009-05-12 17:37:20 UTC (rev 50909)
@@ -111,7 +111,6 @@
 #include "curl.h"
 #include "xinstall.h"
 #include "vercomp.h"
-#include "compat.h"
 #include "readline.h"
 #include "uid.h"
 #include "tracelib.h"
@@ -1296,7 +1295,6 @@
 	Tcl_CreateObjCommand(interp, "rpm-vercomp", RPMVercompCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "rmd160", RMD160Cmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "sha1", SHA1Cmd, NULL, NULL);
-	Tcl_CreateObjCommand(interp, "compat", CompatCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "umask", UmaskCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "sudo", SudoCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "mkfifo", MkfifoCmd, NULL, NULL);

Deleted: branches/new-help-system/base/src/pextlib1.0/compat.c
===================================================================
--- branches/new-help-system/base/src/pextlib1.0/compat.c	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/pextlib1.0/compat.c	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,279 +0,0 @@
-/*
- * compat.c
- * $Id$
- *
- * Copyright (c) 2004 Paul Guyot, The MacPorts Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of MacPorts Team nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/param.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-
-#if HAVE_LIBGEN_H
-#include <libgen.h>
-#endif
-
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <tcl.h>
-#include <tclDecls.h>
-
-#include "compat.h"
-
-/* Avoid a warning with Tcl < 8.4, even if Tcl_GetIndexFromObj's tablePtr
-probably isn't modified. */
-#if (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION >= 4)
-typedef CONST char* tableEntryString;
-#else
-typedef char* tableEntryString;
-#endif
-
-/* ========================================================================= **
- * Definitions
- * ========================================================================= */
-#pragma mark Definitions
-
-/* ------------------------------------------------------------------------- **
- * Prototypes
- * ------------------------------------------------------------------------- */
-int CompatFileNormalize(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
-
-/* ========================================================================= **
- * Entry points
- * ========================================================================= */
-#pragma mark -
-#pragma mark Entry points
-
-
-/**
- * compat filelinkhard subcommand entry point.
- *
- * @param interp		current interpreter
- * @param objc			number of parameters
- * @param objv			parameters
- */
-int
-CompatFileLinkHard(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
-{
-	int theResult = TCL_OK;
-
-	do {
-		char* theSrcPath;
-		char* theDstPath;
-		
-		/* we only have two parameters. */
-		if (objc != 4) {
-			Tcl_WrongNumArgs(interp, 1, objv, "filelinkhard dstpath srcpath");
-			theResult = TCL_ERROR;
-			break;
-		}
-
-		/* retrieve the parameters */
-		theDstPath = Tcl_GetString(objv[2]);
-		theSrcPath = Tcl_GetString(objv[3]);
-		
-		/* perform the hard link */
-		if (link(theSrcPath, theDstPath) < 0)
-		{
-			/* some error occurred. Report it. */
-			Tcl_SetResult(interp, strerror(errno), TCL_VOLATILE);
-			theResult = TCL_ERROR;
-			break;
-		}
-    } while (0);
-    
-	return theResult;
-}
-
-/**
- * compat filelinksymbolic subcommand entry point.
- *
- * @param interp		current interpreter
- * @param objc			number of parameters
- * @param objv			parameters
- */
-int
-CompatFileLinkSymbolic(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
-{
-	int theResult = TCL_OK;
-
-	do {
-		char* theSrcPath;
-		char* theDstPath;
-		
-		/* we only have two parameters. */
-		if (objc != 4) {
-			Tcl_WrongNumArgs(interp, 1, objv, "filelinksymbolic dstpath srcpath");
-			theResult = TCL_ERROR;
-			break;
-		}
-
-		/* retrieve the parameters */
-		theDstPath = Tcl_GetString(objv[2]);
-		theSrcPath = Tcl_GetString(objv[3]);
-		
-		/* perform the symbolic link */
-		if (symlink(theSrcPath, theDstPath) < 0)
-		{
-			/* some error occurred. Report it. */
-			Tcl_SetResult(interp, strerror(errno), TCL_VOLATILE);
-			theResult = TCL_ERROR;
-			break;
-		}
-    } while (0);
-    
-	return theResult;
-}
-
-/**
- * compat filenormalize subcommand entry point.
- *
- * @param interp		current interpreter
- * @param objc			number of parameters
- * @param objv			parameters
- */
-int
-CompatFileNormalize(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
-{
-	int theResult = TCL_OK;
-
-	do {
-		char* thePath;
-		char tmpPath[PATH_MAX];
-		char* theBaseName;
-		char theNormalizedPath[PATH_MAX];
-		int pathlength;
-		int baselength;
-		
-		/*	unique (second) parameter is the file path */
-		if (objc != 3) {
-			Tcl_WrongNumArgs(interp, 1, objv, "filenormalize path");
-			theResult = TCL_ERROR;
-			break;
-		}
-
-		/* retrieve the parameter */
-		thePath = Tcl_GetString(objv[2]);
-		
-		/* Some implementations of dirname(3) modify the memory
-			referenced by its argument, so we make a copy of thePath
-			just in case. */
-		(void) strncpy(tmpPath, (const char*) thePath, sizeof(tmpPath));
-
-		/* normalize the dir name */
-		(void) realpath(dirname(tmpPath), theNormalizedPath);
-		
-		/* append the base name */
-		pathlength = strlen(theNormalizedPath);
-		theBaseName = basename(thePath);
-		baselength = strlen(theBaseName);
-		if (pathlength + baselength + 1 >= PATH_MAX)
-		{
-			Tcl_SetResult(interp, "path is too long", TCL_STATIC);
-			theResult = TCL_ERROR;
-			break;
-		}
-		theNormalizedPath[pathlength] = '/';
-		/* copy with null terminator */
-		(void) memcpy(
-					&theNormalizedPath[pathlength + 1],
-					theBaseName,
-					baselength + 1);
-		
-		Tcl_SetResult(interp, theNormalizedPath, TCL_VOLATILE);
-    } while (0);
-    
-	return theResult;
-}
-
-/**
- * compat command entry point.
- *
- * @param clientData	custom data (ignored)
- * @param interp		current interpreter
- * @param objc			number of parameters
- * @param objv			parameters
- */
-int
-CompatCmd(
-		ClientData clientData UNUSED,
-		Tcl_Interp* interp,
-		int objc, 
-		Tcl_Obj* CONST objv[])
-{
-    typedef enum {
-    	kCompatFileNormalize,
-    	kCompatFileLinkHard,
-    	kCompatFileLinkSymbolic
-    } EOption;
-    
-	static tableEntryString options[] = {
-		"filenormalize", "filelinkhard", "filelinksymbolic", NULL
-	};
-
-	int theResult = TCL_OK;
-	EOption theOptionIndex;
-
-	if (objc < 2) {
-		Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
-		return TCL_ERROR;
-	}
-
-	theResult = Tcl_GetIndexFromObj(
-				interp,
-				objv[1],
-				options,
-				"option",
-				0,
-				(int*) &theOptionIndex);
-	if (theResult == TCL_OK) {
-		switch (theOptionIndex)
-		{
-			case kCompatFileNormalize:
-				theResult = CompatFileNormalize(interp, objc, objv);
-				break;
-
-			case kCompatFileLinkHard:
-				theResult = CompatFileLinkHard(interp, objc, objv);
-				break;
-
-			case kCompatFileLinkSymbolic:
-				theResult = CompatFileLinkSymbolic(interp, objc, objv);
-				break;
-		}
-	}
-	
-	return theResult;
-}

Deleted: branches/new-help-system/base/src/pextlib1.0/compat.h
===================================================================
--- branches/new-help-system/base/src/pextlib1.0/compat.h	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/pextlib1.0/compat.h	2009-05-12 17:37:20 UTC (rev 50909)
@@ -1,60 +0,0 @@
-/*
- * compat.h
- * $Id$
- *
- * Copyright (c) 2004 Paul Guyot, The MacPorts Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of MacPorts Team nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _COMPAT_H
-#define _COMPAT_H
-
-#include <tcl.h>
-
-/**
- * A native command to handle limitation of old versions of Tcl.
- *
- * The syntax is:
- * compat filenormalize path
- *	Normalize path just like file normalize does.
- *  Fixes a problem with Tcl installations affected by bug #953284. (this is
- *	the case with 10.3's Tcl)
- *
- * compat filelinkhard dstpath srcpath
- *	Creates a hard link just like file link -hard does.
- *  Fixes a problem with Tcl installations that do not understand link
- *  (typically 10.2's Tcl).
- *
- * compat filelinksymbolic dstpath srcpath
- *	Creates a symbolic link just like file link -symbolic does.
- *  Fixes a problem with Tcl installations that do not understand link
- *  (typically 10.2's Tcl).
- */
-int CompatCmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
-
-#endif
-		/* _COMPAT_H */

Modified: branches/new-help-system/base/src/port/port-help.tcl
===================================================================
--- branches/new-help-system/base/src/port/port-help.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port/port-help.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -43,7 +43,7 @@
 }
 
 set porthelp(compact) {
-Compact the given ports
+Compact the given ports (unimplemented)
 }
 
 set porthelp(configure) {
@@ -99,7 +99,7 @@
 set porthelp(echo) {
 Returns the list of ports the argument expands to
 
-This can be useful to what a pseudo-port expands.
+This can be useful to see what a pseudo-port expression expands to.
 }
 
 set porthelp(edit) {
@@ -131,7 +131,7 @@
 }
 
 set porthelp(help) {
-Displays short help texts for the given ports
+Displays short help texts for the given commands
 }
 
 set porthelp(info) {
@@ -156,7 +156,7 @@
 }
 
 set porthelp(installed) {
-List installed versions of the given port
+List installed versions of the given port, or all installed ports if no port is given
 }
 
 set porthelp(lint) {
@@ -180,7 +180,7 @@
 }
 
 set porthelp(mdmg) {
-Creates a dmg for each of the given ports
+Creates a dmg containing an mpkg for each of the given ports and their dependencies
 }
 
 set porthelp(mirror) {
@@ -188,7 +188,7 @@
 }
 
 set porthelp(mpkg) {
-Creates a mpkg for each of the given ports
+Creates an mpkg for each of the given ports and their dependencies
 }
 
 set porthelp(outdated) {
@@ -196,7 +196,7 @@
 }
 
 set porthelp(patch) {
-Applies patches on each of the given port
+Applies patches to each of the given ports
 }
 
 set porthelp(pkg) {
@@ -204,11 +204,11 @@
 }
 
 set porthelp(platform) {
-Returns the current platform you are on
+Returns the current platform that port is running on
 }
 
 set porthelp(provides) {
-Return which port (or ports) provide the file (or files) given
+Return which port provides each of the files given
 }
 
 set porthelp(quit) $porthelp(exit)
@@ -220,11 +220,16 @@
 set porthelp(search) {
 Search for a port
 
-This looks in name, desription and long_description of each port for the given search string.
+--case-sensitive   match the search string in a case-sensitive manner
+--exact   match the literal search string exactly
+--glob    treat the given search string as a glob (default)
+--line    print each result on a single line
+--regex   treat the given search string as a regular expression
+--<field> match against <field>, default is '--name --description'
 }
 
 set porthelp(select) {
-Select between mulitple versions of a versioned port
+Select between multiple versions of a versioned port
 
 This allows you to choose which version, among several installed versions
 of a port, is to be considered primary.  What this means is which version
@@ -245,7 +250,7 @@
 }
 
 set porthelp(selfupdate) {
-Upgrade MacPorts itself
+Upgrade MacPorts itself and run the sync target
 }
 
 set porthelp(srpm) {
@@ -253,7 +258,7 @@
 }
 
 set porthelp(submit) {
-Submit a port to the MacPorts Web Application
+Submit a port to the MacPorts Web Application (unimplemented)
 }
 
 set porthelp(sync) {
@@ -264,16 +269,12 @@
 Run tests on each of the given ports
 }
 
-set porthelp(trace) {
-Trace a port
-}
-
 set porthelp(unarchive) {
-Unarchive a port
+Unarchive the given ports
 }
 
 set porthelp(uncompact) {
-Uncompact a port
+Uncompact a port (unimplemented)
 }
 
 set porthelp(uninstall) {
@@ -299,7 +300,7 @@
 }
 
 set porthelp(variants) {
-Returns a list of variants with descriptions available for the given ports
+Returns a list of variants provided by the given ports, with descriptions if present
 }
 
 set porthelp(version) {

Modified: branches/new-help-system/base/src/port/port.tcl
===================================================================
--- branches/new-help-system/base/src/port/port.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port/port.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -369,9 +369,9 @@
         }
         uplevel 1 $block
         if {[file exists $savedir]} {
-        	cd $savedir
+            cd $savedir
         } else {
-        	cd ~
+            cd ~
         }
     }
 }
@@ -407,12 +407,12 @@
 }
 
 proc portlist_compareint { a b } {
-    array set a_ [list "name" [lindex $a 0] "version" [lindex $a 1] "revision" [lindex $a 2]]
-    array set b_ [list "name" [lindex $b 0] "version" [lindex $b 1] "revision" [lindex $b 2]]
+    array set a_ [list "name" [lindex $a 0] "version" "[lindex $a 1]_[lindex $a 2]"]
+    array set b_ [list "name" [lindex $b 0] "version" "[lindex $b 1]_[lindex $b 2]"]
     return [portlist_compare [array get a_] [array get b_]]
 }
 
-# Same as portlist_sort, but with numeric indexes
+# Same as portlist_sort, but with numeric indexes {name version revision}
 proc portlist_sortint { list } {
     return [lsort -command portlist_compareint $list]
 }
@@ -1339,15 +1339,15 @@
         return 0
     }
 
-	if {[file exists $helpfile]} {
-		if {[catch {source $helpfile} err]} {
-			puts stderr "Error reading helpfile $helpfile: $err"
-			return 1
-		}
+    if {[file exists $helpfile]} {
+        if {[catch {source $helpfile} err]} {
+            puts stderr "Error reading helpfile $helpfile: $err"
+            return 1
+        }
     } else {
-		puts stderr "Unable to open help file $helpfile"
-		return 1
-	}
+        puts stderr "Unable to open help file $helpfile"
+        return 1
+    }
 
     foreach topic $portlist {
         if {![info exists porthelp($topic)]} {
@@ -1468,6 +1468,7 @@
             homepage    Homepage
             platforms   Platforms
             maintainers Maintainers
+            license     License
         }
 
         # Wrap-length map for pretty printing
@@ -1481,6 +1482,7 @@
             long_description 22
             homepage 22
             platforms 22
+            license 22
             maintainers 22
         }
 
@@ -1535,7 +1537,8 @@
                 ports_info_long_description ports_info_homepage 
                 ports_info_skip_line ports_info_depends_build
                 ports_info_depends_lib ports_info_depends_run
-                ports_info_platforms ports_info_maintainers
+                ports_info_platforms ports_info_license
+                ports_info_maintainers
             }
         }
         foreach { option } $opts_todo {
@@ -1785,7 +1788,7 @@
         return 1
     }
     foreach filename $portlist {
-        set file [compat filenormalize $filename]
+        set file [file normalize $filename]
         if {[file exists $file]} {
             if {![file isdirectory $file]} {
                 set port [registry::file_registered $file]
@@ -1955,7 +1958,7 @@
     # shared depscache for all ports in the list
     array set depscache {}
     foreachport $portlist {
-        if {[catch {registry::installed $portname}]} {
+        if {![registry::entry_exists_for_name $portname]} {
             ui_error "$portname is not installed"
             return 1
         }
@@ -2083,14 +2086,14 @@
             global errorInfo
             ui_debug "$errorInfo"
 
-			# start gsoc08-privileges	
-			if { [string first "permission denied" $result] != -1 } {
-				set result "port requires root privileges for this action and needs you to execute 'sudo port uninstall $portname' to continue."
-				#ui_msg [exec sudo port uninstall $portname]
-				# The above line is what should be here to let the user simply enter his/her password to uninstall as root.
-				# However, for some as yet unknown reason, executing it here will not work.
-			}
-			# end gsoc08-privileges
+            # start gsoc08-privileges
+            if { [string first "permission denied" $result] != -1 } {
+                set result "port requires root privileges for this action and needs you to execute 'sudo port uninstall $portname' to continue."
+                #ui_msg [exec sudo port uninstall $portname]
+                # The above line is what should be here to let the user simply enter his/her password to uninstall as root.
+                # However, for some as yet unknown reason, executing it here will not work.
+            }
+            # end gsoc08-privileges
 
             break_softcontinue "port uninstall failed: $result" 1 status
         }
@@ -2821,7 +2824,13 @@
                 break_softcontinue "lookup of portname $portname failed: $result" 1 status
             }
             if {[llength $res] < 2} {
-                break_softcontinue "Port $portname not found" 1 status
+                # don't error for ports that are installed but not in the tree
+                if {[registry::entry_exists_for_name $portname]} {
+                    ui_warn "Skipping $portname (not in the ports tree)"
+                    continue
+                } else {
+                    break_softcontinue "Port $portname not found" 1 status
+                }
             }
             array unset portinfo
             array set portinfo [lindex $res 1]
@@ -2856,23 +2865,23 @@
         mportclose $workername
         
         # start gsoc08-privileges
-		if { [geteuid] != 0 && $result == 2} {
-			# mportexec will return an error result code 2 if eval_targets fails due to insufficient privileges.
+        if { [geteuid] != 0 && $result == 2} {
+            # mportexec will return an error result code 2 if eval_targets fails due to insufficient privileges.
 
-			set portbinary "${macports::prefix}/bin/port"
-			
-			ui_info "Attempting port action with 'sudo port': 'sudo $portbinary $target $portname'."
-			set result 0
-			if {[catch {set sudomsgs [exec sudo $portbinary $target $portname]} sudomsgs]} {
-	            global errorInfo
-	            ui_debug "$errorInfo"
-				break_softcontinue "Unable to execute port: $errorInfo" 1 status
-	        }
-			
-			ui_msg $sudomsgs
-			ui_debug "'sudo $portbinary $target $portname' has completed."
-		}
-		# end gsoc08-privileges
+            set portbinary "${macports::prefix}/bin/port"
+
+            ui_info "Attempting port action with 'sudo port': 'sudo $portbinary $target $portname'."
+            set result 0
+            if {[catch {set sudomsgs [exec sudo $portbinary $target $portname]} sudomsgs]} {
+                global errorInfo
+                ui_debug "$errorInfo"
+                break_softcontinue "Unable to execute port: $errorInfo" 1 status
+            }
+
+            ui_msg $sudomsgs
+            ui_debug "'sudo $portbinary $target $portname' has completed."
+        }
+        # end gsoc08-privileges
         
         # Process any error that wasn't thrown and handled already
         if {$result} {
@@ -3068,8 +3077,8 @@
     edit        {{editor 1}}
     ed          {{editor 1}}
     info        {category categories depends_build depends_lib depends_run
-                 depends description epoch fullname heading homepage index line
-                 long_description
+                 depends description epoch fullname heading homepage index license
+                 line long_description
                  maintainer maintainers name platform platforms portdir pretty
                  revision variant variants version}
     search      {case-sensitive category categories depends_build depends_lib depends_run

Modified: branches/new-help-system/base/src/port/portindex.tcl
===================================================================
--- branches/new-help-system/base/src/port/portindex.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port/portindex.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -23,8 +23,6 @@
 # Pass global options into mportinit
 mportinit ui_options global_options global_variations
 
-
-
 # Standard procedures
 proc print_usage args {
     global argv0
@@ -34,8 +32,8 @@
     puts "-d:\tOutput debugging information"
 }
 
-proc pindex {portdir} { 
-    global target fd directory archive outdir stats 
+proc pindex {portdir} {
+    global target fd directory archive outdir stats
     incr stats(total)
     global macports::prefix
     set save_prefix $prefix
@@ -92,19 +90,21 @@
         {^-.+} {
             if {$arg == "-a"} { # Turn on archiving
                 set archive 1
-        } elseif {$arg == "-d"} { # Turn on debug output
-            set ui_options(ports_debug) yes
-        } elseif {$arg == "-o"} { # Set output directory
-            incr i
-            set outdir [lindex $argv $i]
-        } else {
-            puts stderr "Unknown option: $arg"
-            print_usage
-            exit 1
+            } elseif {$arg == "-d"} { # Turn on debug output
+                set ui_options(ports_debug) yes
+            } elseif {$arg == "-o"} { # Set output directory
+                incr i
+                set outdir [lindex $argv $i]
+            } else {
+                puts stderr "Unknown option: $arg"
+                print_usage
+                exit 1
+            }
         }
+        default {
+            set directory $arg
+        }
     }
-    default { set directory $arg }
-    }
 }
 
 if {$archive == 1 && ![info exists outdir]} {
@@ -117,7 +117,7 @@
     set directory .
 }
 
-# cd to input directory 
+# cd to input directory
 if {[catch {cd $directory} result]} {
     puts stderr "$result"
     exit 1

Modified: branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in	2009-05-12 17:37:20 UTC (rev 50909)
@@ -47,5 +47,4 @@
 	variable install_group "@DSTGRP@"
 	variable prefix "@prefix_expanded@"
 	variable macportsuser "@RUNUSR@"
-	variable x11prefix "@x11prefix@"
 }

Modified: branches/new-help-system/base/src/port1.0/portactivate.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portactivate.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portactivate.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -17,7 +17,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -41,9 +41,9 @@
 target_state ${org.macports.activate} no
 target_provides ${org.macports.activate} activate
 if {[option portarchivemode] == "yes"} {
-	target_requires ${org.macports.activate} main unarchive fetch extract checksum patch configure build destroot archive install
+    target_requires ${org.macports.activate} main unarchive fetch extract checksum patch configure build destroot archive install
 } else {
-	target_requires ${org.macports.activate} main fetch extract checksum patch configure build destroot install
+    target_requires ${org.macports.activate} main fetch extract checksum patch configure build destroot install
 }
 
 namespace eval portactivate {
@@ -52,13 +52,40 @@
 set_ui_prefix
 
 proc portactivate::activate_main {args} {
-	global portname portversion portrevision portvariants user_options portnotes
-	registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
+    global env portname portversion portrevision portvariants user_options portnotes
+    registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
 
     # Display notes at the end of the activation phase.
     if {[info exists portnotes] && $portnotes ne {}} {
-        ui_msg \n$portnotes\n
+        # If env(COLUMNS) exists, limit each line's width to this width.
+        if {[info exists env(COLUMNS)]} {
+            set maxlen $env(COLUMNS)
+
+            ui_msg ""
+            foreach line [split $portnotes "\n"] {
+                set joiner ""
+                set lines ""
+                set newline ""
+
+                foreach word [split $line " "] {
+                    if {[string length $newline] + [string length $word] >= $maxlen} {
+                        lappend lines $newline
+                        set newline ""
+                        set joiner ""
+                    }
+                    append newline $joiner $word
+                    set joiner " "
+                }
+                if {$newline ne {}} {
+                    lappend lines $newline
+                }
+                ui_msg [join $lines "\n"]
+            }
+            ui_msg ""
+        } else {
+            ui_msg \n$portnotes\n
+        }
     }
-    
+
     return 0
 }

Modified: branches/new-help-system/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portbuild.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portbuild.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -16,7 +16,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -86,11 +86,11 @@
         pbx {
             set pbxbuild "pbxbuild"
             set xcodebuild "xcodebuild"
-        
+
             if {[option os.platform] != "darwin"} {
                 return -code error "[format [msgcat::mc "This port requires 'pbxbuild/xcodebuild', which is not available on %s."] [option os.platform]]"
             }
-        
+
             if {[catch {set xcodebuild [binaryInPath $xcodebuild]}] == 0} {
                 return $xcodebuild
             } elseif {[catch {set pbxbuild [binaryInPath $pbxbuild]}] == 0} {
@@ -141,16 +141,16 @@
 
 proc portbuild::build_start {args} {
     global UI_PREFIX build.asroot
-    
+
     ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s"] [option portname]]"
-    
+
     # start gsoc08-privileges
     if { [tbool build.asroot] } {
-	# if port is marked as needing root	
-		elevateToRoot "build"
-	}
-	# end gsoc08-privileges
-    
+    # if port is marked as needing root
+        elevateToRoot "build"
+    }
+    # end gsoc08-privileges
+
 }
 
 proc portbuild::build_main {args} {

Modified: branches/new-help-system/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portchecksum.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portchecksum.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -17,7 +17,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -61,8 +61,8 @@
 # global array checksums_array.
 #
 # There are two formats:
-# type value [type value [type value]]						for a single file
-# file1 type value [type value [type value]] [file2 ...]	for multiple files.
+# type value [type value [type value]]                      for a single file
+# file1 type value [type value [type value]] [file2 ...]    for multiple files.
 #
 # Portfile is in format #1 if:
 # (1) There is only one distfile.
@@ -72,77 +72,77 @@
 #
 # return yes if the syntax was correct, no if there was a problem.
 proc portchecksum::parse_checksums {checksums_str} {
-	global checksums_array all_dist_files checksum_types checksum_types_count
+    global checksums_array all_dist_files checksum_types checksum_types_count
 
-	# Parse the string of checksums.
-	set nb_checksum [llength $checksums_str]
+    # Parse the string of checksums.
+    set nb_checksum [llength $checksums_str]
 
-	if {[llength $all_dist_files] == 1
-		&& [expr $nb_checksum % 2] == 0
-		&& [expr $nb_checksum / 2] <= $checksum_types_count
-		&& [lsearch -exact $checksum_types [lindex $checksums_str 0]] >= 0} {
-		# Convert to format #2
-		set checksums_str [linsert $checksums_str 0 $all_dist_files]
-		# We increased the size.
-		incr nb_checksum
-	}
-	
-	# Create the array with the checksums.
-	array set checksums_array {}
-	
-	set result yes
-	
-	# Catch out of bounds errors (they're syntax errors).
-	if {[catch {
-		# Parse the string as if it was in format #2.
-		for {set ix_checksum 0} {$ix_checksum < $nb_checksum} {incr ix_checksum} {
-			# first word is the file.
-			set checksum_filename [lindex $checksums_str $ix_checksum]
-			
-			# retrieve the list of values we already know for this file.
-			set checksum_values {}
-			if {[info exists checksums_array($checksum_filename)]} {
-				set checksum_values $checksums_array($checksum_filename)
-			}
-			
-			# append the new value
-			incr ix_checksum
-			while {1} {
-				set checksum_type [lindex $checksums_str $ix_checksum]
-				if {[lsearch -exact $checksum_types $checksum_type] >= 0} {
-					# append the type and the value.
-					incr ix_checksum
-					set checksum_value [lindex $checksums_str $ix_checksum]
-					incr ix_checksum
+    if {[llength $all_dist_files] == 1
+        && [expr $nb_checksum % 2] == 0
+        && [expr $nb_checksum / 2] <= $checksum_types_count
+        && [lsearch -exact $checksum_types [lindex $checksums_str 0]] >= 0} {
+        # Convert to format #2
+        set checksums_str [linsert $checksums_str 0 $all_dist_files]
+        # We increased the size.
+        incr nb_checksum
+    }
 
-					lappend checksum_values $checksum_type
-					lappend checksum_values $checksum_value
-				} else {
-					# this wasn't a type but the next dist file.
-					incr ix_checksum -1
-					break
-				}
+    # Create the array with the checksums.
+    array set checksums_array {}
 
-				# stop if we exhausted all the items in the list.				
-				if {$ix_checksum == $nb_checksum} {
-					break
-				}
-			}
-			
-			# set the values in the array.
-			set checksums_array($checksum_filename) $checksum_values
-		}
-	} error]} {
-		# An error occurred.
-		global errorInfo
-		ui_debug "$errorInfo"
-		ui_error "Couldn't parse checksum line ($checksums_str) [$error]"
-		
-		# Something wrong happened.
-		set result no
-	}
-	
-	return $result
+    set result yes
+
+    # Catch out of bounds errors (they're syntax errors).
+    if {[catch {
+        # Parse the string as if it was in format #2.
+        for {set ix_checksum 0} {$ix_checksum < $nb_checksum} {incr ix_checksum} {
+            # first word is the file.
+            set checksum_filename [lindex $checksums_str $ix_checksum]
+
+            # retrieve the list of values we already know for this file.
+            set checksum_values {}
+            if {[info exists checksums_array($checksum_filename)]} {
+                set checksum_values $checksums_array($checksum_filename)
+            }
+
+            # append the new value
+            incr ix_checksum
+            while {1} {
+                set checksum_type [lindex $checksums_str $ix_checksum]
+                if {[lsearch -exact $checksum_types $checksum_type] >= 0} {
+                    # append the type and the value.
+                    incr ix_checksum
+                    set checksum_value [lindex $checksums_str $ix_checksum]
+                    incr ix_checksum
+
+                    lappend checksum_values $checksum_type
+                    lappend checksum_values $checksum_value
+                } else {
+                    # this wasn't a type but the next dist file.
+                    incr ix_checksum -1
+                    break
+                }
+
+                # stop if we exhausted all the items in the list.
+                if {$ix_checksum == $nb_checksum} {
+                    break
+                }
+            }
+
+            # set the values in the array.
+            set checksums_array($checksum_filename) $checksum_values
+        }
+    } error]} {
+        # An error occurred.
+        global errorInfo
+        ui_debug "$errorInfo"
+        ui_error "Couldn't parse checksum line ($checksums_str) [$error]"
+
+        # Something wrong happened.
+        set result no
+    }
+
+    return $result
 }
 
 # calc_md5
@@ -151,7 +151,7 @@
 # Return the checksum.
 #
 proc portchecksum::calc_md5 {file} {
-	return [md5 file $file]
+    return [md5 file $file]
 }
 
 # calc_sha1
@@ -160,7 +160,7 @@
 # Return the checksum.
 #
 proc portchecksum::calc_sha1 {file} {
-	return [sha1 file $file]
+    return [sha1 file $file]
 }
 
 # calc_rmd160
@@ -169,7 +169,7 @@
 # Return the checksum.
 #
 proc portchecksum::calc_rmd160 {file} {
-	return [rmd160 file $file]
+    return [rmd160 file $file]
 }
 
 # checksum_start
@@ -177,9 +177,9 @@
 # Target prerun procedure; simply prints a message about what we're doing.
 #
 proc portchecksum::checksum_start {args} {
-	global UI_PREFIX
+    global UI_PREFIX
 
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying checksum(s) for %s"] [option portname]]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying checksum(s) for %s"] [option portname]]"
 }
 
 # checksum_main
@@ -187,89 +187,89 @@
 # Target main procedure. Verifies the checksums of all distfiles.
 #
 proc portchecksum::checksum_main {args} {
-	global UI_PREFIX all_dist_files checksum_types checksums_array portverbose checksum.skip
+    global UI_PREFIX all_dist_files checksum_types checksums_array portverbose checksum.skip
 
-	# If no files have been downloaded, there is nothing to checksum.
-	if {![info exists all_dist_files]} {
-		return 0
-	}
-	
-	# Completely bypass checksumming if checksum.skip=yes
-	# This should be considered an extreme measure
-	if {[tbool checksum.skip]} {
-		ui_info "$UI_PREFIX Skipping checksum phase"
-		return 0
-	}
+    # If no files have been downloaded, there is nothing to checksum.
+    if {![info exists all_dist_files]} {
+        return 0
+    }
 
-	# so far, everything went fine.
-	set fail no
-	
-	# Set the list of checksums as the option checksums.
-	set checksums_str [option checksums]
-		
-	# if everything is fine with the syntax, keep on and check the checksum of
-	# the distfiles.
-	if {[parse_checksums $checksums_str] == "yes"} {
-		set distpath [option distpath]
-	
-		foreach distfile $all_dist_files {
-			ui_info "$UI_PREFIX [format [msgcat::mc "Checksumming %s"] $distfile]"
-	
-			# get the full path of the distfile.
-			set fullpath [file join $distpath $distfile]
-	
-			# check that there is at least one checksum for the distfile.
-			if {![info exists checksums_array($distfile)]} {
-				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.
-				set portfile_checksums $checksums_array($distfile)
-	
-				# iterate on this list to check the actual values.
-				foreach {type sum} $portfile_checksums {
-					set calculated_sum [calc_$type $fullpath]
-					if {[string equal $sum $calculated_sum]} {
-						ui_debug "[format [msgcat::mc "Correct (%s) checksum for %s"] $type $distfile]"
-					} else {
-						ui_error "[format [msgcat::mc "Checksum (%s) mismatch for %s"] $type $distfile]"
-						ui_info "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
-						ui_info "[format [msgcat::mc "Distfile checksum: %s %s %s"] $distfile $type $calculated_sum]"
-						
-						# Raise the failure flag
-						set fail yes
-					}
-				}
-			}
-			
-		}
-	} else {
-		# Something went wrong with the syntax.
-		set fail yes
-	}
+    # Completely bypass checksumming if checksum.skip=yes
+    # This should be considered an extreme measure
+    if {[tbool checksum.skip]} {
+        ui_info "$UI_PREFIX Skipping checksum phase"
+        return 0
+    }
 
-	if {[tbool fail]} {
-	
-		# Show the desired checksum line for easy cut-paste
-		set sums ""
-		foreach distfile $all_dist_files {
-			if {[llength $all_dist_files] > 1} {
-				lappend sums $distfile
-			}
-			
-			set fullpath [file join $distpath $distfile]
-			foreach type $checksum_types {
-				lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
-			}
-		}
-		ui_info "The correct checksum line may be:"
-		ui_info [format "%-20s%s" "checksums" [join $sums [format " \\\n%-20s" ""]]]
-		
-		return -code error "[msgcat::mc "Unable to verify file checksums"]"
-	}
+    # so far, everything went fine.
+    set fail no
 
-	return 0
+    # Set the list of checksums as the option checksums.
+    set checksums_str [option checksums]
+
+    # if everything is fine with the syntax, keep on and check the checksum of
+    # the distfiles.
+    if {[parse_checksums $checksums_str] == "yes"} {
+        set distpath [option distpath]
+
+        foreach distfile $all_dist_files {
+            ui_info "$UI_PREFIX [format [msgcat::mc "Checksumming %s"] $distfile]"
+
+            # get the full path of the distfile.
+            set fullpath [file join $distpath $distfile]
+
+            # check that there is at least one checksum for the distfile.
+            if {![info exists checksums_array($distfile)]} {
+                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.
+                set portfile_checksums $checksums_array($distfile)
+
+                # iterate on this list to check the actual values.
+                foreach {type sum} $portfile_checksums {
+                    set calculated_sum [calc_$type $fullpath]
+                    if {[string equal $sum $calculated_sum]} {
+                        ui_debug "[format [msgcat::mc "Correct (%s) checksum for %s"] $type $distfile]"
+                    } else {
+                        ui_error "[format [msgcat::mc "Checksum (%s) mismatch for %s"] $type $distfile]"
+                        ui_info "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
+                        ui_info "[format [msgcat::mc "Distfile checksum: %s %s %s"] $distfile $type $calculated_sum]"
+
+                        # Raise the failure flag
+                        set fail yes
+                    }
+                }
+            }
+
+        }
+    } else {
+        # Something went wrong with the syntax.
+        set fail yes
+    }
+
+    if {[tbool fail]} {
+
+        # Show the desired checksum line for easy cut-paste
+        set sums ""
+        foreach distfile $all_dist_files {
+            if {[llength $all_dist_files] > 1} {
+                lappend sums $distfile
+            }
+
+            set fullpath [file join $distpath $distfile]
+            foreach type $checksum_types {
+                lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
+            }
+        }
+        ui_info "The correct checksum line may be:"
+        ui_info [format "%-20s%s" "checksums" [join $sums [format " \\\n%-20s" ""]]]
+
+        return -code error "[msgcat::mc "Unable to verify file checksums"]"
+    }
+
+    return 0
 }

Modified: branches/new-help-system/base/src/port1.0/portclean.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portclean.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portclean.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -17,7 +17,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -51,59 +51,59 @@
 
 proc portclean::clean_start {args} {
     global UI_PREFIX
-    
+
     ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option portname]]"
 }
 
 proc portclean::clean_main {args} {
     global UI_PREFIX
-	global ports_clean_dist ports_clean_work ports_clean_archive
-	global ports_clean_all usealtworkpath
+    global ports_clean_dist ports_clean_work ports_clean_archive
+    global ports_clean_all usealtworkpath
 
-	if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
-		[info exists ports_clean_dist] && $ports_clean_dist == "yes"} {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option portname]]"
-		clean_dist
-	}
-	if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
-		[info exists ports_clean_archive] && $ports_clean_archive == "yes"} {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option portname]]"
-		clean_archive
-	}
-	if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
-		[info exists ports_clean_work] && $ports_clean_work == "yes" || \
-		(!([info exists ports_clean_dist] && $ports_clean_dist == "yes") && \
-		 !([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
-		 ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option portname]]"
-		 clean_work
-	}
+    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
+        [info exists ports_clean_dist] && $ports_clean_dist == "yes"} {
+        ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option portname]]"
+        clean_dist
+    }
+    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
+        [info exists ports_clean_archive] && $ports_clean_archive == "yes"} {
+        ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option portname]]"
+        clean_archive
+    }
+    if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
+        [info exists ports_clean_work] && $ports_clean_work == "yes" || \
+        (!([info exists ports_clean_dist] && $ports_clean_dist == "yes") && \
+         !([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
+         ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option portname]]"
+         clean_work
+    }
 
-	# start gsoc-08 privileges
-	if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Removing alt source directory for %s"] [option portname]]"
-		clean_altsource
-	}
-	# end gsoc-08 privileges
-	
+    # start gsoc-08 privileges
+    if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
+        ui_info "$UI_PREFIX [format [msgcat::mc "Removing alt source directory for %s"] [option portname]]"
+        clean_altsource
+    }
+    # end gsoc-08 privileges
+
     return 0
 }
 
 proc portclean::clean_altsource {args} {
     global usealtworkpath worksymlink
-    
-    set sourcepath [string map {"work" ""} $worksymlink] 
 
-	if {[file isdirectory $sourcepath]} {
-		ui_debug "Removing directory: ${sourcepath}"
-		if {[catch {delete $sourcepath} result]} {
-			ui_debug "$::errorInfo"
-			ui_error "$result"
-		}
-	} else {
-		ui_debug "No alt source directory found to remove."
-	}
+    set sourcepath [string map {"work" ""} $worksymlink]
 
-	return 0
+    if {[file isdirectory $sourcepath]} {
+        ui_debug "Removing directory: ${sourcepath}"
+        if {[catch {delete $sourcepath} result]} {
+            ui_debug "$::errorInfo"
+            ui_error "$result"
+        }
+    } else {
+        ui_debug "No alt source directory found to remove."
+    }
+
+    return 0
 }
 
 #
@@ -111,142 +111,142 @@
 # This is crude, but works.
 #
 proc portclean::clean_dist {args} {
-	global ports_force portname distpath dist_subdir distfiles
+    global ports_force portname distpath dist_subdir distfiles
 
-	# remove known distfiles for sure (if they exist)
-	set count 0
-	foreach file $distfiles {
-		if {[info exist distpath] && [info exists dist_subdir]} {
-			set distfile [file join $distpath $dist_subdir $file]
-		} else {
-			set distfile [file join $distpath $file]
-		}
-		if {[file isfile $distfile]} {
-			ui_debug "Removing file: $distfile"
-			if {[catch {delete $distfile} result]} {
-				ui_debug "$::errorInfo"
-				ui_error "$result"
-			}
-			set count [expr $count + 1]
-		}
-	}
-	if {$count > 0} {
-		ui_debug "$count distfile(s) removed."
-	} else {
-		ui_debug "No distfiles found to remove at $distpath"
-	}
+    # remove known distfiles for sure (if they exist)
+    set count 0
+    foreach file $distfiles {
+        if {[info exist distpath] && [info exists dist_subdir]} {
+            set distfile [file join $distpath $dist_subdir $file]
+        } else {
+            set distfile [file join $distpath $file]
+        }
+        if {[file isfile $distfile]} {
+            ui_debug "Removing file: $distfile"
+            if {[catch {delete $distfile} result]} {
+                ui_debug "$::errorInfo"
+                ui_error "$result"
+            }
+            set count [expr $count + 1]
+        }
+    }
+    if {$count > 0} {
+        ui_debug "$count distfile(s) removed."
+    } else {
+        ui_debug "No distfiles found to remove at $distpath"
+    }
 
-	# next remove dist_subdir if only needed for this port,
-	# or if user forces us to
-	set dirlist [list]
-	if {($dist_subdir != $portname)} {
-		if {[info exists dist_subdir]} {
-			set distfullpath [file join $distpath $dist_subdir]
-			if {!([info exists ports_force] && $ports_force == "yes")
-				&& [file isdirectory $distfullpath]
-				&& [llength [readdir $distfullpath]] > 0} {
-				ui_warn [format [msgcat::mc "Distfiles directory '%s' may contain distfiles needed for other ports, use the -f flag to force removal" ] [file join $distpath $dist_subdir]]
-			} else {
-				lappend dirlist $dist_subdir
-				lappend dirlist $portname
-			}
-		} else {
-			lappend dirlist $portname
-		}
-	} else {
-		lappend dirlist $portname
-	}
-	# loop through directories
-	set count 0
-	foreach dir $dirlist {
-		set distdir [file join $distpath $dir]
-		if {[file isdirectory $distdir]} {
-			ui_debug "Removing directory: ${distdir}"
-			if {[catch {delete $distdir} result]} {
-				ui_debug "$::errorInfo"
-				ui_error "$result"
-			}
-			set count [expr $count + 1]
-		}
-	}
-	if {$count > 0} {
-		ui_debug "$count distfile directory(s) removed."
-	} else {
-		ui_debug "No distfile directory found to remove."
-	}
-	return 0
+    # next remove dist_subdir if only needed for this port,
+    # or if user forces us to
+    set dirlist [list]
+    if {($dist_subdir != $portname)} {
+        if {[info exists dist_subdir]} {
+            set distfullpath [file join $distpath $dist_subdir]
+            if {!([info exists ports_force] && $ports_force == "yes")
+                && [file isdirectory $distfullpath]
+                && [llength [readdir $distfullpath]] > 0} {
+                ui_warn [format [msgcat::mc "Distfiles directory '%s' may contain distfiles needed for other ports, use the -f flag to force removal" ] [file join $distpath $dist_subdir]]
+            } else {
+                lappend dirlist $dist_subdir
+                lappend dirlist $portname
+            }
+        } else {
+            lappend dirlist $portname
+        }
+    } else {
+        lappend dirlist $portname
+    }
+    # loop through directories
+    set count 0
+    foreach dir $dirlist {
+        set distdir [file join $distpath $dir]
+        if {[file isdirectory $distdir]} {
+            ui_debug "Removing directory: ${distdir}"
+            if {[catch {delete $distdir} result]} {
+                ui_debug "$::errorInfo"
+                ui_error "$result"
+            }
+            set count [expr $count + 1]
+        }
+    }
+    if {$count > 0} {
+        ui_debug "$count distfile directory(s) removed."
+    } else {
+        ui_debug "No distfile directory found to remove."
+    }
+    return 0
 }
 
 proc portclean::clean_work {args} {
     global portbuildpath worksymlink
 
-	if {[file isdirectory $portbuildpath]} {
-		ui_debug "Removing directory: ${portbuildpath}"
-		if {[catch {delete $portbuildpath} result]} {
-			ui_debug "$::errorInfo"
-			ui_error "$result"
-		}
-	} else {
-		ui_debug "No work directory found to remove at ${portbuildpath}"
-	}
+    if {[file isdirectory $portbuildpath]} {
+        ui_debug "Removing directory: ${portbuildpath}"
+        if {[catch {delete $portbuildpath} result]} {
+            ui_debug "$::errorInfo"
+            ui_error "$result"
+        }
+    } else {
+        ui_debug "No work directory found to remove at ${portbuildpath}"
+    }
 
-	# Clean symlink, if necessary
-	if {![catch {file type $worksymlink} result] && $result eq "link"} {
-		ui_debug "Removing symlink: $worksymlink"
-		delete $worksymlink
-	}
+    # Clean symlink, if necessary
+    if {![catch {file type $worksymlink} result] && $result eq "link"} {
+        ui_debug "Removing symlink: $worksymlink"
+        delete $worksymlink
+    }
 
-	return 0
+    return 0
 }
 
 proc portclean::clean_archive {args} {
-	global workpath portarchivepath portname portversion ports_version_glob
+    global workpath portarchivepath portname portversion ports_version_glob
 
-	# Define archive destination directory and target filename
-	if {$portarchivepath ne $workpath && $portarchivepath ne ""} {
-		set archivepath [file join $portarchivepath [option os.platform] [option os.arch]]
-	}
+    # Define archive destination directory and target filename
+    if {$portarchivepath ne $workpath && $portarchivepath ne ""} {
+        set archivepath [file join $portarchivepath [option os.platform] [option os.arch]]
+    }
 
-	if {[info exists ports_version_glob]} {
-		# Match all possible archive variatns that match the version
-		# glob specified by the user for this OS.
-		set fileglob "$portname-[option ports_version_glob]*.[option os.arch].*"
-	} else {
-		# Match all possible archive variants for the current version on
-		# this OS. If you want to delete previous versions, use the
-		# version glob argument to clean.
-		#
-		# We do this because if we don't, then ports that match the
-		# first part of the name (e.g. trying to remove foo-*, it will
-		# pick up anything foo-bar-* as well, which is undesirable).
-		set fileglob "$portname-$portversion*.[option os.arch].*"
-	}
+    if {[info exists ports_version_glob]} {
+        # Match all possible archive variatns that match the version
+        # glob specified by the user for this OS.
+        set fileglob "$portname-[option ports_version_glob]*.[option os.arch].*"
+    } else {
+        # Match all possible archive variants for the current version on
+        # this OS. If you want to delete previous versions, use the
+        # version glob argument to clean.
+        #
+        # We do this because if we don't, then ports that match the
+        # first part of the name (e.g. trying to remove foo-*, it will
+        # pick up anything foo-bar-* as well, which is undesirable).
+        set fileglob "$portname-$portversion*.[option os.arch].*"
+    }
 
-	# Remove the archive files
-	set count 0
-	if {![catch {set archivelist [glob [file join $archivepath $fileglob]]} result]} {
-		foreach path $archivelist {
-			set file [file tail $path]
-			# Make sure file is truly a port archive file, and not
-			# and accidental match with some other file that might exist.
-			if {[regexp "^$portname-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
-				if {[file isfile $path]} {
-					ui_debug "Removing archive: $path"
-					if {[catch {delete $path} result]} {
-						ui_debug "$::errorInfo"
-						ui_error "$result"
-					}
-					set count [expr $count + 1]
-				}
-			}
-		}
-	}
-	if {$count > 0} {
-		ui_debug "$count archive(s) removed."
-	} else {
-		ui_debug "No archives found to remove at $archivepath"
-	}
+    # Remove the archive files
+    set count 0
+    if {![catch {set archivelist [glob [file join $archivepath $fileglob]]} result]} {
+        foreach path $archivelist {
+            set file [file tail $path]
+            # Make sure file is truly a port archive file, and not
+            # and accidental match with some other file that might exist.
+            if {[regexp "^$portname-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
+                if {[file isfile $path]} {
+                    ui_debug "Removing archive: $path"
+                    if {[catch {delete $path} result]} {
+                        ui_debug "$::errorInfo"
+                        ui_error "$result"
+                    }
+                    set count [expr $count + 1]
+                }
+            }
+        }
+    }
+    if {$count > 0} {
+        ui_debug "$count archive(s) removed."
+    } else {
+        ui_debug "No archives found to remove at $archivepath"
+    }
 
-	return 0
+    return 0
 }
 

Modified: branches/new-help-system/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portconfigure.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portconfigure.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -181,6 +181,7 @@
         gcc-4.0 { set name "Mac OS X gcc 4.0" }
         gcc-4.2 { set name "Mac OS X gcc 4.2" }
         llvm-gcc-4.2 { set name "Mac OS X llvm-gcc 4.2" }
+        clang { set name "Mac OS X clang" }
         apple-gcc-3.3 { set name "MacPorts Apple gcc 3.3" }
         apple-gcc-4.0 { set name "MacPorts Apple gcc 4.0" }
         apple-gcc-4.2 { set name "MacPorts Apple gcc 4.2" }
@@ -191,7 +192,6 @@
         macports-gcc-4.2 { set name "MacPorts gcc 4.2" }
         macports-gcc-4.3 { set name "MacPorts gcc 4.3" }
         macports-gcc-4.4 { set name "MacPorts gcc 4.4" }
-        ccc { set name "clang ccc" }
         default { return -code error "Invalid value for configure.compiler" }
     }
     ui_debug "Using compiler '$name'"
@@ -342,6 +342,12 @@
                 cpp  { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 }
             }
         }
+        clang {
+            switch -exact ${type} {
+                cc   { set ret /usr/bin/clang }
+                objc { set ret /usr/bin/clang }
+            }
+        }
         apple-gcc-3.3 {
             switch -exact ${type} {
                 cc  { set ret ${prefix}/bin/gcc-apple-3.3 }
@@ -431,12 +437,6 @@
                 f90  { set ret ${prefix}/bin/gfortran-mp-4.4 }
             }
         }
-        ccc {
-            switch -exact ${type} {
-                cc   { set ret /Developer/usr/bin/ccc }
-                objc { set ret /Developer/usr/bin/ccc }
-            }
-        }
     }
     return $ret
 }

Modified: branches/new-help-system/base/src/port1.0/portdepends.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portdepends.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portdepends.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -16,7 +16,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -53,16 +53,16 @@
 proc portdepends::validate_depends_options {option action {value ""}} {
     global targets
     switch $action {
-		set {
-			foreach depspec $value {
-			    # port syntax accepts colon-separated junk that we do not understand yet.
-				switch -regex $depspec {
-					^(lib|bin|path):([-A-Za-z0-9_/.${}^?+()|\\\\]+):([-._A-Za-z0-9]+)$ {}
-					^(port)(:.+)?:([-._A-Za-z0-9]+)$ {}
-					default { return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec] }
-				}
-			}
-		}
+        set {
+            foreach depspec $value {
+                # port syntax accepts colon-separated junk that we do not understand yet.
+                switch -regex $depspec {
+                    ^(lib|bin|path):([-A-Za-z0-9_/.${}^?+()|\\\\]+):([-._A-Za-z0-9]+)$ {}
+                    ^(port)(:.+)?:([-._A-Za-z0-9]+)$ {}
+                    default { return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec] }
+                }
+            }
+        }
     }
 }
 

Modified: branches/new-help-system/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portdestroot.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portdestroot.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -17,7 +17,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -91,43 +91,43 @@
     global destroot.umask destroot.asroot macportsuser euid egid usealtworkpath altprefix
     global applications_dir frameworks_dir
     variable oldmask
-    
+
     ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${portname}]"
 
-	# start gsoc08-privileges
-	if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } { 
-	# if started with sudo but have dropped the privileges
-		ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
-		ui_debug "Run destroot without sudo to avoid root privileges."
-		ui_debug "Going to escalate privileges back to root."
-		setegid $egid	
-		seteuid $euid	
-		ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
-	}
-	
-	if { [tbool destroot.asroot] && [getuid] != 0 } {
-		global errorisprivileges
-		set errorisprivileges yes
-		return -code error "You can not run this port without elevated privileges. You need to re-run with 'sudo port'.";
-	}
-	
-	if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
-	    # rewrite destroot.args
-	    set argprefix "=[option prefix]"
-	    set newargprefix "=${altprefix}[option prefix]"
-	    set newdestrootargs [string map [list $argprefix $newargprefix] [option destroot.args]]
-	    option destroot.args $newdestrootargs
-	}
-	
-	# end gsoc08-privileges
+    # start gsoc08-privileges
+    if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
+    # if started with sudo but have dropped the privileges
+        ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
+        ui_debug "Run destroot without sudo to avoid root privileges."
+        ui_debug "Going to escalate privileges back to root."
+        setegid $egid
+        seteuid $euid
+        ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
+    }
 
+    if { [tbool destroot.asroot] && [getuid] != 0 } {
+        global errorisprivileges
+        set errorisprivileges yes
+        return -code error "You can not run this port without elevated privileges. You need to re-run with 'sudo port'.";
+    }
+
+    if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
+        # rewrite destroot.args
+        set argprefix "=[option prefix]"
+        set newargprefix "=${altprefix}[option prefix]"
+        set newdestrootargs [string map [list $argprefix $newargprefix] [option destroot.args]]
+        option destroot.args $newdestrootargs
+    }
+
+    # end gsoc08-privileges
+
     set oldmask [umask ${destroot.umask}]
     set mtree ${portutil::autoconf::mtree_path}
-    
+
     if { ${destroot.clean} == "yes" } {
         delete "${destroot}"
     }
-    
+
     file mkdir "${destroot}"
     if { ${os.platform} == "darwin" } {
         system "cd \"${destroot}\" && ${mtree} -e -U -f [file join ${portsharepath} install macosx.mtree]"
@@ -330,10 +330,10 @@
 
     # Restore umask
     umask $oldmask
-    
+
     # start gsoc08-privileges
-	chownAsRoot $destroot
-	# end gsoc08-privileges
+    chownAsRoot $destroot
+    # end gsoc08-privileges
 
     return 0
 }

Modified: branches/new-help-system/base/src/port1.0/portdistcheck.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portdistcheck.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portdistcheck.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -18,7 +18,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -52,87 +52,87 @@
 default distcheck.check moddate
 
 proc portdistcheck::distcheck_main {args} {
-	global distcheck.check
-	global fetch.type
-	global portname portpath
-	
-	set port_moddate [file mtime ${portpath}/Portfile]
+    global distcheck.check
+    global fetch.type
+    global portname portpath
 
-	ui_debug "Portfile modification date is [clock format $port_moddate]"
+    set port_moddate [file mtime ${portpath}/Portfile]
 
-	# Check the distfiles if it's a regular fetch phase.
-	if {"${distcheck.check}" != "none"
-		&& "${fetch.type}" == "standard"} {
-		# portfetch 1.0::checkfiles sets fetch_urls list.
-		global fetch_urls
-		checkfiles
-		set totalsize 0
-		
-		# Check all the files.
-		foreach {url_var distfile} $fetch_urls {
-			global portfetch::$url_var
-			if {![info exists $url_var]} {
-				ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
-				set url_var master_sites
-				global portfetch::$url_var
-			}
-			if {${distcheck.check} == "moddate"} {
-				set count 0
-				foreach site [set $url_var] {
-					ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
-					set file_url [portfetch::assemble_url $site $distfile]
-					if {[catch {set urlnewer [curl isnewer $file_url $port_moddate]} error]} {
-						ui_warn "couldn't fetch $file_url for $portname ($error)"
-					} else {
-						if {$urlnewer} {
-							ui_warn "port $portname: $file_url is newer than portfile"
-						}
-						incr count
-					}
-				}
-				if {$count == 0} {
-					ui_error "no mirror had $distfile for $portname"
-				}
-			} elseif {${distcheck.check} == "filesize"} {
-				set count 0
-				foreach site [set $url_var] {
-					ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
-					set file_url [portfetch::assemble_url $site $distfile]
-					if {[catch {set urlsize [curl getsize $file_url]} error]} {
-						ui_warn "couldn't fetch $file_url for $portname ($error)"
-					} else {
-						incr count
-						if {$urlsize > 0} {
-							ui_info "port $portname: $distfile $urlsize bytes"
-							incr totalsize $urlsize
-							break
-						}
-					}
-				}
-				if {$count == 0} {
-					ui_error "no mirror had $distfile for $portname"
-				}
-			} else {
-				ui_error "unknown distcheck.check ${distcheck.check}"
-				break
-			}
-		}
-		
-		if {${distcheck.check} == "filesize" && $totalsize > 0} {
-			if {$totalsize < 1024} {
-				set size $totalsize
-				set humansize "${size}"
-			} elseif {$totalsize < 1024*1024} {
-				set size [expr $totalsize / 1024.0]
-				set humansize [format "%.1fK" $size]
-			} elseif {$totalsize < 1024*1024*1024} {
-				set size [expr $totalsize / (1024.0*1024.0)]
-				set humansize [format "%.1fM" $size]
-			} else {
-				set size [expr $totalsize / (1024.0*1024.0*1024.0)]
-				set humansize [format "%.1fG" $size]
-			}
-			ui_msg "$portname: $humansize"
-		}
-	}
+    ui_debug "Portfile modification date is [clock format $port_moddate]"
+
+    # Check the distfiles if it's a regular fetch phase.
+    if {"${distcheck.check}" != "none"
+        && "${fetch.type}" == "standard"} {
+        # portfetch 1.0::checkfiles sets fetch_urls list.
+        global fetch_urls
+        checkfiles
+        set totalsize 0
+
+        # Check all the files.
+        foreach {url_var distfile} $fetch_urls {
+            global portfetch::$url_var
+            if {![info exists $url_var]} {
+                ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
+                set url_var master_sites
+                global portfetch::$url_var
+            }
+            if {${distcheck.check} == "moddate"} {
+                set count 0
+                foreach site [set $url_var] {
+                    ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
+                    set file_url [portfetch::assemble_url $site $distfile]
+                    if {[catch {set urlnewer [curl isnewer $file_url $port_moddate]} error]} {
+                        ui_warn "couldn't fetch $file_url for $portname ($error)"
+                    } else {
+                        if {$urlnewer} {
+                            ui_warn "port $portname: $file_url is newer than portfile"
+                        }
+                        incr count
+                    }
+                }
+                if {$count == 0} {
+                    ui_error "no mirror had $distfile for $portname"
+                }
+            } elseif {${distcheck.check} == "filesize"} {
+                set count 0
+                foreach site [set $url_var] {
+                    ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
+                    set file_url [portfetch::assemble_url $site $distfile]
+                    if {[catch {set urlsize [curl getsize $file_url]} error]} {
+                        ui_warn "couldn't fetch $file_url for $portname ($error)"
+                    } else {
+                        incr count
+                        if {$urlsize > 0} {
+                            ui_info "port $portname: $distfile $urlsize bytes"
+                            incr totalsize $urlsize
+                            break
+                        }
+                    }
+                }
+                if {$count == 0} {
+                    ui_error "no mirror had $distfile for $portname"
+                }
+            } else {
+                ui_error "unknown distcheck.check ${distcheck.check}"
+                break
+            }
+        }
+
+        if {${distcheck.check} == "filesize" && $totalsize > 0} {
+            if {$totalsize < 1024} {
+                set size $totalsize
+                set humansize "${size}"
+            } elseif {$totalsize < 1024*1024} {
+                set size [expr $totalsize / 1024.0]
+                set humansize [format "%.1fK" $size]
+            } elseif {$totalsize < 1024*1024*1024} {
+                set size [expr $totalsize / (1024.0*1024.0)]
+                set humansize [format "%.1fM" $size]
+            } else {
+                set size [expr $totalsize / (1024.0*1024.0*1024.0)]
+                set humansize [format "%.1fG" $size]
+            }
+            ui_msg "$portname: $humansize"
+        }
+    }
 }

Modified: branches/new-help-system/base/src/port1.0/portextract.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portextract.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portextract.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -131,11 +131,11 @@
         if {[catch {command_exec extract} result]} {
             return -code error "$result"
         }
-	
-	# start gsoc08-privileges
-	chownAsRoot ${extract.dir}
-	# end gsoc08-privileges
-	
+
+    # start gsoc08-privileges
+    chownAsRoot ${extract.dir}
+    # end gsoc08-privileges
+
     }
     return 0
 }

Modified: branches/new-help-system/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portfetch.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portfetch.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -16,7 +16,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -54,12 +54,12 @@
 
 # define options: distname master_sites
 options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 use_lzma use_7z use_dmg dist_subdir \
-	fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
-	master_sites.mirror_subdir patch_sites.mirror_subdir portname \
-	cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
-	svn.url svn.tag svn.revision svn.method \
-	git.url git.branch \
-	hg.url hg.tag
+    fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
+    master_sites.mirror_subdir patch_sites.mirror_subdir portname \
+    cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
+    svn.url svn.tag svn.revision svn.method \
+    git.url git.branch \
+    hg.url hg.tag
 
 # XXX we use the command framework to buy us some useful features,
 # but this is not a user-modifiable command
@@ -182,12 +182,12 @@
 proc portfetch::suffix {distname} {
     global extract.suffix fetch.type
     switch -- "${fetch.type}" {
-    	cvs			-
-    	svn			-
-    	git			-
-    	hg			{ return "" }
-    	standard	-
-    	default 	{ return "${distname}${extract.suffix}" }
+        cvs         -
+        svn         -
+        git         -
+        hg          { return "" }
+        standard    -
+        default     { return "${distname}${extract.suffix}" }
     }
 }
 # XXX import suffix into the global namespace as it is currently used from
@@ -221,15 +221,15 @@
         }
         return {}
     }
-    
+
     set ret [list]
     foreach element $portfetch::mirror_sites::sites($mirrors) {
-	
-	# here we have the chance to take a look at tags, that possibly
-	# have been assigned in mirror_sites.tcl
-	set splitlist [split $element :]
-	# every element is a URL, so we'll always have multiple elements. no need to check
-    set element "[lindex $splitlist 0]:[lindex $splitlist 1]" 
+
+    # here we have the chance to take a look at tags, that possibly
+    # have been assigned in mirror_sites.tcl
+    set splitlist [split $element :]
+    # every element is a URL, so we'll always have multiple elements. no need to check
+    set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
     set mirror_tag "[lindex $splitlist 2]"
 
     set name_re {\$(?:name\y|\{name\})}
@@ -238,28 +238,28 @@
     if {[regexp $name_re $element]} {
         set mirror_tag ""
     }
-    
-	if {$mirror_tag == "mirror"} {
-		set thesubdir ${dist_subdir}
-	} elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
-		set thesubdir ${portname}
-	} else {
-		set thesubdir ${subdir}
-	}
-	
-	# parse an embedded $name. if present, remove the subdir
-	if {[regsub $name_re $element $thesubdir element] > 0} {
-	    set thesubdir ""
-	}
-	
-	if {"$tag" != ""} {
-	    eval append element "${thesubdir}:${tag}"
-	} else {
-	    eval append element "${thesubdir}"
-	}
+
+    if {$mirror_tag == "mirror"} {
+        set thesubdir ${dist_subdir}
+    } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
+        set thesubdir ${portname}
+    } else {
+        set thesubdir ${subdir}
+    }
+
+    # parse an embedded $name. if present, remove the subdir
+    if {[regsub $name_re $element $thesubdir element] > 0} {
+        set thesubdir ""
+    }
+
+    if {"$tag" != ""} {
+        eval append element "${thesubdir}:${tag}"
+    } else {
+        eval append element "${thesubdir}"
+    }
         eval lappend ret $element
     }
-    
+
     return $ret
 }
 
@@ -271,15 +271,15 @@
 proc portfetch::checksites {args} {
     global patch_sites master_sites master_sites.mirror_subdir \
         patch_sites.mirror_subdir fallback_mirror_site global_mirror_site env
-   
+
     append master_sites " ${global_mirror_site} ${fallback_mirror_site}"
     if {[info exists env(MASTER_SITE_LOCAL)]} {
-	set master_sites [concat $env(MASTER_SITE_LOCAL) $master_sites]
+    set master_sites [concat $env(MASTER_SITE_LOCAL) $master_sites]
     }
-    
+
     append patch_sites " ${global_mirror_site} ${fallback_mirror_site}"
     if {[info exists env(PATCH_SITE_LOCAL)]} {
-	set patch_sites [concat $env(PATCH_SITE_LOCAL) $patch_sites]
+    set patch_sites [concat $env(PATCH_SITE_LOCAL) $patch_sites]
     }
 
     foreach list {master_sites patch_sites} {
@@ -287,26 +287,26 @@
         if {![info exists uplist]} {
             continue
         }
-        
+
         set site_list [list]
         foreach site $uplist {
             if {[regexp {([a-zA-Z]+://.+)} $site match site]} {
                 set site_list [concat $site_list $site]
             } else {
-	    	set splitlist [split $site :]
-		if {[llength $splitlist] > 3 || [llength $splitlist] <1} {
+            set splitlist [split $site :]
+        if {[llength $splitlist] > 3 || [llength $splitlist] <1} {
                     ui_error [format [msgcat::mc "Unable to process mirror sites for: %s, ignoring."] $site]
-		}
-		set mirrors "[lindex $splitlist 0]"
-		set subdir "[lindex $splitlist 1]"
-		set tag "[lindex $splitlist 2]"
+        }
+        set mirrors "[lindex $splitlist 0]"
+        set subdir "[lindex $splitlist 1]"
+        set tag "[lindex $splitlist 2]"
                 if {[info exists $list.mirror_subdir]} {
                     append subdir "[set ${list}.mirror_subdir]"
                 }
                 set site_list [concat $site_list [mirror_sites $mirrors $tag $subdir]]
             }
         }
-        
+
         # add in the global and fallback mirrors for each tag
         foreach site $site_list {
             if {[regexp {([a-zA-Z]+://.+/?):([0-9A-Za-z_-]+)$} $site match site tag]} {
@@ -321,9 +321,9 @@
                 }
             }
         }
-        
+
         foreach site $site_list {
-	    if {[regexp {([a-zA-Z]+://.+/?):([0-9A-Za-z_-]+)$} $site match site tag]} {
+        if {[regexp {([a-zA-Z]+://.+/?):([0-9A-Za-z_-]+)$} $site match site tag]} {
                 lappend portfetch::$tag $site
             } else {
                 lappend portfetch::$list $site
@@ -336,22 +336,22 @@
 proc portfetch::checkpatchfiles {args} {
     global patchfiles all_dist_files patch_sites filespath
     variable fetch_urls
-    
+
     if {[info exists patchfiles]} {
-	foreach file $patchfiles {
-	    if {![file exists $filespath/$file]} {
-		set distsite [getdisttag $file]
-		set file [getdistname $file]
-		lappend all_dist_files $file
-		if {$distsite != ""} {
-		    lappend fetch_urls $distsite $file
-		} elseif {[info exists patch_sites]} {
-		    lappend fetch_urls patch_sites $file
-		} else {
-		    lappend fetch_urls master_sites $file
-		}
-	    }
-	}
+        foreach file $patchfiles {
+            if {![file exists $filespath/$file]} {
+                set distsite [getdisttag $file]
+                set file [getdistname $file]
+                lappend all_dist_files $file
+                if {$distsite != ""} {
+                    lappend fetch_urls $distsite $file
+                } elseif {[info exists patch_sites]} {
+                    lappend fetch_urls patch_sites $file
+                } else {
+                    lappend fetch_urls master_sites $file
+                }
+            }
+        }
     }
 }
 
@@ -359,21 +359,21 @@
 proc portfetch::checkdistfiles {args} {
     global distfiles all_dist_files master_sites filespath
     variable fetch_urls
-    
+
     if {[info exists distfiles]} {
-    foreach file $distfiles {
-	if {![file exists $filespath/$file]} {
-	    set distsite [getdisttag $file]
-	    set file [getdistname $file]
-	    lappend all_dist_files $file
-	    if {$distsite != ""} {
-		lappend fetch_urls $distsite $file
-	    } else {
-		lappend fetch_urls master_sites $file
-	    }
-	}
+        foreach file $distfiles {
+            if {![file exists $filespath/$file]} {
+                set distsite [getdisttag $file]
+                set file [getdistname $file]
+                lappend all_dist_files $file
+                if {$distsite != ""} {
+                    lappend fetch_urls $distsite $file
+                } else {
+                    lappend fetch_urls master_sites $file
+                }
+            }
+        }
     }
-    }
 }
 
 # sorts fetch_urls in order of ping time
@@ -435,7 +435,7 @@
             }
             ui_debug "$host ping time is $pingtimes($host)"
         }
-        
+
         set pinglist {}
         foreach site $urllist {
             regexp $hostregex $site -> host
@@ -454,56 +454,56 @@
 # Perform the full checksites/checkpatchfiles/checkdistfiles sequence.
 # This method is used by distcheck target.
 proc portfetch::checkfiles {args} {
-	variable fetch_urls
+    variable fetch_urls
 
-	checksites
-	checkpatchfiles
-	checkdistfiles
+    checksites
+    checkpatchfiles
+    checkdistfiles
 }
 
 
 # Perform a CVS login and fetch, storing the CVS login
 # information in a custom .cvspass file
 proc portfetch::cvsfetch {args} {
-    global workpath cvs.env cvs.cmd cvs.args cvs.post_args 
+    global workpath cvs.env cvs.cmd cvs.args cvs.post_args
     global cvs.root cvs.date cvs.tag cvs.method cvs.password
     global patch_sites patchfiles filespath
 
     set cvs.args "${cvs.method} ${cvs.args}"
     if {${cvs.method} == "export" && ![string length ${cvs.tag}] && ![string length ${cvs.date}]} {
-    	set cvs.tag "HEAD"
+        set cvs.tag "HEAD"
     }
     if {[string length ${cvs.tag}]} {
-	set cvs.args "${cvs.args} -r ${cvs.tag}"
+        set cvs.args "${cvs.args} -r ${cvs.tag}"
     }
 
     if {[string length ${cvs.date}]} {
-	set cvs.args "${cvs.args} -D ${cvs.date}"
+        set cvs.args "${cvs.args} -D ${cvs.date}"
     }
 
     if {[regexp ^:pserver: ${cvs.root}]} {
-	set savecmd ${cvs.cmd}
-	set saveargs ${cvs.args}
-	set savepost_args ${cvs.post_args}
-	set cvs.cmd "echo ${cvs.password} | $portutil::autoconf::cvs_path"
-	set cvs.args login
-	set cvs.post_args ""
-	if {[catch {command_exec cvs -notty "" "2>&1"} result]} {
-	    return -code error [msgcat::mc "CVS login failed"]
-	}
-	set cvs.cmd ${savecmd}
-	set cvs.args ${saveargs}
-	set cvs.post_args ${savepost_args}
+        set savecmd ${cvs.cmd}
+        set saveargs ${cvs.args}
+        set savepost_args ${cvs.post_args}
+        set cvs.cmd "echo ${cvs.password} | $portutil::autoconf::cvs_path"
+        set cvs.args login
+        set cvs.post_args ""
+        if {[catch {command_exec cvs -notty "" "2>&1"} result]} {
+            return -code error [msgcat::mc "CVS login failed"]
+        }
+        set cvs.cmd ${savecmd}
+        set cvs.args ${saveargs}
+        set cvs.post_args ${savepost_args}
     } else {
-	set env(CVS_RSH) ssh
+        set env(CVS_RSH) ssh
     }
 
     if {[catch {command_exec cvs "" "2>&1"} result]} {
-	return -code error [msgcat::mc "CVS check out failed"]
+        return -code error [msgcat::mc "CVS check out failed"]
     }
 
     if {[info exists patchfiles]} {
-	return [portfetch::fetchfiles]
+        return [portfetch::fetchfiles]
     }
     return 0
 }
@@ -512,33 +512,33 @@
 proc portfetch::svnfetch {args} {
     global workpath prefix_frozen
     global svn.env svn.cmd svn.args svn.post_args svn.revision svn.url svn.method
-    
+
     # Look for the svn command, either in the path or in the prefix
     set goodcmd 0
     foreach svncmd "${svn.cmd} ${prefix_frozen}/bin/svn svn" {
- 	if { [file executable ${svncmd}] } {
- 	   	  set svn.cmd $svncmd
- 	   	  set goodcmd 1
- 	      break;
- 	   }
+        if { [file executable ${svncmd}] } {
+            set svn.cmd $svncmd
+            set goodcmd 1
+            break;
+        }
     }
     if { !$goodcmd } {
-    	ui_error "The subversion tool (svn) is required to fetch ${svn.url}."
-    	ui_error "Please install the subversion port before proceeding."
-		return -code error [msgcat::mc "Subversion check out failed"]
+        ui_error "The subversion tool (svn) is required to fetch ${svn.url}."
+        ui_error "Please install the subversion port before proceeding."
+        return -code error [msgcat::mc "Subversion check out failed"]
     }
-    
+
     set svn.args "${svn.method} ${svn.args}"
     if {[string length ${svn.revision}]} {
-		set svn.args "${svn.args} -r ${svn.revision}"
+        set svn.args "${svn.args} -r ${svn.revision}"
     }
 
     if {[catch {command_exec svn "" "2>&1"} result]} {
-		return -code error [msgcat::mc "Subversion check out failed"]
+        return -code error [msgcat::mc "Subversion check out failed"]
     }
 
     if {[info exists patchfiles]} {
-	return [portfetch::fetchfiles]
+        return [portfetch::fetchfiles]
     }
 
     return 0
@@ -548,7 +548,7 @@
 proc portfetch::gitfetch {args} {
     global worksrcpath prefix_frozen
     global git.url git.branch git.sha1
-    
+
     # Look for the git command
     set git.cmd {}
     foreach gitcmd "$portutil::autoconf::git_path $prefix_frozen/bin/git git" {
@@ -562,7 +562,7 @@
         ui_error "Please install the git-core port before proceeding."
         return -code error [msgcat::mc "Git command not found"]
     }
-    
+
     set options "-q"
     if {[string length ${git.branch}] == 0} {
         # if we're just using HEAD, we can make a shallow repo
@@ -573,7 +573,7 @@
     if {[catch {system $cmdstring} result]} {
         return -code error [msgcat::mc "Git clone failed"]
     }
-    
+
     if {[string length ${git.branch}] > 0} {
         set env "GIT_DIR=${worksrcpath}/.git GIT_WORK_TREE=${worksrcpath}"
         set cmdstring "$env ${git.cmd} checkout -q ${git.branch} 2>&1"
@@ -582,11 +582,11 @@
             return -code error [msgcat::mc "Git checkout failed"]
         }
     }
-    
+
     if {[info exists patchfiles]} {
         return [portfetch::fetchfiles]
     }
-    
+
     return 0
 }
 
@@ -625,139 +625,139 @@
 # Perform a standard fetch, assembling fetch urls from
 # the listed url variable and associated distfile
 proc portfetch::fetchfiles {args} {
-	global distpath all_dist_files UI_PREFIX
-	global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.remote_time
-	global distfile site
-	global portverbose
+    global distpath all_dist_files UI_PREFIX
+    global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.remote_time
+    global distfile site
+    global portverbose
     variable fetch_urls
 
-	if {![file isdirectory $distpath]} {
-		if {[catch {file mkdir $distpath} result]} {
-			return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
-		}
-	}
-	
-	set fetch_options {}
-	if {[string length ${fetch.user}] || [string length ${fetch.password}]} {
-		lappend fetch_options -u
-		lappend fetch_options "${fetch.user}:${fetch.password}"
-	}
-	if {${fetch.use_epsv} != "yes"} {
-		lappend fetch_options "--disable-epsv"
-	}
-	if {${fetch.ignore_sslcert} != "no"} {
-		lappend fetch_options "--ignore-ssl-cert"
-	}
-	if {${fetch.remote_time} != "no"} {
-		lappend fetch_options "--remote-time"
-	}
-	if {$portverbose == "yes"} {
-		lappend fetch_options "-v"
-	}
-	set sorted no
-	
-	foreach {url_var distfile} $fetch_urls {
-		if {![file isfile $distpath/$distfile]} {
-			ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $distpath]"
-			if {![file writable $distpath]} {
-				return -code error [format [msgcat::mc "%s must be writable"] $distpath]
-			}
-			if {!$sorted} {
-			    sortsites
-			    set sorted yes
-			}
-			variable portfetch::$url_var
-			if {![info exists $url_var]} {
-				ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
-				set url_var master_sites
-				variable portfetch::$url_var
-			}
-			unset -nocomplain fetched
-			foreach site [set $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] &&
-					![catch {file rename -force "${distpath}/${distfile}.TMP" "${distpath}/${distfile}"} result]} {
+    if {![file isdirectory $distpath]} {
+        if {[catch {file mkdir $distpath} result]} {
+            return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
+        }
+    }
 
-					# Special hack to check for sourceforge mirrors, which don't return a proper error code on failure
-					if {![string equal $effectiveURL $file_url] &&
-						[string match "*sourceforge*" $file_url] &&
-						[string match "*failedmirror*" $effectiveURL]} {
-						
-						# *SourceForge hackage in effect*
-						# The url seen by curl seems to have been a redirect to the sourceforge mirror page
-						ui_debug "[msgcat::mc "Fetching from sourceforge mirror failed"]"
-						file delete -force "${distpath}/${distfile}.TMP"
-						
-						# Continue on to try the next mirror, if any
-					} else {
-					
-						# Successful fetch
-						set fetched 1
-						break
-					
-					}
+    set fetch_options {}
+    if {[string length ${fetch.user}] || [string length ${fetch.password}]} {
+        lappend fetch_options -u
+        lappend fetch_options "${fetch.user}:${fetch.password}"
+    }
+    if {${fetch.use_epsv} != "yes"} {
+        lappend fetch_options "--disable-epsv"
+    }
+    if {${fetch.ignore_sslcert} != "no"} {
+        lappend fetch_options "--ignore-ssl-cert"
+    }
+    if {${fetch.remote_time} != "no"} {
+        lappend fetch_options "--remote-time"
+    }
+    if {$portverbose == "yes"} {
+        lappend fetch_options "-v"
+    }
+    set sorted no
 
-				} else {
-					ui_debug "[msgcat::mc "Fetching failed:"]: $result"
-					file delete -force "${distpath}/${distfile}.TMP"
-				}
-			}
-			if {![info exists fetched]} {
-				return -code error [msgcat::mc "fetch failed"]
-			}
-		}
-	}
+    foreach {url_var distfile} $fetch_urls {
+        if {![file isfile $distpath/$distfile]} {
+            ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $distpath]"
+            if {![file writable $distpath]} {
+                return -code error [format [msgcat::mc "%s must be writable"] $distpath]
+            }
+            if {!$sorted} {
+                sortsites
+                set sorted yes
+            }
+            variable portfetch::$url_var
+            if {![info exists $url_var]} {
+                ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
+                set url_var master_sites
+                variable portfetch::$url_var
+            }
+            unset -nocomplain fetched
+            foreach site [set $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] &&
+                    ![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
+                    if {![string equal $effectiveURL $file_url] &&
+                        [string match "*sourceforge*" $file_url] &&
+                        [string match "*failedmirror*" $effectiveURL]} {
+
+                        # *SourceForge hackage in effect*
+                        # The url seen by curl seems to have been a redirect to the sourceforge mirror page
+                        ui_debug "[msgcat::mc "Fetching from sourceforge mirror failed"]"
+                        file delete -force "${distpath}/${distfile}.TMP"
+
+                        # Continue on to try the next mirror, if any
+                    } else {
+
+                        # Successful fetch
+                        set fetched 1
+                        break
+
+                    }
+
+                } else {
+                    ui_debug "[msgcat::mc "Fetching failed:"]: $result"
+                    file delete -force "${distpath}/${distfile}.TMP"
+                }
+            }
+            if {![info exists fetched]} {
+                return -code error [msgcat::mc "fetch failed"]
+            }
+        }
+    }
     return 0
 }
 
 # Utility function to delete fetched files.
 proc portfetch::fetch_deletefiles {args} {
-	global distpath
+    global distpath
     variable fetch_urls
-	foreach {url_var distfile} $fetch_urls {
-		if {[file isfile $distpath/$distfile]} {
-			file delete -force "${distpath}/${distfile}"
-		}
-	}
+    foreach {url_var distfile} $fetch_urls {
+        if {[file isfile $distpath/$distfile]} {
+            file delete -force "${distpath}/${distfile}"
+        }
+    }
 }
 
 # Utility function to add files to a list of fetched files.
 proc portfetch::fetch_addfilestomap {filemapname} {
-	global distpath $filemapname
+    global distpath $filemapname
     variable fetch_urls
-	foreach {url_var distfile} $fetch_urls {
-		if {[file isfile $distpath/$distfile]} {
-			filemap set $filemapname $distpath/$distfile 1
-		}
-	}
+    foreach {url_var distfile} $fetch_urls {
+        if {[file isfile $distpath/$distfile]} {
+            filemap set $filemapname $distpath/$distfile 1
+        }
+    }
 }
 
 # Initialize fetch target and call checkfiles.
 proc portfetch::fetch_init {args} {
     global distfiles distname distpath all_dist_files dist_subdir fetch.type fetch_init_done
     global altprefix usealtworkpath
-    
+
     if {[info exists distpath] && [info exists dist_subdir] && ![info exists fetch_init_done]} {
 
-		# start gsoc08-privileges
-	if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
-    	# I have removed ![file writable $distpath] from the if condition as
-    	# the writable condition seems to get confused by effective uids.
-			set distpath "$altprefix/[ string range $distpath 1 end ]"
-			ui_debug "Going to use $distpath for fetch."
-    	}
-    	# end gsoc08-privileges
-	    set distpath ${distpath}/${dist_subdir}
-	    set fetch_init_done yes
+        # start gsoc08-privileges
+        if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
+            # I have removed ![file writable $distpath] from the if condition as
+            # the writable condition seems to get confused by effective uids.
+            set distpath "$altprefix/[ string range $distpath 1 end ]"
+            ui_debug "Going to use $distpath for fetch."
+        }
+        # end gsoc08-privileges
+        set distpath ${distpath}/${dist_subdir}
+        set fetch_init_done yes
     }
     portfetch::checkfiles
 }
 
 proc portfetch::fetch_start {args} {
     global UI_PREFIX portname
-    
+
     ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching %s"] $portname]"
 }
 
@@ -772,14 +772,14 @@
     if {![info exists all_dist_files] && "${fetch.type}" == "standard"} {
         return 0
     }
-    
+
     # Fetch the files
     switch -- "${fetch.type}" {
-    	cvs		{ return [cvsfetch] }
-    	svn		{ return [svnfetch] }
-    	git		{ return [gitfetch] }
-    	hg		{ return [hgfetch] }
-    	standard -
-    	default	{ return [portfetch::fetchfiles] }
+        cvs     { return [cvsfetch] }
+        svn     { return [svnfetch] }
+        git     { return [gitfetch] }
+        hg      { return [hgfetch] }
+        standard -
+        default { return [portfetch::fetchfiles] }
     }
 }

Modified: branches/new-help-system/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portinstall.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portinstall.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -35,12 +35,11 @@
 package require portutil 1.0
 
 set org.macports.install [target_new org.macports.install portinstall::install_main]
-target_state ${org.macports.install} no
 target_provides ${org.macports.install} install
 if {[option portarchivemode] == "yes"} {
-	target_requires ${org.macports.install} main unarchive fetch extract checksum patch configure build destroot archive
+    target_requires ${org.macports.install} main unarchive fetch extract checksum patch configure build destroot archive
 } else {
-	target_requires ${org.macports.install} main fetch extract checksum patch configure build destroot
+    target_requires ${org.macports.install} main fetch extract checksum patch configure build destroot
 }
 target_prerun ${org.macports.install} portinstall::install_start
 
@@ -56,43 +55,42 @@
 set_ui_prefix
 
 proc portinstall::install_start {args} {
-	global UI_PREFIX portname portversion portrevision variations portvariants
-	global install.asroot prefix
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
-	
-	# start gsoc08-privileges
-	if { [tbool install.asroot] } {
-		# if port is marked as needing root	
-		elevateToRoot "install"
-	} elseif { ![file writable $prefix] } {
-		# if install location is not writable, need root privileges to install
-		elevateToRoot "install"
-	}
-	# end gsoc08-privileges
-	
+    global UI_PREFIX portname portversion portrevision variations portvariants
+    global install.asroot prefix
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
+    
+    # start gsoc08-privileges
+    if { [tbool install.asroot] } {
+        # if port is marked as needing root
+        elevateToRoot "install"
+    } elseif { ![file writable $prefix] } {
+        # if install location is not writable, need root privileges to install
+        elevateToRoot "install"
+    }
+    # end gsoc08-privileges
 }
 
 proc portinstall::install_element {src_element dst_element} {
     # don't recursively copy directories
     if {[file isdirectory $src_element] && [file type $src_element] != "link"} {
-	file mkdir $dst_element
+        file mkdir $dst_element
     } else {
-	file copy -force $src_element $dst_element
+        file copy -force $src_element $dst_element
     }
     
     # if the file is a symlink, do not try to set file attributes
     # if the destination file is an existing directory,
     # do not overwrite its file attributes
     if {[file type $src_element] != "link" || [file isdirectory $dst_element]} {
-	set attributes [file attributes $src_element]	
-	for {set i 0} {$i < [llength $attributes]} {incr i} {
-	    set opt [lindex $attributes $i]
-	    incr i
-	    set arg [lindex $attributes $i]
-	    file attributes $dst_element $opt $arg
-	    # set mtime on installed element
-	    exec touch -r $src_element $dst_element
-	}
+        set attributes [file attributes $src_element]
+        for {set i 0} {$i < [llength $attributes]} {incr i} {
+            set opt [lindex $attributes $i]
+            incr i
+            set arg [lindex $attributes $i]
+            file attributes $dst_element $opt $arg
+            # set mtime on installed element
+            exec touch -r $src_element $dst_element
+        }
     }
 }
 
@@ -100,100 +98,95 @@
     global installPlist
     set pwd [pwd]
     if {[catch {_cd $workdir} err]} {
-	puts $err
-	return
+        puts $err
+        return
     }
     
     foreach name [readdir .] {
-	set element [file join $cwd $name]
-	
-	# XXX jpm's cross-platform code to find file separator
-	# replace with [file seperator] with tcl 8.4
-	if {![info exists root]} {
-	    if {[string match [file tail "/monkey"] "monkey"]} {
-		set root "/"
-	    } elseif {[string match [file tail ":monkey"] "monkey"]} {
-		set root ":" 
-	    } else {
-		set root "\\"		
-	    }
-	}
-	
-	if { [registry_prop_retr $regref installtype] == "image" } {
-		set imagedir [registry_prop_retr $regref imagedir]
-		set root [file join $root $imagedir]
-	}
-	
-	set dst_element [file join $root $element]
-	set src_element [file join $rootdir $element]
-	# overwrites files but not directories
-	if {![file exists $dst_element] || ![file isdirectory $dst_element]} {
-		if {[file type $src_element] == "link"} {
-			ui_debug "installing link: $dst_element"
-		} elseif {[file isdirectory $src_element]} {
-			ui_debug "installing directory: $dst_element"
-		} else {
-			ui_debug "installing file: $dst_element"
-		}
-	    install_element $src_element $dst_element
-		# only track files/links for registry, not directories
-		if {[file type $dst_element] != "directory"} {
-			lappend installPlist $dst_element
-		}
-	}
-	if {[file isdirectory $name] && [file type $name] != "link"} {
-	    directory_dig $rootdir $name $regref [file join $cwd $name]
-	}
+        set element [file join $cwd $name]
+        
+        if {![info exists root]} {
+            set root [file separator]
+        }
+        
+        if { [registry_prop_retr $regref installtype] == "image" } {
+            set imagedir [registry_prop_retr $regref imagedir]
+            set root [file join $root $imagedir]
+        }
+        
+        set dst_element [file join $root $element]
+        set src_element [file join $rootdir $element]
+        # overwrites files but not directories
+        if {![file exists $dst_element] || ![file isdirectory $dst_element]} {
+            if {[file type $src_element] == "link"} {
+                ui_debug "installing link: $dst_element"
+            } elseif {[file isdirectory $src_element]} {
+                ui_debug "installing directory: $dst_element"
+            } else {
+                ui_debug "installing file: $dst_element"
+            }
+            install_element $src_element $dst_element
+            # only track files/links for registry, not directories
+            if {[file type $dst_element] != "directory"} {
+                lappend installPlist $dst_element
+            }
+        }
+        if {[file isdirectory $name] && [file type $name] != "link"} {
+            directory_dig $rootdir $name $regref [file join $cwd $name]
+        }
     }
     _cd $pwd
 }
 
 proc portinstall::install_main {args} {
-	global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
-
-	# Begin the registry entry
-   	set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
+    global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
     
-  	# Install the files	
-	directory_dig ${destroot} ${destroot} ${regref}
+    # Begin the registry entry
+    set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
     
-	registry_prop_store $regref categories $categories
+    # Install the files
+    directory_dig ${destroot} ${destroot} ${regref}
     
+    registry_prop_store $regref categories $categories
+    
     if {[info exists description]} {
-		registry_prop_store $regref description $description
+        registry_prop_store $regref description [string map {\n \\n} ${description}]
     }
     if {[info exists long_description]} {
-		registry_prop_store $regref long_description ${long_description}
+        registry_prop_store $regref long_description [string map {\n \\n} ${long_description}]
     }
+    if {[info exists license]} {
+        registry_prop_store $regref license ${license}
+    }
     if {[info exists homepage]} {
-		registry_prop_store $regref homepage ${homepage}
+        registry_prop_store $regref homepage ${homepage}
     }
-	if {[info exists maintainers]} {
-		registry_prop_store $regref maintainers ${maintainers}
+    if {[info exists maintainers]} {
+        registry_prop_store $regref maintainers ${maintainers}
     }
-	if {[info exists depends_run]} {
-		registry_prop_store $regref depends_run $depends_run
-		registry_register_deps $depends_run $portname
+    if {[info exists depends_run]} {
+        registry_prop_store $regref depends_run $depends_run
+        registry_register_deps $depends_run $portname
     }
-	if {[info exists depends_lib]} {
-		registry_prop_store $regref depends_lib $depends_lib
-		registry_register_deps $depends_lib $portname
-	}
+    if {[info exists depends_lib]} {
+        registry_prop_store $regref depends_lib $depends_lib
+        registry_register_deps $depends_lib $portname
+    }
     if {[info exists installPlist]} {
-		registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
-		if { [registry_prop_retr $regref installtype] != "image" } {
-			registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $portname
-		}
-	}
-	if {[info exists package-install]} {
-		registry_prop_store $regref package-install ${package-install}
+        registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
+        if { [registry_prop_retr $regref installtype] != "image" } {
+            registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $portname
+        }
     }
+    if {[info exists package-install]} {
+        registry_prop_store $regref package-install ${package-install}
+    }
     if {[info proc pkg_uninstall] == "pkg_uninstall"} {
-		registry_prop_store $regref uninstall [proc_disasm pkg_uninstall]
+        registry_prop_store $regref uninstall [proc_disasm pkg_uninstall]
     }
-	
-	registry_write $regref 
-
+    
+    registry_write $regref
+    
     return 0
 }
 
@@ -202,12 +195,12 @@
     append p $pname " \{"
     set space ""
     foreach arg [info args $pname] {
-	if {[info default $pname $arg value]} {
-	    append p "$space{" [list $arg $value] "}"
-	} else {
-	    append p $space $arg
-	}
-	set space " "
+        if {[info default $pname $arg value]} {
+            append p "$space{" [list $arg $value] "}"
+        } else {
+            append p $space $arg
+        }
+        set space " "
     }
     append p "\} \{" [info body $pname] "\}"
     return $p

Modified: branches/new-help-system/base/src/port1.0/portlint.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portlint.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portlint.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -21,64 +21,17 @@
     "1.0"
 
 set lint_platforms [list \
-    "macosx" \
     "darwin" \
     "freebsd" \
-    "openbsd" \
-    "netbsd" \
     "linux" \
+    "macosx" \
+    "netbsd" \
+    "openbsd" \
+    "puredarwin" \
+    "solaris" \
     "sunos" \
     ]
 
-set lint_categories [list \
-    "aqua" \
-    "archivers" \
-    "audio" \
-    "benchmarks" \
-    "cad" \
-    "comms" \
-    "cross" \
-    "databases" \
-    "devel" \
-    "editors" \
-    "emulators" \
-    "erlang" \
-    "finance" \
-    "fuse" \
-    "games" \
-    "genealogy" \
-    "gis" \
-    "gnome" \
-    "gnustep" \
-    "graphics" \
-    "iphone" \
-    "irc" \
-    "java" \
-    "kde" \
-    "lang" \
-    "mail" \
-    "math" \
-    "multimedia" \
-    "net" \
-    "news" \
-    "office" \
-    "palm" \
-    "perl" \
-    "print" \
-    "python" \
-    "ruby" \
-    "science" \
-    "security" \
-    "shells" \
-    "sysutils" \
-    "tex" \
-    "textproc" \
-    "www" \
-    "x11" \
-    "xfce" \
-    "zope" \
-    ]
-
 set lint_required [list \
     "name" \
     "version" \
@@ -102,14 +55,6 @@
     "use_configure" \
     ]
 
-set lint_variants [list \
-    "universal" \
-    "docs" \
-    "aqua" \
-    "x11" \
-    ]
-
-
 proc portlint::seems_utf8 {str} {
     set len [string length $str]
     for {set i 0} {$i<$len} {incr i} {
@@ -177,6 +122,8 @@
     set seen_portgroup false
     set in_description false
 
+    array set portgroups {}
+
     set local_variants [list]
 
     set f [open $portfile RDONLY]
@@ -204,7 +151,7 @@
             incr errors
         }
 
-        if {[string equal "PortSystem" $require_after] && \
+        if {($require_after == "PortSystem" || $require_after == "PortGroup") && \
             [string match "PortGroup*" $line]} {
             set require_blank false
         }
@@ -233,6 +180,12 @@
             set require_blank true
             set require_after "RCS tag"
         }
+        
+        # skip the rest for comment lines (not perfectly accurate...)
+        if {[regexp {^\s*#} $line]} {
+            incr lineno
+            continue
+        }
 
         if {[string match "PortSystem*" $line]} {
             if {$seen_portsystem} {
@@ -249,15 +202,17 @@
             set require_after "PortSystem"
         }
         if {[string match "PortGroup*" $line]} {
-            if {$seen_portgroup} {
-                ui_error "Line $lineno repeats PortGroup information"
-                incr errors
-            }
             regexp {PortGroup\s+([a-z0-9]+)\s+([0-9.]+)} $line -> portgroup portgroupversion
             if {![info exists portgroup]} {
                 ui_error "Line $lineno has unrecognized PortGroup"
                 incr errors
             }
+            if {[info exists portgroups($portgroup)]} {
+                ui_error "Line $lineno repeats PortGroup information"
+                incr errors
+            } else {
+                set portgroups($portgroup) $portgroupversion
+            }
             set seen_portgroup true
             set require_blank true
             set require_after "PortGroup"
@@ -290,6 +245,14 @@
             incr warnings
         }
 
+        # Check for hardcoded version numbers
+        if {![regexp {^PortSystem|^PortGroup|^version} $line]
+                && ![regexp {^[a-z0-9]+\.setup} $line]
+                && [string first [option version] $line] != -1} {
+            ui_warn "Line $lineno seems to hardcode the version number, consider using \${version} instead"
+            incr warnings
+        }
+
         ### TODO: more checks to Portfile syntax
 
         incr lineno
@@ -305,8 +268,8 @@
     global maintainers homepage master_sites checksums patchfiles
     global depends_lib depends_build depends_run distfiles fetch.type
     
-    global lint_portsystem lint_platforms lint_categories 
-    global lint_required lint_optional lint_variants
+    global lint_portsystem lint_platforms
+    global lint_required lint_optional
 
     if (!$seen_portsystem) {
         ui_error "Didn't find PortSystem specification"
@@ -317,13 +280,17 @@
     } else {
         ui_info "OK: Found PortSystem $portsystem"
     }
-    if (!$seen_portgroup) {
-        # PortGroup is optional, so missing is OK
-    }  elseif {![file exists [getportresourcepath $porturl "port1.0/group/${portgroup}-${portgroupversion}.tcl"]]} {
-        ui_error "Unknown PortGroup: $portgroup-$portgroupversion"
-        incr errors
-    } else {
-        ui_info "OK: Found PortGroup $portgroup-$portgroupversion"
+
+    if ($seen_portgroup) {
+        # Using a PortGroup is optional
+        foreach {portgroup portgroupversion} [array get portgroups] {
+            if {![file exists [getportresourcepath $porturl "port1.0/group/${portgroup}-${portgroupversion}.tcl"]]} {
+                ui_error "Unknown PortGroup: $portgroup-$portgroupversion"
+                incr errors
+            } else {
+                ui_info "OK: Found PortGroup $portgroup-$portgroupversion"
+            }
+        }
     }
 
     foreach req_var $lint_required {
@@ -380,19 +347,13 @@
     }
 
     if {[info exists categories]} {
-        set category [lindex $categories 0]
-        if {[lsearch -exact $lint_categories $category] == -1} {
-            ui_error "Unknown category: $category"
-            incr errors
+        if {[llength $categories] > 0} {
+            set category [lindex $categories 0]
+            ui_info "OK: Found primary category: $category"
         } else {
-            ui_info "OK: Found category: $category"
+            ui_error "Categories list is empty"
+            incr errors
         }
-        foreach secondary $categories {
-            if {[string match $secondary $category]} {
-                continue
-            }
-            ui_info "OK: Found category: $secondary"
-        }
     }
 
     if {![string is integer -strict $portepoch]} {
@@ -424,7 +385,6 @@
             if {![info exists variantdesc] || $variantdesc == ""} {
                 # don't warn about missing descriptions for global variants
                 if {[lsearch -exact $local_variants $variantname] != -1 &&
-                    [lsearch -exact $lint_variants $variantname] == -1 && 
                     [variant_desc $porturl $variantname] == ""} {
                     ui_warn "Variant $variantname does not have a description"
                     incr warnings
@@ -471,7 +431,7 @@
     if {[info exists depends_run]} { eval "lappend all_depends $depends_run" }
     foreach depspec $all_depends {
         set dep [lindex [split $depspec :] end]
-        if {[catch {set res [mport_search "^$dep\$"]} error]} {
+        if {[catch {set res [mport_lookup $dep]} error]} {
             global errorInfo
             ui_debug "$errorInfo"
             continue
@@ -506,7 +466,7 @@
     }
 
     # these checks are only valid for ports stored in the regular tree directories
-    if {$portcatdir != $category} {
+    if {[info exists category] && $portcatdir != $category} {
         ui_error "Portfile parent directory $portcatdir does not match primary category $category"
         incr errors
     } else {

Modified: branches/new-help-system/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portlivecheck.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portlivecheck.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -18,7 +18,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -62,7 +62,7 @@
     global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert
     global homepage portname portpath workpath
     global master_sites name distfiles
-    
+
     set updated 0
     set updated_version "unknown"
     set has_master_sites [info exists master_sites]
@@ -111,16 +111,16 @@
 
     # Copied over from portfetch in parts
     set fetch_options {}
-	if {[string length ${fetch.user}] || [string length ${fetch.password}]} {
-		lappend fetch_options -u
-		lappend fetch_options "${fetch.user}:${fetch.password}"
-	}
-	if {${fetch.use_epsv} != "yes"} {
-		lappend fetch_options "--disable-epsv"
-	}
-	if {${fetch.ignore_sslcert} != "no"} {
-		lappend fetch_options "--ignore-ssl-cert"
-	}
+    if {[string length ${fetch.user}] || [string length ${fetch.password}]} {
+        lappend fetch_options -u
+        lappend fetch_options "${fetch.user}:${fetch.password}"
+    }
+    if {${fetch.use_epsv} != "yes"} {
+        lappend fetch_options "--disable-epsv"
+    }
+    if {${fetch.ignore_sslcert} != "no"} {
+        lappend fetch_options "--ignore-ssl-cert"
+    }
 
     # Perform the check depending on the type.
     switch ${livecheck.check} {
@@ -150,10 +150,10 @@
                 set livecheck.url "http://code.google.com/p/${livecheck.name}/downloads/list"
             }
             if {${livecheck.distname} eq "default"} {
-                set livecheck.distname [regsub ***=${livecheck.version} [file tail [lindex ${distfiles} 0]] (.*)]
+                set livecheck.distname [regsub ***=[quotemeta ${livecheck.version}] [quotemeta [file tail [lindex ${distfiles} 0]]] (.*)]
             }
             if {${livecheck.regex} eq ""} {
-                set livecheck.regex [list "<a href=\"http://[quotemeta ${livecheck.name}].googlecode.com/files/[quotemeta ${livecheck.distname}]\""]
+                set livecheck.regex [list "<a href=\"http://[quotemeta ${livecheck.name}].googlecode.com/files/${livecheck.distname}\""]
             }
             set livecheck.check "regex"
         }
@@ -170,10 +170,10 @@
             set livecheck.check "regex"
         }
     }
-    
+
     # de-escape livecheck.url
     set livecheck.url [join ${livecheck.url}]
-    
+
     switch ${livecheck.check} {
         "regex" -
         "regexm" {

Modified: branches/new-help-system/base/src/port1.0/portmain.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portmain.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portmain.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -45,12 +45,12 @@
 
 # define options
 options prefix macportsuser name version revision epoch categories maintainers
-options long_description description homepage
+options long_description description homepage license
 options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target
 options universal_variant os.universal_supported
 
 # Export options via PortInfo
-options_export name version revision epoch categories maintainers platforms description long_description homepage
+options_export name version revision epoch categories maintainers platforms description long_description homepage license
 
 # Assign option procedure to default_variants
 option_proc default_variants handle_default_variants
@@ -59,7 +59,6 @@
 default workpath {[getportworkpath_from_buildpath $portbuildpath]}
 default worksymlink {[file join $portpath work]}
 default prefix /opt/local
-default x11prefix /usr/X11R6
 default applications_dir /Applications/MacPorts
 default frameworks_dir {${prefix}/Library/Frameworks}
 default destdir destroot
@@ -69,6 +68,7 @@
 default filesdir files
 default revision 0
 default epoch 0
+default license unknown
 default distname {${portname}-${portversion}}
 default worksrcdir {$distname}
 default filespath {[file join $portpath $filesdir]}

Modified: branches/new-help-system/base/src/port1.0/portmirror.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portmirror.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portmirror.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -18,7 +18,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -52,37 +52,37 @@
 # It also records the path in a database.
 
 proc portmirror::mirror_main {args} {
-	global fetch.type portname mirror_filemap ports_mirror_new portdbpath
-	
-	set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
-	if {![info exists mirror_filemap]
-		&& [info exists ports_mirror_new]
-		&& $ports_mirror_new == "yes"
-		&& [file exists $mirror_filemap_path]} {
-		# Trash the map file if it existed.
-		file delete -force $mirror_filemap_path
-	}
-	
-	filemap open mirror_filemap $mirror_filemap_path
+    global fetch.type portname mirror_filemap ports_mirror_new portdbpath
 
-	# Check the distfiles if it's a regular fetch phase.
-	if {"${fetch.type}" == "standard"} {
-		# fetch the files.
-		portfetch::fetch_init $args
-		#fetch_start
-		portfetch::fetch_main $args
+    set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
+    if {![info exists mirror_filemap]
+        && [info exists ports_mirror_new]
+        && $ports_mirror_new == "yes"
+        && [file exists $mirror_filemap_path]} {
+        # Trash the map file if it existed.
+        file delete -force $mirror_filemap_path
+    }
 
-		# checksum the files.
-		#checksum_start
-		if {[catch {portchecksum::checksum_main $args}]} {
-			# delete the files.
-			portfetch::fetch_deletefiles $args
-		} else {
-			# add the list of files.
-			portfetch::fetch_addfilestomap mirror_filemap
-		}
-	}
+    filemap open mirror_filemap $mirror_filemap_path
 
-	# close the filemap.
-	filemap close mirror_filemap
+    # Check the distfiles if it's a regular fetch phase.
+    if {"${fetch.type}" == "standard"} {
+        # fetch the files.
+        portfetch::fetch_init $args
+        #fetch_start
+        portfetch::fetch_main $args
+
+        # checksum the files.
+        #checksum_start
+        if {[catch {portchecksum::checksum_main $args}]} {
+            # delete the files.
+            portfetch::fetch_deletefiles $args
+        } else {
+            # add the list of files.
+            portfetch::fetch_addfilestomap mirror_filemap
+        }
+    }
+
+    # close the filemap.
+    filemap close mirror_filemap
 }

Modified: branches/new-help-system/base/src/port1.0/portpatch.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portpatch.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portpatch.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -16,7 +16,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -35,7 +35,7 @@
 
 set org.macports.patch [target_new org.macports.patch portpatch::patch_main]
 target_provides ${org.macports.patch} patch
-target_requires ${org.macports.patch} main fetch checksum extract 
+target_requires ${org.macports.patch} main fetch checksum extract
 
 namespace eval portpatch {
 }
@@ -54,48 +54,48 @@
 
 proc portpatch::patch_main {args} {
     global UI_PREFIX
-    
+
     # First make sure that patchfiles exists and isn't stubbed out.
     if {![exists patchfiles]} {
-	return 0
+    return 0
     }
-    
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option portname]]"
-	
-	# start gsoc08-privileges
+
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option portname]]"
+
+    # start gsoc08-privileges
     if { [tbool patch.asroot] } {
-	# if port is marked as needing root	
-		elevateToRoot "patch"
-	}
-	# end gsoc08-privileges
+    # if port is marked as needing root
+        elevateToRoot "patch"
+    }
+    # end gsoc08-privileges
 
     foreach patch [option patchfiles] {
     set patch_file [getdistname $patch]
-	if {[file exists [option filespath]/$patch_file]} {
-	    lappend patchlist [option filespath]/$patch_file
-	} elseif {[file exists [option distpath]/$patch_file]} {
-	    lappend patchlist [option distpath]/$patch_file
-	} else {
-		return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
-	}
+    if {[file exists [option filespath]/$patch_file]} {
+        lappend patchlist [option filespath]/$patch_file
+    } elseif {[file exists [option distpath]/$patch_file]} {
+        lappend patchlist [option distpath]/$patch_file
+    } else {
+        return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
     }
+    }
     if {![info exists patchlist]} {
-	return -code error [msgcat::mc "Patch files missing"]
+    return -code error [msgcat::mc "Patch files missing"]
     }
     _cd [option worksrcpath]
     foreach patch $patchlist {
-	ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
-	if {[option os.platform] == "linux"} {
-	    set gzcat "zcat"
-	} else {
-	    set gzcat "gzcat"
-	}
-	switch -glob -- [file tail $patch] {
-	    *.Z -
-	    *.gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
-	    *.bz2 {command_exec patch "bzcat \"$patch\" | (" ")"}
-	    default {command_exec patch "" "< '$patch'"}
-	}
+    ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
+    if {[option os.platform] == "linux"} {
+        set gzcat "zcat"
+    } else {
+        set gzcat "gzcat"
     }
+    switch -glob -- [file tail $patch] {
+        *.Z -
+        *.gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
+        *.bz2 {command_exec patch "bzcat \"$patch\" | (" ")"}
+        default {command_exec patch "" "< '$patch'"}
+    }
+    }
     return 0
 }

Modified: branches/new-help-system/base/src/port1.0/portsubmit.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portsubmit.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portsubmit.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -16,7 +16,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -36,7 +36,7 @@
 
 set org.macports.submit [target_new org.macports.submit portsubmit::submit_main]
 target_runtype ${org.macports.submit} always
-target_provides ${org.macports.submit} submit 
+target_provides ${org.macports.submit} submit
 target_requires ${org.macports.submit} portpkg
 
 namespace eval portsubmit {
@@ -47,32 +47,32 @@
 
 # escape quotes, and things that make the shell cry
 proc portsubmit::shell_escape {str} {
-	regsub -all -- {\\} $str {\\\\} str
-	regsub -all -- {"} $str {\"} str
-	regsub -all -- {'} $str {\'} str
-	return $str
+    regsub -all -- {\\} $str {\\\\} str
+    regsub -all -- {"} $str {\"} str
+    regsub -all -- {'} $str {\'} str
+    return $str
 }
 
 
 proc portsubmit::submit_main {args} {
     global mp_remote_submit_url portname portversion portverbose prefix UI_PREFIX workpath portpath
-    
+
     set submiturl $mp_remote_submit_url
-    
+
     # Preconditions for submit
     if {$submitter_email == ""} {
-		return -code error [format [msgcat::mc "Submitter email is required to submit a port"]]
+        return -code error [format [msgcat::mc "Submitter email is required to submit a port"]]
     }
 
     # Make sure we have a work directory
     file mkdir ${workpath}
-  
-   	# Create portpkg.xar in the work directory
-   	set pkgpath "${workpath}/${portname}.portpkg"
-   	
-   	# TODO: If a private key was provided, create a signed digest of the submission
-   	
-   	# Submit to the submit url
+
+    # Create portpkg.xar in the work directory
+    set pkgpath "${workpath}/${portname}.portpkg"
+
+    # TODO: If a private key was provided, create a signed digest of the submission
+
+    # Submit to the submit url
     set args "curl"
     lappend args "--silent"
     lappend args "--url ${submiturl}"
@@ -83,47 +83,47 @@
     set cmd [join $args]
 
     if {[tbool portverbose]} {
-    	ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
+        ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
     }
-    
-	# Invoke curl to do the submit
+
+    # Invoke curl to do the submit
     ui_debug $cmd
     if {[system $cmd] != ""} {
-		return -code error [format [msgcat::mc "Failure during submit of port %s"] $portname]
+        return -code error [format [msgcat::mc "Failure during submit of port %s"] $portname]
     }
 
-	# Parse the result
-	set fd [open ${workpath}/.portsubmit.out r]
-	array set result [list]
-	while {[gets $fd line] != -1} {
-		if {0 != [regexp -- {^([^:]+):\s*(.*)$} $line unused key value]} {
-			set result($key) $value
-		}
-	}
-	close $fd
-	
-	# Interpret and act on the result
-	if {[info exists result(MESSAGE)] && [tbool portverbose]} {
-		ui_msg $result(MESSAGE)
-	}
-	if {[info exists result(STATUS)]} {
-		if { $result(STATUS) == 0 } {
-			ui_msg "Submitted portpkg for $portname"
-			if {[info exists result(DOWNLOAD_URL)]} {
-				ui_msg "    download URL => $result(DOWNLOAD_URL)"
-			}
-			if {[info exists result(HUMAN_URL)]} {
-				ui_msg "    human readable URL => $result(HUMAN_URL)"
-			}
-		} else {
-			return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $portname]
-		}
-	} else {
-		return -code error [format [msgcat::mc "Status not received during submit of port %s"] $portname]
-	}
+    # Parse the result
+    set fd [open ${workpath}/.portsubmit.out r]
+    array set result [list]
+    while {[gets $fd line] != -1} {
+        if {0 != [regexp -- {^([^:]+):\s*(.*)$} $line unused key value]} {
+            set result($key) $value
+        }
+    }
+    close $fd
 
+    # Interpret and act on the result
+    if {[info exists result(MESSAGE)] && [tbool portverbose]} {
+        ui_msg $result(MESSAGE)
+    }
+    if {[info exists result(STATUS)]} {
+        if { $result(STATUS) == 0 } {
+            ui_msg "Submitted portpkg for $portname"
+            if {[info exists result(DOWNLOAD_URL)]} {
+                ui_msg "    download URL => $result(DOWNLOAD_URL)"
+            }
+            if {[info exists result(HUMAN_URL)]} {
+                ui_msg "    human readable URL => $result(HUMAN_URL)"
+            }
+        } else {
+            return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $portname]
+        }
+    } else {
+        return -code error [format [msgcat::mc "Status not received during submit of port %s"] $portname]
+    }
+
     return
-    
+
     # REMNANTS OF KEVIN'S CODE
 
     # start with the Portfile, and add the files directory if it exists.
@@ -136,29 +136,29 @@
     }
 
     if {[system $cmd] != ""} {
-	return -code error [format [msgcat::mc "Failed to archive port : %s"] $portname]
+    return -code error [format [msgcat::mc "Failed to archive port : %s"] $portname]
     }
 
-	set portsource ""
-	set base_rev ""
-	if {![catch {set fd [open ".mports_source" r]}]} {
-		while {[gets $fd line] != -1} {
-			regexp -- {^(.*): (.*)$} $line unused key value
-			switch -- $key {
-				source { set portsource $value }
-				revision { set base_rev $value }
-			}
-		}
-		close $fd
-	}
-	if {$portsource == ""} {
-		ui_msg "$UI_PREFIX Submitting $portname-$portversion"
-		puts -nonewline "URL: "
-		flush stdout
-		gets stdin portsource
-	}
+    set portsource ""
+    set base_rev ""
+    if {![catch {set fd [open ".mports_source" r]}]} {
+        while {[gets $fd line] != -1} {
+            regexp -- {^(.*): (.*)$} $line unused key value
+            switch -- $key {
+                source { set portsource $value }
+                revision { set base_rev $value }
+            }
+        }
+        close $fd
+    }
+    if {$portsource == ""} {
+        ui_msg "$UI_PREFIX Submitting $portname-$portversion"
+        puts -nonewline "URL: "
+        flush stdout
+        gets stdin portsource
+    }
 
-	ui_msg "$UI_PREFIX Submitting $portname-$portversion to $portsource"
+    ui_msg "$UI_PREFIX Submitting $portname-$portversion to $portsource"
 
     puts -nonewline "Username: "
     flush stdout
@@ -169,13 +169,13 @@
     gets stdin password
     puts ""
     exec stty echo
-    
+
     set vars {portname portversion maintainers categories description \
-    	long_description master_sites}
-	eval "global $vars"
-	foreach var $vars {
-		if {![info exists $var]} { set $var {} }
-	}
+        long_description master_sites}
+    eval "global $vars"
+    foreach var $vars {
+        if {![info exists $var]} { set $var {} }
+    }
 
     set cmd "curl "
     append cmd "--silent "
@@ -196,68 +196,68 @@
 
     ui_debug $cmd
     if {[system $cmd] != ""} {
-	return -code error [format [msgcat::mc "Failed to submit port : %s"] $portname]
+    return -code error [format [msgcat::mc "Failed to submit port : %s"] $portname]
     }
 
-	#
-	# Parse the result from the remote index
-	# if ERROR: print the error message
-	# if OK: store the revision info
-	# if CONFLICT: attempt to merge the conflict
-	#
-	
-	set fd [open ${workpath}/.portsubmit.out r]
-	array set result [list]
-	while {[gets $fd line] != -1} {
-		regexp -- {^(.*): (.*)$} $line unused key value
-		set result($key) $value
-	}
-	close $fd
+    #
+    # Parse the result from the remote index
+    # if ERROR: print the error message
+    # if OK: store the revision info
+    # if CONFLICT: attempt to merge the conflict
+    #
 
-	if {[info exists result(OK)]} {
-		set fd [open ".mports_source" w]
-		puts $fd "source: $portsource"
-		puts $fd "port: $portname"
-		puts $fd "version: $portversion"
-		puts $fd "revision: $result(revision)"
-		close $fd
-		
-		ui_msg "$portname-$portversion submitted successfully."
-		ui_msg "New revision: $result(revision)"
-	} elseif {[info exists result(ERROR)]} {
-		return -code error $result(ERROR)
-	} elseif {[info exists result(CONFLICT)]} {
-		# Fetch the newer revision from the index.
-		# XXX: many gross hacks here regarding paths, urls, etc.
-		set tmpdir [mktemp "/tmp/mports.XXXXXXXX"]
-		file mkdir $tmpdir/new
-		file mkdir $tmpdir/old
-		set worker [mport_open $portsource/files/$portname/$portversion/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
-		if {$base_rev != ""} {
-			set worker2 [mport_open $portsource/files/$portname/$portversion/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
-			catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$portname-$portversion/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
-			file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
-			mport_close $worker2
-		} else {
-			catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
-			file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
-		}
-		mport_close $worker
-		catch {delete "${tmpdir}"}
+    set fd [open ${workpath}/.portsubmit.out r]
+    array set result [list]
+    while {[gets $fd line] != -1} {
+        regexp -- {^(.*): (.*)$} $line unused key value
+        set result($key) $value
+    }
+    close $fd
 
-		set fd [open [file join "$portpath" ".mports_source"] w]
-		puts $fd "source: $portsource"
-		puts $fd "port: $portname"
-		puts $fd "version: $portversion"
-		puts $fd "revision: $result(revision)"
-		close $fd
-		
-		ui_error "A newer revision of this port has already been submitted."
-		ui_error "Portfile: $portname-$portversion"
-		ui_error "Base revision: $base_rev"
-		ui_error "Current revision: $result(revision)"
-		ui_error "Please edit the Portfile to resolve any conflicts and resubmit."
-	}
+    if {[info exists result(OK)]} {
+        set fd [open ".mports_source" w]
+        puts $fd "source: $portsource"
+        puts $fd "port: $portname"
+        puts $fd "version: $portversion"
+        puts $fd "revision: $result(revision)"
+        close $fd
 
+        ui_msg "$portname-$portversion submitted successfully."
+        ui_msg "New revision: $result(revision)"
+    } elseif {[info exists result(ERROR)]} {
+        return -code error $result(ERROR)
+    } elseif {[info exists result(CONFLICT)]} {
+        # Fetch the newer revision from the index.
+        # XXX: many gross hacks here regarding paths, urls, etc.
+        set tmpdir [mktemp "/tmp/mports.XXXXXXXX"]
+        file mkdir $tmpdir/new
+        file mkdir $tmpdir/old
+        set worker [mport_open $portsource/files/$portname/$portversion/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
+        if {$base_rev != ""} {
+            set worker2 [mport_open $portsource/files/$portname/$portversion/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
+            catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$portname-$portversion/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
+            file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
+            mport_close $worker2
+        } else {
+            catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
+            file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
+        }
+        mport_close $worker
+        catch {delete "${tmpdir}"}
+
+        set fd [open [file join "$portpath" ".mports_source"] w]
+        puts $fd "source: $portsource"
+        puts $fd "port: $portname"
+        puts $fd "version: $portversion"
+        puts $fd "revision: $result(revision)"
+        close $fd
+
+        ui_error "A newer revision of this port has already been submitted."
+        ui_error "Portfile: $portname-$portversion"
+        ui_error "Base revision: $base_rev"
+        ui_error "Current revision: $result(revision)"
+        ui_error "Please edit the Portfile to resolve any conflicts and resubmit."
+    }
+
     return 0
 }

Modified: branches/new-help-system/base/src/port1.0/porttest.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/porttest.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/porttest.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -14,7 +14,7 @@
 }
 
 # define options
-options test.run test.target 
+options test.run test.target
 commands test
 
 # Set defaults
@@ -33,9 +33,9 @@
 proc porttest::test_main {args} {
     global portname test.run
     if {[tbool test.run]} {
-    	command_exec test
+        command_exec test
     } else {
-	return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $portname]
+    return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $portname]
     }
     return 0
 }

Modified: branches/new-help-system/base/src/port1.0/porttrace.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/porttrace.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/porttrace.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -18,7 +18,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its
 #    contributors may be used to endorse or promote products derived from
 #    this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -39,72 +39,72 @@
 }
 
 proc porttrace::trace_start {workpath} {
-	global os.platform
-	if {${os.platform} == "darwin"} {
-		if {[catch {package require Thread} error]} {
-			ui_warn "trace requires Tcl Thread package ($error)"
-		} else {
-			global env trace_fifo trace_sandboxbounds portpath
-			# Create a fifo.
-			# path in unix socket limited to 109 chars
-			# # set trace_fifo "$workpath/trace_fifo"
-			set trace_fifo "/tmp/macports/[pid]_[expr {int(rand()*1000)}]" 
-			file mkdir "/tmp/macports"
-			file delete -force $trace_fifo
-			
-			# Create the thread/process.
-			create_slave $workpath $trace_fifo
-					
-			# Launch darwintrace.dylib.
-			
-			set tracelib_path [file join ${portutil::autoconf::prefix} share macports Tcl darwintrace1.0 darwintrace.dylib]
+    global os.platform
+    if {${os.platform} == "darwin"} {
+        if {[catch {package require Thread} error]} {
+            ui_warn "trace requires Tcl Thread package ($error)"
+        } else {
+            global env trace_fifo trace_sandboxbounds portpath
+            # Create a fifo.
+            # path in unix socket limited to 109 chars
+            # # set trace_fifo "$workpath/trace_fifo"
+            set trace_fifo "/tmp/macports/[pid]_[expr {int(rand()*1000)}]"
+            file mkdir "/tmp/macports"
+            file delete -force $trace_fifo
 
-			if {[info exists env(DYLD_INSERT_LIBRARIES)] && [string length "$env(DYLD_INSERT_LIBRARIES)"] > 0} {
-				set env(DYLD_INSERT_LIBRARIES) "${env(DYLD_INSERT_LIBRARIES)}:${tracelib_path}"
-			} else {
-				set env(DYLD_INSERT_LIBRARIES) ${tracelib_path}
-			}
-			set env(DYLD_FORCE_FLAT_NAMESPACE) 1
-			set env(DARWINTRACE_LOG) "$trace_fifo"
-			# The sandbox is limited to:
-			# workpath
-			# /tmp
-			# /private/tmp
-			# /var/tmp
-			# /private/var/tmp
-			# $TMPDIR
-			# /dev/null
-			# /dev/tty
-			# /Library/Caches/com.apple.Xcode
- 			# $CCACHE_DIR
- 			# $HOMEDIR/.ccache
-			set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/:/etc/passwd:/etc/groups:/etc/localtime:/Library/Caches/com.apple.Xcode:$env(HOME)/.ccache:${workpath}:$portpath"
-			if {[info exists env(TMPDIR)]} {
-				set trace_sandboxbounds "${trace_sandboxbounds}:$env(TMPDIR)"
-			}
- 			if {[info exists env(CCACHE_DIR)]} {
- 				set trace_sandboxbounds "${trace_sandboxbounds}:$env(CCACHE_DIR)"
- 			}
-			tracelib setsandbox $trace_sandboxbounds
-		}
-	}
+            # Create the thread/process.
+            create_slave $workpath $trace_fifo
+
+            # Launch darwintrace.dylib.
+
+            set tracelib_path [file join ${portutil::autoconf::prefix} share macports Tcl darwintrace1.0 darwintrace.dylib]
+
+            if {[info exists env(DYLD_INSERT_LIBRARIES)] && [string length "$env(DYLD_INSERT_LIBRARIES)"] > 0} {
+                set env(DYLD_INSERT_LIBRARIES) "${env(DYLD_INSERT_LIBRARIES)}:${tracelib_path}"
+            } else {
+                set env(DYLD_INSERT_LIBRARIES) ${tracelib_path}
+            }
+            set env(DYLD_FORCE_FLAT_NAMESPACE) 1
+            set env(DARWINTRACE_LOG) "$trace_fifo"
+            # The sandbox is limited to:
+            # workpath
+            # /tmp
+            # /private/tmp
+            # /var/tmp
+            # /private/var/tmp
+            # $TMPDIR
+            # /dev/null
+            # /dev/tty
+            # /Library/Caches/com.apple.Xcode
+            # $CCACHE_DIR
+            # $HOMEDIR/.ccache
+            set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/:/etc/passwd:/etc/groups:/etc/localtime:/Library/Caches/com.apple.Xcode:$env(HOME)/.ccache:${workpath}:$portpath"
+            if {[info exists env(TMPDIR)]} {
+                set trace_sandboxbounds "${trace_sandboxbounds}:$env(TMPDIR)"
+            }
+            if {[info exists env(CCACHE_DIR)]} {
+                set trace_sandboxbounds "${trace_sandboxbounds}:$env(CCACHE_DIR)"
+            }
+            tracelib setsandbox $trace_sandboxbounds
+        }
+    }
 }
 
 # Enable the fence.
 # Only done for targets that should only happen in the sandbox.
 proc porttrace::trace_enable_fence {} {
-	global env trace_sandboxbounds
-	set env(DARWINTRACE_SANDBOX_BOUNDS) $trace_sandboxbounds
-	tracelib enablefence
+    global env trace_sandboxbounds
+    set env(DARWINTRACE_SANDBOX_BOUNDS) $trace_sandboxbounds
+    tracelib enablefence
 }
 
 # Disable the fence.
 # Unused yet.
 proc porttrace::trace_disable_fence {} {
-	global env
-	if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
-		unset env(DARWINTRACE_SANDBOX_BOUNDS)
-	}
+    global env
+    if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
+        unset env(DARWINTRACE_SANDBOX_BOUNDS)
+    }
 }
 
 # Check the list of ports.
@@ -112,204 +112,204 @@
 # that isn't included in portslist
 # This method must be called after trace_start
 proc porttrace::trace_check_deps {target portslist} {
-	# Get the list of ports.
-	set ports [slave_send porttrace::slave_get_ports]
-	
-	# Compare with portslist
-	set portslist [lsort $portslist]
-	foreach port $ports {
-		if {[lsearch -sorted -exact $portslist $port] == -1} {
-			ui_warn "Target $target has an undeclared dependency on $port"
-		}
-	}
-	foreach port $portslist {
-		if {[lsearch -sorted -exact $ports $port] == -1} {
-			ui_debug "Target $target has no traceable dependency on $port"
-		}
-	}	
+    # Get the list of ports.
+    set ports [slave_send porttrace::slave_get_ports]
+
+    # Compare with portslist
+    set portslist [lsort $portslist]
+    foreach port $ports {
+        if {[lsearch -sorted -exact $portslist $port] == -1} {
+            ui_warn "Target $target has an undeclared dependency on $port"
+        }
+    }
+    foreach port $portslist {
+        if {[lsearch -sorted -exact $ports $port] == -1} {
+            ui_debug "Target $target has no traceable dependency on $port"
+        }
+    }
 }
 
 # Check that no violation happened.
 # Output a warning for every sandbox violation the trace revealed.
 # This method must be called after trace_start
 proc porttrace::trace_check_violations {} {
-	# Get the list of violations.
-	set violations [slave_send porttrace::slave_get_sandbox_violations]
-	
-	foreach violation [lsort $violations] {
-		ui_warn "An activity was attempted outside sandbox: $violation"
-	}
+    # Get the list of violations.
+    set violations [slave_send porttrace::slave_get_sandbox_violations]
+
+    foreach violation [lsort $violations] {
+        ui_warn "An activity was attempted outside sandbox: $violation"
+    }
 }
 
 # Stop the trace and return the list of ports the port depends on.
 # This method must be called after trace_start
 proc porttrace::trace_stop {} {
-	global os.platform
-	if {${os.platform} == "darwin"} {
-		global env trace_fifo
-		unset env(DYLD_INSERT_LIBRARIES)
-		unset env(DYLD_FORCE_FLAT_NAMESPACE)
-		unset env(DARWINTRACE_LOG)
-		if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
-			unset env(DARWINTRACE_SANDBOX_BOUNDS)
-		}
-		
-		#kill socket
-		tracelib clean
+    global os.platform
+    if {${os.platform} == "darwin"} {
+        global env trace_fifo
+        unset env(DYLD_INSERT_LIBRARIES)
+        unset env(DYLD_FORCE_FLAT_NAMESPACE)
+        unset env(DARWINTRACE_LOG)
+        if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
+            unset env(DARWINTRACE_SANDBOX_BOUNDS)
+        }
 
-		# Clean up.
-		slave_send porttrace::slave_stop
+        #kill socket
+        tracelib clean
 
-		# Delete the slave.
-		delete_slave
+        # Clean up.
+        slave_send porttrace::slave_stop
 
-		file delete -force $trace_fifo
-	}
+        # Delete the slave.
+        delete_slave
+
+        file delete -force $trace_fifo
+    }
 }
 
 # Private
 # Create the slave thread.
 proc porttrace::create_slave {workpath trace_fifo} {
-	global trace_thread
-	# Create the thread.
-	set trace_thread [macports_create_thread]
-	
-	# The slave thread requires the registry package.
-	thread::send -async $trace_thread "package require registry 1.0"
-	# and this file as well.
-	thread::send -async $trace_thread "package require porttrace 1.0"
+    global trace_thread
+    # Create the thread.
+    set trace_thread [macports_create_thread]
 
-	# Start the slave work.
-	thread::send -async $trace_thread "porttrace::slave_start $trace_fifo $workpath"
+    # The slave thread requires the registry package.
+    thread::send -async $trace_thread "package require registry 1.0"
+    # and this file as well.
+    thread::send -async $trace_thread "package require porttrace 1.0"
+
+    # Start the slave work.
+    thread::send -async $trace_thread "porttrace::slave_start $trace_fifo $workpath"
 }
 
 # Private
 # Send a command to the thread without waiting for the result.
 proc porttrace::slave_send_async {command} {
-	global trace_thread
+    global trace_thread
 
-	thread::send -async $trace_thread "$command"
+    thread::send -async $trace_thread "$command"
 }
 
 # Private
 # Send a command to the thread.
 proc porttrace::slave_send {command} {
-	global trace_thread
+    global trace_thread
 
-	# ui_warn "slave send $command ?"
+    # ui_warn "slave send $command ?"
 
-	thread::send $trace_thread "$command" result
-	return $result
+    thread::send $trace_thread "$command" result
+    return $result
 }
 
 # Private
 # Destroy the thread.
 proc porttrace::delete_slave {} {
-	global trace_thread
+    global trace_thread
 
-	# Destroy the thread.
-	thread::release $trace_thread
+    # Destroy the thread.
+    thread::release $trace_thread
 }
 
 # Private.
 # Slave method to read a line from the trace.
 proc porttrace::lave_read_line {chan} {
-	global ports_list trace_filemap sandbox_violation_list workpath
-	global env
+    global ports_list trace_filemap sandbox_violation_list workpath
+    global env
 
-	while 1 {
-		# We should never get EOF, actually.
-		if {[eof $chan]} {
-			break
-		}
-		
-		# The line is of the form: verb\tpath
-		# Get the path by chopping it.
-		set theline [gets $chan]
-		
-		if {[fblocked $chan]} {
-			# Exit the loop.
-			break
-		}
+    while 1 {
+        # We should never get EOF, actually.
+        if {[eof $chan]} {
+            break
+        }
 
-		set line_length [string length $theline]
-		
-		# Skip empty lines.
-		if {$line_length > 0} {
-			set path_start [expr [string first "\t" $theline] + 1]
-			set op [string range $theline 0 [expr $path_start - 2]]
-			set path [string range $theline $path_start [expr $line_length - 1]]
-			
-			# open/execve
-			if {$op == "open" || $op == "execve"} {
-				# Only work on files.
-				if {[file isfile $path]} {
-					# Did we process the file yet?
-					if {![filemap exists trace_filemap $path]} {
-						# Obtain information about this file.
-						set port [registry::file_registered $path]
-						if { $port != 0 } {
-							# Add the port to the list.
-							if {[lsearch -sorted -exact $ports_list $port] == -1} {
-								lappend ports_list $port
-								set ports_list [lsort $ports_list]
-								# Maybe fill trace_filemap for efficiency?
-							}
-						}
-			
-						# Add the file to the tree with port information.
-						# Ignore errors. Errors can occur if a directory was
-						# created where a file once lived.
-						# This doesn't affect existing ports and we just
-						# add this information to speed up port detection.
-						catch {filemap set trace_filemap $path $port}
-					}
-				}
-			} elseif {$op == "sandbox_violation"} {
-				lappend sandbox_violation_list $path
-			}
-		}
-	}
+        # The line is of the form: verb\tpath
+        # Get the path by chopping it.
+        set theline [gets $chan]
+
+        if {[fblocked $chan]} {
+            # Exit the loop.
+            break
+        }
+
+        set line_length [string length $theline]
+
+        # Skip empty lines.
+        if {$line_length > 0} {
+            set path_start [expr [string first "\t" $theline] + 1]
+            set op [string range $theline 0 [expr $path_start - 2]]
+            set path [string range $theline $path_start [expr $line_length - 1]]
+
+            # open/execve
+            if {$op == "open" || $op == "execve"} {
+                # Only work on files.
+                if {[file isfile $path]} {
+                    # Did we process the file yet?
+                    if {![filemap exists trace_filemap $path]} {
+                        # Obtain information about this file.
+                        set port [registry::file_registered $path]
+                        if { $port != 0 } {
+                            # Add the port to the list.
+                            if {[lsearch -sorted -exact $ports_list $port] == -1} {
+                                lappend ports_list $port
+                                set ports_list [lsort $ports_list]
+                                # Maybe fill trace_filemap for efficiency?
+                            }
+                        }
+
+                        # Add the file to the tree with port information.
+                        # Ignore errors. Errors can occur if a directory was
+                        # created where a file once lived.
+                        # This doesn't affect existing ports and we just
+                        # add this information to speed up port detection.
+                        catch {filemap set trace_filemap $path $port}
+                    }
+                }
+            } elseif {$op == "sandbox_violation"} {
+                lappend sandbox_violation_list $path
+            }
+        }
+    }
 }
 
 # Private.
 # Slave init method.
 proc porttrace::slave_start {fifo p_workpath} {
-	global ports_list trace_filemap sandbox_violation_list 
-	# Save the workpath.
-	set workpath $p_workpath
-	# Create a virtual filemap.
-	filemap create trace_filemap
-	set ports_list {}
-	set sandbox_violation_list {}
-	tracelib setname $fifo
-	tracelib run
+    global ports_list trace_filemap sandbox_violation_list
+    # Save the workpath.
+    set workpath $p_workpath
+    # Create a virtual filemap.
+    filemap create trace_filemap
+    set ports_list {}
+    set sandbox_violation_list {}
+    tracelib setname $fifo
+    tracelib run
 }
 
 # Private.
 # Slave cleanup method.
 proc porttrace::slave_stop {} {
-	global trace_filemap trace_fifo_r_chan trace_fifo_w_chan
-	# Close the virtual filemap.
-	filemap close trace_filemap
-	# Close the pipe (both ends).
+    global trace_filemap trace_fifo_r_chan trace_fifo_w_chan
+    # Close the virtual filemap.
+    filemap close trace_filemap
+    # Close the pipe (both ends).
 }
 
 # Private.
 # Slave ports export method.
 proc porttrace::slave_get_ports {} {
-	global ports_list
-	return $ports_list
+    global ports_list
+    return $ports_list
 }
 
 # Private.
 # Slave sandbox violations export method.
 proc porttrace::slave_get_sandbox_violations {} {
-	global sandbox_violation_list
-	return $sandbox_violation_list
+    global sandbox_violation_list
+    return $sandbox_violation_list
 }
 
 proc porttrace::slave_add_sandbox_violation {path} {
-	global sandbox_violation_list
-	lappend sandbox_violation_list $path
+    global sandbox_violation_list
+    lappend sandbox_violation_list $path
 }

Modified: branches/new-help-system/base/src/port1.0/portutil.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portutil.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/port1.0/portutil.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -18,7 +18,7 @@
 # 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
 #    may be used to endorse or promote products derived from this software
 #    without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -283,11 +283,11 @@
 # composed of the command options.
 proc command_string {command} {
     global ${command}.dir ${command}.pre_args ${command}.args ${command}.post_args ${command}.cmd
-    
+
     if {[info exists ${command}.dir]} {
         append cmdstring "cd \"[set ${command}.dir]\" &&"
     }
-    
+
     if {[info exists ${command}.cmd]} {
         foreach string [set ${command}.cmd] {
             append cmdstring " $string"
@@ -332,7 +332,7 @@
             }
         }
     }
-    
+
     # Set the environment.
     # If the array doesn't exist, we create it with the value
     # coming from ${command}.env
@@ -344,13 +344,13 @@
     if {[option macosx_deployment_target] ne ""} {
         set ${command}.env_array(MACOSX_DEPLOYMENT_TARGET) [option macosx_deployment_target]
     }
-    
+
     # Debug that.
     ui_debug "Environment: [environment_array_to_string ${command}.env_array]"
 
     # Get the command string.
     set cmdstring [command_string ${command}]
-    
+
     # Call this command.
     # TODO: move that to the system native call?
     # Save the environment.
@@ -366,13 +366,13 @@
     }
     # Unset the command array until next time.
     array unset ${command}.env_array
-    
+
     # Restore the environment.
     array unset env *
     unsetenv *
     array set env [array get saved_env]
 
-    # Return as if system had been called directly. 
+    # Return as if system had been called directly.
     return -code $code $result
 }
 
@@ -450,11 +450,14 @@
     array set vinfo $PortInfo(vinfo)
 
     set len [llength $args]
+    if {$len < 2} {
+        return -code error "Malformed variant specification"
+    }
     set code [lindex $args end]
     set args [lrange $args 0 [expr $len - 2]]
-    
+
     set ditem [variant_new "temp-variant"]
-    
+
     # mode indicates what the arg is interpreted as.
     # possible mode keywords are: requires, conflicts, provides
     # The default mode is provides.  Arguments are added to the
@@ -466,7 +469,7 @@
             provides -
             requires -
             conflicts { set mode $arg }
-            default { ditem_append $ditem $mode $arg }      
+            default { ditem_append $ditem $mode $arg }
         }
     }
     ditem_key $ditem name "[join [ditem_key $ditem provides] -]"
@@ -474,7 +477,7 @@
     # make a user procedure named variant-blah-blah
     # we will call this procedure during variant-run
     makeuserproc "variant-[ditem_key $ditem name]" \{$code\}
-    
+
     # Export provided variant to PortInfo
     # (don't list it twice if the variant was already defined, which can happen
     # with universal or group code).
@@ -488,7 +491,7 @@
             set vinfo($variant_provides) {}
         }
         array set variant $vinfo($variant_provides)
-    
+
         # Set conflicts.
         set vconflicts [join [lsort [ditem_key $ditem conflicts]]]
         if {$vconflicts ne ""} {
@@ -530,7 +533,7 @@
 # Returns 1 if variant name selected, otherwise 0
 proc variant_isset {name} {
     global variations
-    
+
     if {[info exists variations($name)] && $variations($name) == "+"} {
         return 1
     }
@@ -544,39 +547,6 @@
     set variations($name) +
 }
 
-# variant_unset name
-# Clear variant for current portfile
-proc variant_unset {name} {
-    global variations
-    
-    set variations($name) -
-}
-
-# variant_undef name
-# Undefine a variant for the current portfile.
-proc variant_undef {name} {
-    global variations PortInfo
-    
-    # Remove it from the list of selected variations.
-    array unset variations $name
-
-    # Remove the variant from the portinfo.
-    if {[info exists PortInfo(variants)]} {
-        set variant_index [lsearch -exact $PortInfo(variants) $name]
-        if {$variant_index >= 0} {
-            set new_list [lreplace $PortInfo(variants) $variant_index $variant_index]
-            if {"$new_list" == {}} {
-                unset PortInfo(variants) 
-            } else {
-                set PortInfo(variants) $new_list
-            }
-        }
-    }
-    
-    # And from the dlist.
-    variant_remove_ditem $name
-}
-
 # variant_remove_ditem name
 # Remove variant name's ditem from the all_variants dlist
 proc variant_remove_ditem {name} {
@@ -588,7 +558,7 @@
             set all_variants [lreplace $all_variants $item_index $item_index]
             break
         }
-        
+
         incr item_index
     }
 }
@@ -664,20 +634,23 @@
     }
 }
 
-# platform <os> [<release>] [<arch>] 
+# platform <os> [<release>] [<arch>]
 # Portfile level procedure to provide support for declaring platform-specifics
 # Basically, just wrap 'variant', so that Portfiles' platform declarations can
 # be more readable, and support arch and version specifics
 proc platform {args} {
     global all_variants PortInfo os.platform os.arch os.version os.major
-    
+
     set len [llength $args]
+    if {$len < 2} {
+        return -code error "Malformed platform variant specification"
+    }
     set code [lindex $args end]
     set os [lindex $args 0]
     set args [lrange $args 1 [expr $len - 2]]
-    
+
     set ditem [variant_new "temp-variant"]
-    
+
     foreach arg $args {
         if {[regexp {(^[0-9]+$)} $arg match result]} {
             set release $result
@@ -685,30 +658,30 @@
             set arch $result
         }
     }
-    
+
     # Add the variant for this platform
     set platform $os
     if {[info exists release]} { set platform ${platform}_${release} }
     if {[info exists arch]} { set platform ${platform}_${arch} }
-    
+
     # Pick up a unique name.
     if {[variant_exists $platform]} {
         set suffix 1
         while {[variant_exists "$platform-$suffix"]} {
             incr suffix
         }
-        
+
         set platform "$platform-$suffix"
     }
     variant $platform $code
-    
+
     # Set the variant if this platform matches the platform we're on
     set matches 1
-    if {[info exists os.platform] && ${os.platform} == $os} { 
+    if {[info exists os.platform] && ${os.platform} == $os} {
         set sel_platform $os
         if {[info exists os.major] && [info exists release]} {
-            if {${os.major} == $release } { 
-                set sel_platform ${sel_platform}_${release} 
+            if {${os.major} == $release } {
+                set sel_platform ${sel_platform}_${release}
             } else {
                 set matches 0
             }
@@ -736,7 +709,7 @@
     if {[info exists ${command}.env]} {
         # Flatten the environment string.
         set the_environment [join [set ${command}.env]]
-    
+
         while {[regexp "^(?: *)(\[^= \]+)=(\"|'|)(\[^\"'\]*?)\\2(?: +|$)(.*)$" ${the_environment} matchVar key delimiter value remaining]} {
             set the_environment ${remaining}
             set ${command}.env_array(${key}) ${value}
@@ -780,7 +753,7 @@
 # Remark: this method is only used for debugging purposes.
 proc environment_array_to_string {environment_array} {
     upvar 1 ${environment_array} env_array
-    
+
     set theString ""
     foreach {key value} [array get env_array] {
         if {$theString == ""} {
@@ -789,7 +762,7 @@
             set theString "${theString} $key='$value'"
         }
     }
-    
+
     return $theString
 }
 
@@ -842,7 +815,7 @@
 # reinplace
 # Provides "sed in place" functionality
 proc reinplace {args}  {
-	global euid macportsuser
+    global euid macportsuser
 
     set extended 0
     while 1 {
@@ -869,7 +842,7 @@
     }
     set pattern [lindex $args 0]
     set files [lrange $args 1 end]
-    
+
     foreach file $files {
         if {[catch {set tmpfile [mkstemp "/tmp/[file tail $file].sed.XXXXXXXX"]} error]} {
             global errorInfo
@@ -882,7 +855,7 @@
             # Set tmpfile to only the file name
             set tmpfile [join [lrange $tmpfile 1 end]]
         }
-    
+
         set cmdline $portutil::autoconf::sed_command
         if {$extended} {
             if {$portutil::autoconf::sed_ext_flag == "N/A"} {
@@ -900,13 +873,13 @@
             close $tmpfd
             return -code error "reinplace sed(1) failed"
         }
-    
+
         close $tmpfd
-    
-		# start gsoc08-privileges
-		chownAsRoot $file	
-		# end gsoc08-privileges
-    
+
+        # start gsoc08-privileges
+        chownAsRoot $file
+        # end gsoc08-privileges
+
         set attributes [file attributes $file]
         # We need to overwrite this file
         if {[catch {file attributes $file -permissions u+w} error]} {
@@ -916,7 +889,7 @@
             file delete "$tmpfile"
             return -code error "reinplace permissions failed"
         }
-    
+
         if {[catch {file copy -force $tmpfile $file} error]} {
             global errorInfo
             ui_debug "$errorInfo"
@@ -924,9 +897,9 @@
             file delete "$tmpfile"
             return -code error "reinplace copy failed"
         }
-    
+
         eval file attributes {$file} $attributes
-        
+
         file delete "$tmpfile"
     }
     return
@@ -967,7 +940,7 @@
             default {return -code error "touch: illegal option -- $arg"}
         }
     }
-    
+
     # parse the r/t options
     if {[info exists options(rt)]} {
         if {[string equal $options(rt) r]} {
@@ -1010,14 +983,14 @@
         set atime [clock seconds]
         set mtime [clock seconds]
     }
-    
+
     # do we have any files to process?
     if {[llength $args] == 0} {
         # print usage
         ui_msg {usage: touch [-a] [-c] [-m] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...}
         return
     }
-    
+
     foreach file $args {
         if {![file exists $file]} {
             if {[info exists options(c)]} {
@@ -1026,7 +999,7 @@
                 close [open $file w]
             }
         }
-        
+
         if {[info exists options(a)] || ![info exists options(m)]} {
             file atime $file $atime
         }
@@ -1070,7 +1043,7 @@
             default {return -code error "ln: illegal option -- $arg"}
         }
     }
-    
+
     if {[llength $args] == 0} {
         ui_msg {usage: ln [-f] [-h] [-s] [-v] source_file [target_file]}
         ui_msg {       ln [-f] [-h] [-s] [-v] file ... directory}
@@ -1082,18 +1055,18 @@
         set files [lrange $args 0 [expr [llength $args] - 2]]
         set target [lindex $args end]
     }
-    
+
     foreach file $files {
         if {[file isdirectory $file] && ![info exists options(s)]} {
             return -code error "ln: $file: Is a directory"
         }
-        
+
         if {[file isdirectory $target] && ([file type $target] ne "link" || ![info exists options(h)])} {
             set linktarget [file join $target [file tail $file]]
         } else {
             set linktarget $target
         }
-        
+
         if {![catch {file type $linktarget}]} {
             if {[info exists options(f)]} {
                 file delete $linktarget
@@ -1101,7 +1074,7 @@
                 return -code error "ln: $linktarget: File exists"
             }
         }
-        
+
         if {[llength $files] > 2} {
             if {![file exists $linktarget]} {
                 return -code error "ln: $linktarget: No such file or directory"
@@ -1110,7 +1083,7 @@
                 return -code error "ln: $target: Not a directory"
             }
         }
-        
+
         if {[info exists options(v)]} {
             ui_msg "ln: $linktarget -> $file"
         }
@@ -1127,7 +1100,7 @@
 # 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]} {
@@ -1203,7 +1176,7 @@
     foreach m $list {
         if {[string first "@" $m] < 0} {
             if {[string first ":" $m] >= 0} {
-                set m [regsub -- "(.*):(.*)" $m "\\2@\\1"] 
+                set m [regsub -- "(.*):(.*)" $m "\\2@\\1"]
             } else {
                 set m "$m at macports.org"
             }
@@ -1221,70 +1194,31 @@
 set ports_dry_last_skipped ""
 
 proc target_run {ditem} {
-    global target_state_fd portpath portname portversion portrevision portvariants ports_force variations workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped errorisprivileges
+    global target_state_fd portname workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped errorisprivileges
     set result 0
     set skipped 0
     set procedure [ditem_key $ditem procedure]
-            
+
     if {[ditem_key $ditem state] != "no"} {
         set target_state_fd [open_statefile]
     }
-        
+
     if {$procedure != ""} {
         set name [ditem_key $ditem name]
-    
+
         if {[ditem_contains $ditem init]} {
             set result [catch {[ditem_key $ditem init] $name} errstr]
         }
-    
+
         if {$result == 0} {
             # Skip the step if required and explain why through ui_debug.
-            # 1st case: the step was already done (as mentioned in the state file)
+            # check if the step was already done (as mentioned in the state file)
             if {[ditem_key $ditem state] != "no"
                     && [check_statefile target $name $target_state_fd]} {
                 ui_debug "Skipping completed $name ($portname)"
                 set skipped 1
-            # 2nd case: the step is not to always be performed
-            # and this exact port/version/revision/variants is already installed
-            # and user didn't mention -f
-            # and portfile didn't change since installation.
-            } elseif {[ditem_key $ditem runtype] != "always"
-              && [registry_exists $portname $portversion $portrevision $portvariants]
-              && !([info exists ports_force] && $ports_force == "yes")} {
-                        
-                # Did the Portfile change since installation?
-                set regref [registry_open $portname $portversion $portrevision $portvariants]
-            
-                set installdate [registry_prop_retr $regref date]
-                if { $installdate != 0
-                  && $installdate < [file mtime ${portpath}/Portfile]} {
-                    ui_debug "Portfile changed since installation"
-                } else {
-                    # Say we're skipping.
-                    set skipped 1
-                
-                    ui_debug "Skipping $name ($portname) since this port is already installed"
-                }
-            
-                # Something to close the registry entry may be called here, if it existed.
-                # 3rd case: the same port/version/revision/Variants is already active
-                # and user didn't mention -f
-            } elseif {$name == "org.macports.activate"
-              && [registry_exists $portname $portversion $portrevision $portvariants]
-              && !([info exists ports_force] && $ports_force == "yes")} {
-            
-                # Is port active?
-                set regref [registry_open $portname $portversion $portrevision $portvariants]
-            
-                if { [registry_prop_retr $regref active] != 0 } {
-                    # Say we're skipping.
-                    set skipped 1
-                
-                    ui_msg "Skipping $name ($portname $portvariants) since this port is already active"
-                }
-                
             }
-            
+
             # Of course, if this is a dry run, don't do the task:
             if {[info exists ports_dryrun] && $ports_dryrun == "yes"} {
                 # only one message per portname
@@ -1296,18 +1230,18 @@
                 }
                 set skipped 1
             }
-            
+
             # otherwise execute the task.
             if {$skipped == 0} {
                 set target [ditem_key $ditem provides]
-            
+
                 # Execute pre-run procedure
                 if {[ditem_contains $ditem prerun]} {
                     set result [catch {[ditem_key $ditem prerun] $name} errstr]
                 }
-            
+
                 #start tracelib
-                if {($result ==0 
+                if {($result ==0
                   && [info exists ports_trace]
                   && $ports_trace == "yes"
                   && $target != "clean")} {
@@ -1321,20 +1255,20 @@
                       && $target != "install"} {
                         porttrace::trace_enable_fence
                     }
-            
+
                     # collect deps
-                    
+
                     # Don't check dependencies for extract (they're not honored
                     # anyway). This avoids warnings about bzip2.
                     if {$target != "extract"} {
                         set depends {}
                         set deptypes {}
-                    
+
                         # Determine deptypes to look for based on target
                         switch $target {
                             configure   -
                             build       { set deptypes "depends_lib depends_build" }
-                        
+
                             test        -
                             destroot    -
                             install     -
@@ -1350,7 +1284,7 @@
                             activate    -
                             ""          { set deptypes "depends_lib depends_build depends_run" }
                         }
-                    
+
                         # Gather the dependencies for deptypes
                         foreach deptype $deptypes {
                             # Add to the list of dependencies if the option exists and isn't empty.
@@ -1358,7 +1292,7 @@
                                 set depends [concat $depends $PortInfo($deptype)]
                             }
                         }
-    
+
                         # Dependencies are in the form verb:[param:]port
                         set depsPorts {}
                         foreach depspec $depends {
@@ -1371,16 +1305,16 @@
                         if {$target == "destroot"} {
                             lappend depsPorts "gzip"
                         }
-                    
+
                         set portlist $depsPorts
                         foreach depName $depsPorts {
                             set portlist [recursive_collect_deps $depName $deptypes $portlist]
                         }
-                    
+
                         if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
                     }
                 }
-            
+
                 if {$result == 0} {
                     foreach pre [ditem_key $ditem pre] {
                         ui_debug "Executing $pre"
@@ -1388,12 +1322,12 @@
                         if {$result != 0} { break }
                     }
                 }
-            
+
                 if {$result == 0} {
                 ui_debug "Executing $name ($portname)"
                 set result [catch {$procedure $name} errstr]
                 }
-            
+
                 if {$result == 0} {
                     foreach post [ditem_key $ditem post] {
                         ui_debug "Executing $post"
@@ -1412,11 +1346,11 @@
                 if {[info exists ports_trace]
                   && $ports_trace == "yes"
                   && $target!="clean"} {
-                
+
                     tracelib closesocket
-                
+
                     porttrace::trace_check_violations
-                
+
                     # End of trace.
                     porttrace::trace_stop
                 }
@@ -1433,21 +1367,21 @@
             write_statefile target $name $target_state_fd
             }
         } else {
-        	if {$errorisprivileges != "yes"} {
+            if {$errorisprivileges != "yes"} {
                 global errorInfo
-            	ui_error "Target $name returned: $errstr"
+                ui_error "Target $name returned: $errstr"
                 ui_debug "Backtrace: $errorInfo"
             } else {
-            	ui_msg "Target $name returned: $errstr"
+                ui_msg "Target $name returned: $errstr"
             }
             set result 1
         }
-    
+
     } else {
         ui_info "Warning: $name does not have a registered procedure"
         set result 1
     }
-    
+
     if {[ditem_key $ditem state] != "no"} {
         close $target_state_fd
     }
@@ -1458,7 +1392,7 @@
 # recursive dependency search for portname
 proc recursive_collect_deps {portname deptypes {depsfound {}}} \
 {
-    set res [mport_search ^$portname\$]
+    set res [mport_lookup $portname]
     if {[llength $res] < 2} \
     {
         return {}
@@ -1479,7 +1413,7 @@
     foreach depspec $depends \
     {
         set portname [lindex [split $depspec :] end]
-        if {[lsearch -exact $portdeps $portname] == -1} { 
+        if {[lsearch -exact $portdeps $portname] == -1} {
             lappend portdeps $portname
             set portdeps [recursive_collect_deps $portname $deptypes $portdeps]
         }
@@ -1489,14 +1423,37 @@
 
 
 proc eval_targets {target} {
-    global targets target_state_fd portname errorisprivileges
+    global targets target_state_fd portname portversion portrevision portvariants ports_dryrun user_options errorisprivileges
     set dlist $targets
     set errorisprivileges "no"
-    
+
+    # the statefile will likely be autocleaned away after install,
+    # so special-case ignore already-completed install and activate
+    if {[registry_exists $portname $portversion $portrevision $portvariants]} {
+        if {$target == "install"} {
+            ui_debug "Skipping $target ($portname) since this port is already installed"
+            return 0
+        } elseif {$target == "activate"} {
+            set regref [registry_open $portname $portversion $portrevision $portvariants]
+            if {[registry_prop_retr $regref active] != 0} {
+                # Something to close the registry entry may be called here, if it existed.
+                ui_debug "Skipping $target ($portname @${portversion}_${portrevision}${portvariants}) since this port is already active"
+            } else {
+                # do the activate here since target_run doesn't know how to selectively ignore the preceding steps
+                if {[info exists ports_dryrun] && $ports_dryrun == "yes"} {
+                    ui_msg "For $portname: skipping $target (dry run)"
+                } else {
+                    registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
+                }
+            }
+            return 0
+        }
+    }
+
     # Select the subset of targets under $target
     if {$target != ""} {
         set matches [dlist_search $dlist provides $target]
-    
+
         if {[llength $matches] > 0} {
             set dlist [dlist_append_dependents $dlist [lindex $matches 0] [list]]
             # Special-case 'all'
@@ -1505,9 +1462,9 @@
             return 1
         }
     }
-    
+
     set dlist [dlist_eval $dlist "" target_run]
-    
+
     if {[llength $dlist] > 0} {
         # somebody broke!
         set errstring "Warning: the following items did not execute (for $portname):"
@@ -1519,13 +1476,13 @@
     } else {
         set result 0
     }
-    
+
     # start gsoc08-privileges
     if { $result == 1 && $errorisprivileges == "yes" } {
-    	set result 2
+        set result 2
     }
     # end gsoc08-privileges
-    
+
     return $result
 }
 
@@ -1534,79 +1491,79 @@
 proc open_statefile {args} {
     global workpath worksymlink place_worksymlink portname portpath ports_ignore_older
     global altprefix usealtworkpath env applications_dir portbuildpath distpath
-    
-	# start gsoc08-privileges
 
-	# de-escalate privileges - only run if MacPorts was started with sudo
-	dropPrivileges
-    
+    # start gsoc08-privileges
+
+    # de-escalate privileges - only run if MacPorts was started with sudo
+    dropPrivileges
+
     if { ![file exists $workpath] } {
         if {[catch {set result [file mkdir $workpath]} result]} {
             global errorInfo
             ui_debug "mkdir $workpath: $errorInfo"
         }
     }
-    
-    # if unable to write to workpath, implies running without either root privileges 
+
+    # if unable to write to workpath, implies running without either root privileges
     # or a shared directory owned by the group so use ~/.macports
     if { ![file writable $workpath] } {
-    
-    	set userid [getuid]
-    	set username [uid_to_name $userid]
 
-    	if { $userid !=0 } {
-    		ui_msg "MacPorts running without privileges.\
-					You may be prompted for your sudo password in order to complete certain actions (eg install)."
-		}
-    	
-    	# set global variable indicating to other functions to use ~/.macports as well
-    	set usealtworkpath yes
-    
-		# do tilde expansion manually - tcl won't expand tildes automatically for curl, etc.
-		if {[info exists env(HOME)]} {
-			# HOME environment var is set, use it.
-			set userhome "$env(HOME)"
-		} else {
-			# the environment var isn't set, expand ~user instead
-			set userhome [file normalize "~${username}"]
-		}
-		
-		# set alternative prefix global variables
-		set altprefix "$userhome/.macports"
-		
-		# get alternative paths
-		set newworkpath "$altprefix$workpath"
-		set newworksymlink "$altprefix$worksymlink"
-		set newportbuildpath "$altprefix$portbuildpath"
-		set newdistpath "$altprefix$distpath"
-		
-		set sourcepath [string map {"work" ""} $worksymlink] 
-		set newsourcepath "$altprefix/[ string range $sourcepath 1 end ]"
+        set userid [getuid]
+        set username [uid_to_name $userid]
 
-		# copy Portfile (and patch files) if not there already
-		# note to maintainers/devs: the original portfile in /opt/local is ALWAYS the one that will be 
-		#	 read by macports. The copying of the portfile is done to preserve the symlink provided
-		#	 historically by macports from the portfile directory to the work directory.
-		#	 It is NOT read by MacPorts.
-		if {![file exists ${newsourcepath}Portfile] } {
-			file mkdir $newsourcepath
-			ui_debug "$newsourcepath created"
-			ui_debug "Going to copy: ${sourcepath}Portfile"
-			file copy ${sourcepath}Portfile $newsourcepath
-			if {[file exists ${sourcepath}files] } {
-				ui_debug "Going to copy: ${sourcepath}files"
-				file copy ${sourcepath}files $newsourcepath
-			}
-		}
-		
-		set workpath $newworkpath
-		set worksymlink $newworksymlink
-		set portbuildpath $newportbuildpath
-		set distpath $newdistpath
-		
-		ui_debug "Going to use $newworkpath for statefile."
+        if { $userid !=0 } {
+            ui_msg "MacPorts running without privileges.\
+                    You may be prompted for your sudo password in order to complete certain actions (eg install)."
+        }
+
+        # set global variable indicating to other functions to use ~/.macports as well
+        set usealtworkpath yes
+
+        # do tilde expansion manually - tcl won't expand tildes automatically for curl, etc.
+        if {[info exists env(HOME)]} {
+            # HOME environment var is set, use it.
+            set userhome "$env(HOME)"
+        } else {
+            # the environment var isn't set, expand ~user instead
+            set userhome [file normalize "~${username}"]
+        }
+
+        # set alternative prefix global variables
+        set altprefix "$userhome/.macports"
+
+        # get alternative paths
+        set newworkpath "$altprefix$workpath"
+        set newworksymlink "$altprefix$worksymlink"
+        set newportbuildpath "$altprefix$portbuildpath"
+        set newdistpath "$altprefix$distpath"
+
+        set sourcepath [string map {"work" ""} $worksymlink]
+        set newsourcepath "$altprefix/[ string range $sourcepath 1 end ]"
+
+        # copy Portfile (and patch files) if not there already
+        # note to maintainers/devs: the original portfile in /opt/local is ALWAYS the one that will be
+        #    read by macports. The copying of the portfile is done to preserve the symlink provided
+        #    historically by macports from the portfile directory to the work directory.
+        #    It is NOT read by MacPorts.
+        if {![file exists ${newsourcepath}Portfile] } {
+            file mkdir $newsourcepath
+            ui_debug "$newsourcepath created"
+            ui_debug "Going to copy: ${sourcepath}Portfile"
+            file copy ${sourcepath}Portfile $newsourcepath
+            if {[file exists ${sourcepath}files] } {
+                ui_debug "Going to copy: ${sourcepath}files"
+                file copy ${sourcepath}files $newsourcepath
+            }
+        }
+
+        set workpath $newworkpath
+        set worksymlink $newworksymlink
+        set portbuildpath $newportbuildpath
+        set distpath $newdistpath
+
+        ui_debug "Going to use $newworkpath for statefile."
     } else {
-    	set usealtworkpath no
+        set usealtworkpath no
     }
     # end gsoc08-privileges
 
@@ -1627,12 +1584,12 @@
         }
     }
 
-    # Create a symlink to the workpath for port authors 
+    # Create a symlink to the workpath for port authors
     if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
         ui_debug "Attempting ln -sf $workpath $worksymlink"
         ln -sf $workpath $worksymlink
     }
-    
+
     set fd [open $statefile a+]
     if {[catch {flock $fd -exclusive -noblock} result]} {
         if {"$result" == "EAGAIN"} {
@@ -1675,14 +1632,14 @@
 # Check that recorded selection of variants match the current selection
 proc check_statefile_variants {variations fd} {
     upvar $variations upvariations
-    
+
     seek $fd 0
     while {[gets $fd line] >= 0} {
         if {[regexp "variant: (.*)" $line match name]} {
             set oldvariations([string range $name 1 end]) [string range $name 0 0]
         }
     }
-    
+
     set mismatch 0
     if {[array size oldvariations] > 0} {
         if {[array size oldvariations] != [array size upvariations]} {
@@ -1696,7 +1653,7 @@
             }
         }
     }
-    
+
     return $mismatch
 }
 
@@ -1706,9 +1663,9 @@
 # will be chosen.  Returns a list of the selected variants.
 proc choose_variants {dlist variations} {
     upvar $variations upvariations
-    
+
     set selected [list]
-    
+
     foreach ditem $dlist {
         # Enumerate through the provides, tallying the pros and cons.
         set pros 0
@@ -1725,9 +1682,9 @@
                 incr ignored
             }
         }
-    
+
         if {$cons > 0} { continue }
-    
+
         if {$pros > 0 && $ignored == 0} {
             lappend selected $ditem
         }
@@ -1738,7 +1695,7 @@
 proc variant_run {ditem} {
     set name [ditem_key $ditem name]
     ui_debug "Executing variant $name provides [ditem_key $ditem provides]"
-    
+
     # test for conflicting variants
     foreach v [ditem_key $ditem conflicts] {
         if {[variant_isset $v]} {
@@ -1746,7 +1703,7 @@
             return 1
         }
     }
-    
+
     # execute proc with same name as variant.
     if {[catch "variant-${name}" result]} {
         global errorInfo
@@ -1758,7 +1715,7 @@
 }
 
 # Given a list of variant specifications, return a canonical string form
-# for the registry. 
+# for the registry.
     # The strategy is as follows: regardless of how some collection of variants
     # was turned on or off, a particular instance of the port is uniquely
     # characterized by the set of variants that are *on*. Thus, record those
@@ -1788,11 +1745,11 @@
     set chosen [choose_variants $dlist upvariations]
     set portname $PortInfo(name)
 
-    # Check to make sure the requested variations are available with this 
-    # port, if one is not, warn the user and remove the variant from the 
+    # Check to make sure the requested variations are available with this
+    # port, if one is not, warn the user and remove the variant from the
     # array.
     foreach key [array names upvariations *] {
-        if {![info exists PortInfo(variants)] || 
+        if {![info exists PortInfo(variants)] ||
             [lsearch $PortInfo(variants) $key] == -1} {
             ui_debug "Requested variant $key is not provided by port $portname."
             array unset upvariations $key
@@ -1804,12 +1761,12 @@
     #foreach obj $dlist {
     #    $obj set provides [list [join [$obj get provides] -]]
     #}
-    
+
     set newlist [list]
     foreach variant $chosen {
         set newlist [dlist_append_dependents $dlist $variant $newlist]
     }
-    
+
     set dlist [dlist_eval $newlist "" variant_run]
     if {[llength $dlist] > 0} {
         return 1
@@ -1861,7 +1818,7 @@
     upvar $variations upvariations
     set result 0
     set portname $PortInfo(name)
-    
+
     # Make sure the variations match those stored in the statefile.
     # If they don't match, print an error indicating a 'port clean'
     # should be performed.
@@ -1881,9 +1838,9 @@
     }
     if { $statereq &&
         !([info exists ports_force] && $ports_force == "yes")} {
-        
+
         set state_fd [open_statefile]
-    
+
         if {[check_statefile_variants upvariations $state_fd]} {
             ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option."
             set result 1
@@ -1893,15 +1850,15 @@
             write_statefile variant $upvariations($key)$key $state_fd
             }
         }
-        
+
         close $state_fd
     }
-    
+
     return $result
 }
 
 proc default_universal_variant_allowed {args} {
-    
+
     if {[variant_exists universal]} {
         ui_debug "universal variant already exists, so not adding the default one"
         return no
@@ -1947,12 +1904,12 @@
 proc target_new {name procedure} {
     global targets
     set ditem [ditem_create]
-    
+
     ditem_key $ditem name $name
     ditem_key $ditem procedure $procedure
-    
+
     lappend targets $ditem
-    
+
     return $ditem
 }
 
@@ -2104,15 +2061,13 @@
     } else {
         set options(workpath) ${newworkpath}
     }
-    # Escape regex special characters
-    regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string 
-    
-    set res [mport_search ^$search_string\$]
+
+    set res [mport_lookup $portname]
     if {[llength $res] < 2} {
         ui_error "Dependency $portname not found"
         return -1
     }
-    
+
     array set portinfo [lindex $res 1]
     set porturl $portinfo(porturl)
     if {[catch {set worker [mport_open $porturl [array get options] $variations]} result]} {
@@ -2129,7 +2084,7 @@
         return -1
     }
     mport_close $worker
-    
+
     return 0
 }
 
@@ -2147,17 +2102,17 @@
     set realname ${name}
     set home /dev/null
     set shell /dev/null
-    
+
     foreach arg $args {
         if {[regexp {([a-z]*)=(.*)} $arg match key val]} {
             set $key $val
         }
     }
-    
+
     if {[existsuser ${name}] != 0 || [existsuser ${uid}] != 0} {
         return
     }
-    
+
     if {${os.platform} eq "darwin"} {
         exec dscl . -create /Users/${name} Password ${passwd}
         exec dscl . -create /Users/${name} UniqueID ${uid}
@@ -2178,17 +2133,17 @@
     set realname ${name}
     set passwd {*}
     set users ""
-    
+
     foreach arg $args {
         if {[regexp {([a-z]*)=(.*)} $arg match key val]} {
             set $key $val
         }
     }
-    
+
     if {[existsgroup ${name}] != 0 || [existsgroup ${gid}] != 0} {
         return
     }
-    
+
     if {${os.platform} eq "darwin"} {
         exec dscl . -create /Groups/${name} Password ${passwd}
         exec dscl . -create /Groups/${name} RealName ${realname}
@@ -2224,12 +2179,12 @@
 # returns an error code if it can not be found
 proc binaryInPath {binary} {
     global env
-    foreach dir [split $env(PATH) :] { 
+    foreach dir [split $env(PATH) :] {
         if {[file executable [file join $dir $binary]]} {
             return [file join $dir $binary]
         }
     }
-    
+
     return -code error [format [msgcat::mc "Failed to locate '%s' in path: '%s'"] $binary $env(PATH)];
 }
 
@@ -2349,7 +2304,7 @@
 # private function
 # merge_file base-path target-path relative-path architectures
 # e.g. 'merge_file ${workpath}/pre-dest ${destroot} ${prefix}/share/man/man1/port.1 i386 ppc
-# will test equivalence of files and copy them if they are the same (for the different architectures) 
+# will test equivalence of files and copy them if they are the same (for the different architectures)
 proc merge_file {base target file archs} {
     set basearch [lindex ${archs} 0]
     ui_debug "ba: '${basearch}' ('${archs}')"
@@ -2430,14 +2385,14 @@
 # @param path the file/directory to be chowned
 # @param user the user to chown file to
 proc chown {path user} {
-	lchown $path $user
-	
+    lchown $path $user
+
     if {[file isdirectory $path]} {
-		fs-traverse myfile ${path} {
-			lchown $myfile $user
-		}
+        fs-traverse myfile ${path} {
+            lchown $myfile $user
+        }
     }
-    
+
 }
 
 ##
@@ -2447,18 +2402,18 @@
 proc chownAsRoot {path} {
     global euid macportsuser
 
-	if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
-	# if started with sudo but have dropped the privileges
-		seteuid $euid	
-		ui_debug "euid changed to: [geteuid]"
-		chown  ${path} ${macportsuser}
-		ui_debug "chowned $path to $macportsuser"
-		seteuid [name_to_uid "$macportsuser"]
-		ui_debug "euid changed to: [geteuid]"
-	} elseif { [getuid] == 0 } {
-	# if started with sudo but have elevated back to root already
-		chown  ${path} ${macportsuser}
-	}
+    if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
+    # if started with sudo but have dropped the privileges
+        seteuid $euid
+        ui_debug "euid changed to: [geteuid]"
+        chown  ${path} ${macportsuser}
+        ui_debug "chowned $path to $macportsuser"
+        seteuid [name_to_uid "$macportsuser"]
+        ui_debug "euid changed to: [geteuid]"
+    } elseif { [getuid] == 0 } {
+    # if started with sudo but have elevated back to root already
+        chown  ${path} ${macportsuser}
+    }
 }
 
 ##
@@ -2466,51 +2421,51 @@
 #
 # @param action the action for which privileges are being elevated
 proc elevateToRoot {action} {
-	global euid egid macportsuser errorisprivileges
-	
-	if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } { 
-	# if started with sudo but have dropped the privileges
-		ui_debug "Can't run $action on this port without elevated privileges. Escalating privileges back to root."
-		setegid $egid	
-		seteuid $euid	
-		ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
-	}
-	
-	if { [getuid] != 0 } {
-		set errorisprivileges yes
-		return -code error "port requires root privileges for this action and needs you to type your password for sudo.";
-	}
+    global euid egid macportsuser errorisprivileges
+
+    if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
+    # if started with sudo but have dropped the privileges
+        ui_debug "Can't run $action on this port without elevated privileges. Escalating privileges back to root."
+        setegid $egid
+        seteuid $euid
+        ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
+    }
+
+    if { [getuid] != 0 } {
+        set errorisprivileges yes
+        return -code error "port requires root privileges for this action and needs you to type your password for sudo.";
+    }
 }
 
 ##
 # de-escalate privileges from root to those of $macportsuser.
 #
 proc dropPrivileges {} {
-	global euid egid macportsuser workpath
-	if { [geteuid] == 0 } {
-		if { [catch {
-				set euid [geteuid]
-				set egid [getegid]
-				ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
-	
-				#seteuid [name_to_uid [file attributes $workpath -owner]]
-				#setegid [name_to_gid [file attributes $workpath -group]]
-	
-				setegid [name_to_gid "$macportsuser"]
-				seteuid [name_to_uid "$macportsuser"]
-				ui_debug "egid changed to: [getegid]" 
-				ui_debug "euid changed to: [geteuid]"
-				
-				if {![file writable $workpath]} {
-					ui_debug "Privileges successfully de-escalated. Unable to write to default workpath."
-				}
-			}]
-		} {
-			ui_debug "$::errorInfo"
-			ui_error "Failed to de-escalate privileges."
-		}
-	} else {
-		ui_debug "Privilege de-escalation not attempted as not running as root."
-	}
+    global euid egid macportsuser workpath
+    if { [geteuid] == 0 } {
+        if { [catch {
+                set euid [geteuid]
+                set egid [getegid]
+                ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
+
+                #seteuid [name_to_uid [file attributes $workpath -owner]]
+                #setegid [name_to_gid [file attributes $workpath -group]]
+
+                setegid [name_to_gid "$macportsuser"]
+                seteuid [name_to_uid "$macportsuser"]
+                ui_debug "egid changed to: [getegid]"
+                ui_debug "euid changed to: [geteuid]"
+
+                if {![file writable $workpath]} {
+                    ui_debug "Privileges successfully de-escalated. Unable to write to default workpath."
+                }
+            }]
+        } {
+            ui_debug "$::errorInfo"
+            ui_error "Failed to de-escalate privileges."
+        }
+    } else {
+        ui_debug "Privilege de-escalation not attempted as not running as root."
+    }
 }
 

Modified: branches/new-help-system/base/src/registry1.0/portimage.tcl
===================================================================
--- branches/new-help-system/base/src/registry1.0/portimage.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/registry1.0/portimage.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -295,9 +295,9 @@
 		file copy -force $srcfile $dstfile
 	} else {
 		# Try a hard link first and if that fails, a symlink
-		if {[catch {compat filelinkhard $dstfile $srcfile}]} {
+		if {[catch {file link -hard $dstfile $srcfile}]} {
 			ui_debug "hardlinking $srcfile to $dstfile failed, symlinking instead"
-			compat filelinksymbolic $dstfile $srcfile
+			file link -symbolic $dstfile $srcfile
 		}
 	}
 }
@@ -439,7 +439,7 @@
 			# 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 [compat filenormalize $file]
+			set theFile [file normalize $file]
 			lappend files $theFile
 			
 			# Split out the filename's subpaths and add them to the image list as

Modified: branches/new-help-system/base/src/registry1.0/portuninstall.tcl
===================================================================
--- branches/new-help-system/base/src/registry1.0/portuninstall.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/registry1.0/portuninstall.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -92,12 +92,8 @@
 		foreach dep $deplist { 
 			set depport [lindex $dep 2]
 			ui_debug "$depport depends on this port"
-			# xxx: Should look at making registry::installed return 0 or 
-			# something instead  of erroring.
-			if { ![catch {set installed [registry::installed $depport]} res] } {
-				if { [llength installed] > 0 } {
-					lappend dl $depport
-				}
+			if {[registry::entry_exists_for_name $depport]} {
+				lappend dl $depport
 			}
 		}
 		# Now see if we need to error
@@ -105,11 +101,8 @@
 			if {[info exists options(ports_uninstall_follow-dependents)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
 				foreach depport $dl {
 					# make sure it's still installed, since a previous dep uninstall may have removed it
-					# does registry::installed still error? A cursory look at the code says no, but above says yes
-					if { ![catch {set installed [registry::installed $depport]} res] } {
-						if { [llength installed] > 0 } {
-							portuninstall::uninstall $depport "" [array get options]
-						}
+					if {[registry::entry_exists_for_name $depport]} {
+						portuninstall::uninstall $depport "" [array get options]
 					}
 				}
 			} else {
@@ -189,7 +182,7 @@
 			}
 			# Normalize the file path to avoid removing the intermediate
 			# symlinks (remove the empty directories instead)
-			set theFile [compat filenormalize [lindex $f 0]]
+			set theFile [file normalize [lindex $f 0]]
 			lappend files $theFile
 
 			# Split out the filename's subpaths and add them to the

Modified: branches/new-help-system/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- branches/new-help-system/base/src/registry1.0/receipt_flat.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/registry1.0/receipt_flat.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -43,6 +43,8 @@
 
 # receipt_lastref is the last attributed index of receipts.
 variable receipt_lastref -1
+# maps port name,version,variants to the corresponding receipt ref
+variable ref_index
 
 ##
 #
@@ -101,6 +103,12 @@
 proc open_entry {name {version ""} {revision 0} {variants ""}} {
 	global macports::registry.installtype
 	global macports::registry.path
+	variable ref_index
+	
+	# if this entry is already open, just return the reference
+	if {[info exists ref_index($name,$version,$revision,$variants)]} {
+	    return $ref_index($name,$version,$revision,$variants)
+	}
 
 	set receipt_path [file join ${macports::registry.path} receipts ${name}]
 
@@ -195,6 +203,8 @@
 		}
 	}
 	
+	set ref_index($name,$version,$revision,$variants) $ref
+	
 	return $ref
 }
 
@@ -335,9 +345,6 @@
 # Check to see if an entry exists
 proc entry_exists {name version {revision 0} {variants ""}} {
 	global macports::registry.path
-	variable receipt_handle 
-	variable receipt_file 
-	variable receipt_path
 
 	set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
 	set receipt_file [file join ${receipt_path} receipt]
@@ -351,6 +358,19 @@
 	return 0
 }
 
+# Check to see if any entry exists for the given port name
+proc entry_exists_for_name {name} {
+	global macports::registry.path
+
+	set receipt_path [file join ${macports::registry.path} receipts ${name}]
+
+	if {[llength [glob -nocomplain -directory $receipt_path */receipt{,.bz2}]] > 0} {
+		return 1
+	}
+
+	return 0
+}
+
 ##
 #
 # Store a property to a receipt that was loaded in memory.
@@ -388,6 +408,15 @@
 # Delete an entry
 proc delete_entry {name version {revision 0} {variants ""}} {
 	global macports::registry.path
+	variable ref_index
+	
+	# if the entry is loaded, purge it
+	if {[info exists ref_index($name,$version,$revision,$variants)]} {
+	    set ref $ref_index($name,$version,$revision,$variants)
+	    variable receipt_${ref}
+	    array unset receipt_${ref}
+	    array unset ref_index "$name,$version,$revision,$variants"
+	}
 
 	set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
 	if { [file exists ${receipt_path}] } {

Modified: branches/new-help-system/base/src/registry1.0/registry.tcl
===================================================================
--- branches/new-help-system/base/src/registry1.0/registry.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/registry1.0/registry.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -82,6 +82,12 @@
 	return [${macports::registry.format}::entry_exists $name $version $revision $variants] 
 }
 
+# Check to see if any entry exists in the registry for the given port name.
+proc entry_exists_for_name {name} {
+	global macports::registry.format
+	return [${macports::registry.format}::entry_exists_for_name $name]
+}
+
 # Close the registry... basically wrap the receipts systems's write process
 proc write_entry {ref} {
 	global macports::registry.format

Modified: branches/new-help-system/base/src/registry2.0/portimage.tcl
===================================================================
--- branches/new-help-system/base/src/registry2.0/portimage.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/registry2.0/portimage.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -254,10 +254,10 @@
             ui_debug "activating file: $dstfile"
             # Try a hard link first and if that fails, a symlink
             try {
-                compat filelinkhard $dstfile $srcfile
+                file link -hard $dstfile $srcfile
             } catch {*} {
                 ui_debug "hardlinking $srcfile to $dstfile failed; symlinking instead"
-                compat filelinksymbolic $dstfile $srcfile
+                file link -symbolic $dstfile $srcfile
             }
         }
         default {
@@ -420,7 +420,7 @@
             # 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 [compat filenormalize $file]
+            set theFile [file normalize $file]
             lappend files $theFile
 
             # Split out the filename's subpaths and add them to the image list

Modified: branches/new-help-system/base/src/registry2.0/portuninstall.tcl
===================================================================
--- branches/new-help-system/base/src/registry2.0/portuninstall.tcl	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/src/registry2.0/portuninstall.tcl	2009-05-12 17:37:20 UTC (rev 50909)
@@ -124,7 +124,7 @@
 
         # Normalize the file path to avoid removing the intermediate
         # symlinks (remove the empty directories instead)
-        set theFile [compat filenormalize $file]
+        set theFile [file normalize $file]
         lappend files $theFile
 
         # Split out the filename's subpaths and add them to the

Modified: branches/new-help-system/base/tests/test-macports.conf
===================================================================
--- branches/new-help-system/base/tests/test-macports.conf	2009-05-12 17:33:15 UTC (rev 50908)
+++ branches/new-help-system/base/tests/test-macports.conf	2009-05-12 17:37:20 UTC (rev 50909)
@@ -14,9 +14,6 @@
 # Type of installation to do for ports, "direct" or "image".  See macports.conf(5) and online documentation.
 portinstalltype		image
 
-# Directory containing the X11 installation.
-x11prefix		/tmp/macports-tests/usr/X11R6
-
 # Where to find the sources list.
 sources_conf		/tmp/macports-tests/opt/local/etc/macports/sources.conf
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090512/27dc6d97/attachment-0001.html>


More information about the macports-changes mailing list