[24908] branches/release_1_4/base

source_changes at macosforge.org source_changes at macosforge.org
Mon May 7 20:53:34 PDT 2007


Revision: 24908
          http://trac.macosforge.org/projects/macports/changeset/24908
Author:   jberry at macports.org
Date:     2007-05-07 20:53:32 -0700 (Mon, 07 May 2007)

Log Message:
-----------
Merge from trunk to release_1_4 branch in preparation for release 1.4.40 release

Modified Paths:
--------------
    branches/release_1_4/base/ChangeLog
    branches/release_1_4/base/ReleaseProcess
    branches/release_1_4/base/aclocal.m4
    branches/release_1_4/base/config/RELEASE_URL
    branches/release_1_4/base/config/dp_version
    branches/release_1_4/base/configure
    branches/release_1_4/base/configure.ac
    branches/release_1_4/base/doc/INTERNALS
    branches/release_1_4/base/doc/Makefile
    branches/release_1_4/base/doc/portfile.7
    branches/release_1_4/base/doc/ports.conf.5
    branches/release_1_4/base/src/darwinports1.0/darwinports.tcl
    branches/release_1_4/base/src/darwinports1.0/darwinports_autoconf.tcl.in
    branches/release_1_4/base/src/package1.0/portunarchive.tcl
    branches/release_1_4/base/src/pextlib1.0/Makefile
    branches/release_1_4/base/src/pextlib1.0/Pextlib.c
    branches/release_1_4/base/src/pextlib1.0/fs-traverse.c
    branches/release_1_4/base/src/pextlib1.0/tests/checksums.tcl
    branches/release_1_4/base/src/pextlib1.0/tests/curl.tcl
    branches/release_1_4/base/src/pextlib1.0/tests/fifo.tcl
    branches/release_1_4/base/src/pextlib1.0/tests/filemap.tcl
    branches/release_1_4/base/src/port/port.tcl
    branches/release_1_4/base/src/port1.0/Makefile
    branches/release_1_4/base/src/port1.0/port_autoconf.tcl.in
    branches/release_1_4/base/src/port1.0/portdepends.tcl
    branches/release_1_4/base/src/port1.0/portdestroot.tcl
    branches/release_1_4/base/src/port1.0/portfetch.tcl
    branches/release_1_4/base/src/port1.0/portlivecheck.tcl
    branches/release_1_4/base/src/port1.0/portsubmit.tcl
    branches/release_1_4/base/src/port1.0/portutil.tcl
    branches/release_1_4/base/src/port1.0/resources/fetch/mirror_sites.tcl
    branches/release_1_4/base/src/registry1.0/portimage.tcl
    branches/release_1_4/base/src/registry1.0/receipt_flat.tcl
    branches/release_1_4/base/src/registry1.0/registry.tcl

Added Paths:
-----------
    branches/release_1_4/base/portmgr/autosubmit.tcl
    branches/release_1_4/base/src/pextlib1.0/tests/fs-traverse.tcl
    branches/release_1_4/base/src/pextlib1.0/tests/symlink.tcl
    branches/release_1_4/base/src/port1.0/tests/
    branches/release_1_4/base/src/port1.0/tests/portutil.tcl

Removed Paths:
-------------
    branches/release_1_4/base/portmgr/dprsyncup
    branches/release_1_4/base/src/port1.0/tests/portutil.tcl

Property Changed:
----------------
    branches/release_1_4/base/src/port/port.tcl
    branches/release_1_4/base/src/port/portindex.tcl
    branches/release_1_4/base/src/port/portmirror.tcl

Modified: branches/release_1_4/base/ChangeLog
===================================================================
--- branches/release_1_4/base/ChangeLog	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/ChangeLog	2007-05-08 03:53:32 UTC (rev 24908)
@@ -4,9 +4,77 @@
 #   This is a log of major user-visible changes in each release
 #
 
-
 (unreleased):
 
+Release 1.4.40 (7-May-2007):
+
+    - Note the bump in version naming. To leave ourselves lots of room in our versioning
+      scheme, we've jumped from 1.4.3 to 1.4.40. The floating point represenation as
+      reported by port version (1.440) will still be the same; we're just interpreting
+      it differently.
+
+    - variable tracing now works in a much better way and handles unsets properly.
+      Similarly, ${option}-delete now works better. Depends validation no longer
+      attempts to validate when the variable is unset. Additionally, the validation
+      now actually validates each depspec instead of simply finding a single spec
+      within the list that works (ticket #11868, eridius r24678).
+
+    - macports infrastructure now easier to use from scripts.
+      ui_prefix and ui_channels have default implementations, and
+      all arguments to dportinit are now optional (ticket #11837, eridius r24460).
+
+    - ln now accepts combined flags (ex. ln -sf foo bar) (eridius r24452)
+
+    - default_variants now handles multiple values correctly (ticket #11828, eridius r24450).
+
+    - ln uses new symlink command so it can create symlinks that point to
+      files that don't actually exist (eridius r24444).
+
+    - New bare-bones Pextlib command `symlink source target` (ticket #11840, eridius r24444).
+
+    - delete reimplemented using fs-traverse (eridius r24435).
+
+    - fs-traverse now uses the fts(3) family of functions instead of readdir/opendir.
+      This fixes a couple behavioral oddities, and makes deleting during traversal work on 10.3
+      (ticket #11839, eridius r24423).
+
+    - fs-traverse now takes a list of targets rather than a variable number of arguments
+      (ticket #11836, eridius r24410).
+
+    - Fixed a potential crasher in fs-traverse when showing error message
+      (ticket #11827, eridius r24396, thanks sfiera).
+    
+    - Fixed a bug where livecheck failed on ports that do not define a homepage
+      (ticket #11818, pguyot r24319).
+
+    - Added the downloads section of our repo to the macports mirrors list (jmpp r24278).
+
+    - Fixed a bug with the archive mode introduced with r23238 change (1.4.1)
+      (pguyot r24273).
+
+    - Trace mode now take dependencies into account when executing the activate
+      phase. This fixes an unwanted warning when activating ports that depend
+      on teTeX (pguyot r24199).
+      
+    - Support for mpwa submit through "port submit".
+      This work is in progress. (jberry)
+       - Expose autoconf XAR variable as portutil::autoconf::xar_path. (r24194).
+       - Start to build portpkg.xar and meta data, hijacking Kevin's
+         portsubmit.tcl. (r24195-24196).
+         
+    - Revise error messages in port image activation to use syntax that
+      matches port(1). (jberry r24543, r24548).
+
+    - Create new interp variable prefix_frozen, which is available to port phases
+      even when the Portfile redefines prefix. (jberry r24848-r24849)
+      
+    - Search for prefix-relative commands in prefix_frozen rather than prefix.
+      Affects port submit (xar) and port fetch (svn). (jberry r24849)
+
+    - Always create a ~/.macports user directory if it doesn't yet exist. (jberry r24831)
+    
+    - Move port(1) readline history file to ~/.macports/history (jberry r24832, r24843)
+
 Release 1.4.3 (17-Apr-2007):
 
     - Fix bug in launchd support, introduced in 1.4.2. Remove remnants of

Modified: branches/release_1_4/base/ReleaseProcess
===================================================================
--- branches/release_1_4/base/ReleaseProcess	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/ReleaseProcess	2007-05-08 03:53:32 UTC (rev 24908)
@@ -40,7 +40,7 @@
 
 The actual release, alpha or beta releases, release candidates, and any point releases will all live on this branch, and tagged appropriately and if necessary (a must for the actual releases, optional for beta snapshots) into the /tags svn directory.
 
-Only the base subdirectory, not the dports subdirectory, is branched for a given release.
+Only the base subdirectory, not the ports subdirectory, is branched for a given release.
 
 
 === Prepare the code for Release ===
@@ -133,16 +133,7 @@
 Once the release has been posted, notification of the release should be sent/posted to the following places:
 
 * The macports-users at lists.macosforge.org and macports-dev at lists.macosforge.org mailing lists.
-* Apple's [http://www.apple.com/downloads/macosx/unix_open_source/darwinports.html Mac OS X software download page] (submitter: mww@)
-* [http://freshmeat.net/projects/darwinports/ Freshmeat] (submitter: mww@)
+* Apple's [http://www.apple.com/downloads/macosx/unix_open_source/macports.html Mac OS X software downloads page] (submitter: jmpp@)
+* [http://freshmeat.net/projects/macports/ Freshmeat] (submitter: mww@)
 * [http://www.versiontracker.com/dyn/moreinfo/macosx/26679 VersionTracker] (submitter: mij@)
 * (Where else? -- MacUpdate?)
-(Following three locations --last two being leftovers from darwinports days-- need to be carefully thought out and reworked in view of a much --*URGENTLY*-- needed website redesign!!!)
-* Wordpress news section at the main MacPorts site, www.macports.org
-* The [http://www.darwinports.org/getdp/ getdp] and [http://www.darwinports.org/ main] sites (the "$dp_version" variable in the includes/common.inc file for the main English site --www/includes/common.inc-- and each localization has to be updated with the release version)
-* The darwinports wiki (updating the "Current DarwinPorts release" line on the [[DarwinPorts|main]] page)
-
-
-== Additional Release Resources ==
-
-* Landon Fuller's [http://www.opendarwin.org/pipermail/darwinports/2005-May/026055.html release process] suggestions

Modified: branches/release_1_4/base/aclocal.m4
===================================================================
--- branches/release_1_4/base/aclocal.m4	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/aclocal.m4	2007-05-08 03:53:32 UTC (rev 24908)
@@ -482,21 +482,6 @@
 
 ])
 
-# OD_PROG_MTREE
-#---------------------------------------
-AC_DEFUN([OD_PROG_MTREE],[
-
-	AC_PATH_PROG([MTREE], [mtree], ,  [/usr/bin:/usr/sbin:/bin:/sbin])
-
-	if test "x$MTREE" = "x" ; then
-		AC_CONFIG_SUBDIRS([src/programs/mtree])
-		MTREE='$(TOPSRCDIR)/src/programs/mtree/mtree'
-		REPLACEMENT_PROGS="$REPLACEMENT_PROGS mtree"
-	fi
-
-	AC_SUBST(MTREE)
-])
-
 # OD_PROG_XAR
 #---------------------------------------
 AC_DEFUN([OD_PROG_XAR],[

Modified: branches/release_1_4/base/config/RELEASE_URL
===================================================================
--- branches/release_1_4/base/config/RELEASE_URL	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/config/RELEASE_URL	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1 +1 @@
-http://svn.macports.org/repository/macports/tags/release_1_4_2/
+http://svn.macports.org/repository/macports/tags/release_1_4_3/

Modified: branches/release_1_4/base/config/dp_version
===================================================================
--- branches/release_1_4/base/config/dp_version	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/config/dp_version	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1 +1 @@
-1.430
+1.440

Modified: branches/release_1_4/base/configure
===================================================================
--- branches/release_1_4/base/configure	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/configure	2007-05-08 03:53:32 UTC (rev 24908)
@@ -677,19 +677,20 @@
 INSTALL_DATA
 SET_MAKE
 LN_S
+MTREE
 CVS
+SVN
 RSYNC
 HAVE_LAUNCHD
 LAUNCHCTL
 XCODEBUILD
 BZIP2
 XAR
+OPEN
 TAR
 GNUTAR
 TAR_CMD
 CFLAGS_QUICHEEATERS
-MTREE
-subdirs
 HAVE_FRAMEWORK_COREFOUNDATION
 HAVE_FRAMEWORK_SYSTEMCONFIGURATION
 HAVE_FRAMEWORK_IOKIT
@@ -727,6 +728,7 @@
 CURL_CONFIG
 CFLAGS_LIBCURL
 LDFLAGS_LIBCURL
+subdirs
 OUR_INCLUDED_PACKAGES
 INCLUDES
 CFLAGS_DEBUG
@@ -752,16 +754,18 @@
 LDFLAGS
 LIBS
 CPPFLAGS
+MTREE
 CVS
+SVN
 RSYNC
 TAR
 GNUTAR
 BZIP2
 XAR
+OPEN
 CPP
 XMKMF'
-ac_subdirs_all='src/programs/mtree
-src/thread2.6'
+ac_subdirs_all='src/thread2.6'
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -1368,12 +1372,15 @@
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  MTREE       path to mtree command
   CVS         path to cvs command
+  SVN         path to svn command
   RSYNC       path to rsync command
   TAR         path to tar command
   GNUTAR      path to gnutar command
   BZIP2       path to bzip2 command
   XAR         path to xar command
+  OPEN        path to open command
   CPP         C preprocessor
   XMKMF       Path to xmkmf, Makefile generator for X Window System
 
@@ -3035,6 +3042,46 @@
 echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
+# Extract the first word of "mtree", so it can be a program name with args.
+set dummy mtree; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MTREE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MTREE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MTREE="$MTREE" # 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_MTREE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MTREE=$ac_cv_path_MTREE
+if test -n "$MTREE"; then
+  { echo "$as_me:$LINENO: result: $MTREE" >&5
+echo "${ECHO_T}$MTREE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
 # Extract the first word of "cvs", so it can be a program name with args.
 set dummy cvs; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3075,6 +3122,46 @@
 fi
 
 
+# Extract the first word of "svn", so it can be a program name with args.
+set dummy svn; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SVN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SVN in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SVN="$SVN" # 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_SVN="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+SVN=$ac_cv_path_SVN
+if test -n "$SVN"; then
+  { echo "$as_me:$LINENO: result: $SVN" >&5
+echo "${ECHO_T}$SVN" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
 # Extract the first word of "rsync", so it can be a program name with args.
 set dummy rsync; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3312,7 +3399,47 @@
 fi
 
 
+# Extract the first word of "open", so it can be a program name with args.
+set dummy open; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_OPEN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $OPEN in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OPEN="$OPEN" # 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_OPEN="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+OPEN=$ac_cv_path_OPEN
+if test -n "$OPEN"; then
+  { echo "$as_me:$LINENO: result: $OPEN" >&5
+echo "${ECHO_T}$OPEN" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
 # Define some precious variables allowing user to override PATH for some programs
 
 
@@ -3322,6 +3449,9 @@
 
 
 
+
+
+
 	# Extract the first word of "tar", so it can be a program name with args.
 set dummy tar; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3486,60 +3616,6 @@
 
 
 
-
-	# Extract the first word of "mtree", so it can be a program name with args.
-set dummy mtree; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_MTREE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $MTREE in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MTREE="$MTREE" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/usr/bin:/usr/sbin:/bin:/sbin"
-for as_dir in $as_dummy
-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_MTREE="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-MTREE=$ac_cv_path_MTREE
-if test -n "$MTREE"; then
-  { echo "$as_me:$LINENO: result: $MTREE" >&5
-echo "${ECHO_T}$MTREE" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-
-	if test "x$MTREE" = "x" ; then
-		subdirs="$subdirs src/programs/mtree"
-
-		MTREE='$(TOPSRCDIR)/src/programs/mtree/mtree'
-		REPLACEMENT_PROGS="$REPLACEMENT_PROGS mtree"
-	fi
-
-
-
-#OD_PROG_XAR
-
 	FRAMEWORK_LIBS="-framework CoreFoundation"
 
 	{ echo "$as_me:$LINENO: checking for CoreFoundation framework" >&5
@@ -3912,6 +3988,7 @@
 	{ echo "$as_me:$LINENO: result: ${result}" >&5
 echo "${ECHO_T}${result}" >&6; }
 
+#OD_PROG_XAR
 
 
 
@@ -10231,19 +10308,20 @@
 INSTALL_DATA!$INSTALL_DATA$ac_delim
 SET_MAKE!$SET_MAKE$ac_delim
 LN_S!$LN_S$ac_delim
+MTREE!$MTREE$ac_delim
 CVS!$CVS$ac_delim
+SVN!$SVN$ac_delim
 RSYNC!$RSYNC$ac_delim
 HAVE_LAUNCHD!$HAVE_LAUNCHD$ac_delim
 LAUNCHCTL!$LAUNCHCTL$ac_delim
 XCODEBUILD!$XCODEBUILD$ac_delim
 BZIP2!$BZIP2$ac_delim
 XAR!$XAR$ac_delim
+OPEN!$OPEN$ac_delim
 TAR!$TAR$ac_delim
 GNUTAR!$GNUTAR$ac_delim
 TAR_CMD!$TAR_CMD$ac_delim
 CFLAGS_QUICHEEATERS!$CFLAGS_QUICHEEATERS$ac_delim
-MTREE!$MTREE$ac_delim
-subdirs!$subdirs$ac_delim
 HAVE_FRAMEWORK_COREFOUNDATION!$HAVE_FRAMEWORK_COREFOUNDATION$ac_delim
 HAVE_FRAMEWORK_SYSTEMCONFIGURATION!$HAVE_FRAMEWORK_SYSTEMCONFIGURATION$ac_delim
 HAVE_FRAMEWORK_IOKIT!$HAVE_FRAMEWORK_IOKIT$ac_delim
@@ -10266,7 +10344,6 @@
 X_PRE_LIBS!$X_PRE_LIBS$ac_delim
 X_LIBS!$X_LIBS$ac_delim
 X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim
-TCL_VERSION!$TCL_VERSION$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -10308,6 +10385,7 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+TCL_VERSION!$TCL_VERSION$ac_delim
 TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
 TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim
 TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim
@@ -10322,6 +10400,7 @@
 CURL_CONFIG!$CURL_CONFIG$ac_delim
 CFLAGS_LIBCURL!$CFLAGS_LIBCURL$ac_delim
 LDFLAGS_LIBCURL!$LDFLAGS_LIBCURL$ac_delim
+subdirs!$subdirs$ac_delim
 OUR_INCLUDED_PACKAGES!$OUR_INCLUDED_PACKAGES$ac_delim
 INCLUDES!$INCLUDES$ac_delim
 CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim
@@ -10340,7 +10419,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 30; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 32; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: branches/release_1_4/base/configure.ac
===================================================================
--- branches/release_1_4/base/configure.ac	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/configure.ac	2007-05-08 03:53:32 UTC (rev 24908)
@@ -13,21 +13,27 @@
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_PROG_LN_S
+AC_PATH_PROG(MTREE, [mtree], [])
 AC_PATH_PROG(CVS, [cvs], [])
+AC_PATH_PROG(SVN, [svn], [])
 AC_PATH_PROG(RSYNC, [rsync], [])
 AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
 AC_PATH_PROG(LAUNCHCTL, [launchctl], [])
 AC_PATH_PROG(XCODEBUILD, [xcodebuild], [])
 AC_PATH_PROG(BZIP2, [bzip2], [])
 AC_PATH_PROG(XAR, [xar], [])
+AC_PATH_PROG(OPEN, [open], [])
 
 # Define some precious variables allowing user to override PATH for some programs
+AC_ARG_VAR(MTREE, [path to mtree command])
 AC_ARG_VAR(CVS, [path to cvs command])
+AC_ARG_VAR(SVN, [path to svn command])
 AC_ARG_VAR(RSYNC, [path to rsync command])
 AC_ARG_VAR(TAR, [path to tar command])
 AC_ARG_VAR(GNUTAR, [path to gnutar command])
 AC_ARG_VAR(BZIP2, [path to bzip2 command])
 AC_ARG_VAR(XAR, [path to xar command])
+AC_ARG_VAR(OPEN, [path to open command])
 
 OD_TAR_NO_SAME_OWNER
 
@@ -39,9 +45,8 @@
 
 OD_COMPILER_ATTRIBUTE_UNUSED
 
-OD_PROG_MTREE
+OD_PROG_DAEMONDO
 #OD_PROG_XAR
-OD_PROG_DAEMONDO
 
 AC_SUBST(REPLACEMENT_PROGS)
 AC_SUBST(EXTRA_PROGS)

Modified: branches/release_1_4/base/doc/INTERNALS
===================================================================
--- branches/release_1_4/base/doc/INTERNALS	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/doc/INTERNALS	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1,16 +1,16 @@
 DARWIN PORTS INTERNALS
 
-The darwin ports system is composed of a three TCL libraries:
+The DarwinPorts system is composed of three TCL libraries:
 	darwinports - public API
 	port - portfile parsing and execution
-	pextlib - neccesary C extensions to TCL
+	pextlib - necessary C extensions to TCL
 
-    These three TCL libraries are grouped as a TCL "package". TCL packages
-allow for complex versioning and have a provide/require model of use, making
+    These three TCL libraries are grouped as TCL "packages". They allow
+for complex versioning and have a provide/require model of use, making
 them well suited for maintaining a backwards compatable ports system.
 
-    The "darwinports" TCL Library provides a public API into the darwin
-ports system. Any external application wishing to manipulate a port can
+    The "darwinports" TCL Library provides a public API into the MarwinPorts
+system. Any external application wishing to manipulate a port can
 load the "darwinports" TCL library. 'port', the included command line port
 utility, uses only the exported "darwinports" API.
 
@@ -18,7 +18,7 @@
 ports (ie, dportexec/dportopen/dportget). Also, the API has very little
 knowledge of the contents of a portfile; instead, it relies entirely upon
 the "port" TCL library. By keeping the high level API simple and generic,
-a revision of the underlying ports system will not neccesarily require
+a revision of the underlying ports system will not necessarily require
 a revision of the high level "darwinports" API.
 
     TCL packages allow for complex versioning with a strong requires/provides

Modified: branches/release_1_4/base/doc/Makefile
===================================================================
--- branches/release_1_4/base/doc/Makefile	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/doc/Makefile	2007-05-08 03:53:32 UTC (rev 24908)
@@ -24,11 +24,10 @@
 	if test -L "${INSTALLDIR}/man" ; then \
 		rm -f "${INSTALLDIR}/man"; \
 	fi
-	
+
 	if test ! -e "${INSTALLDIR}/man" ; then \
 		$(LN_S) share/man ${INSTALLDIR}/man; \
 	fi
-	
 	# Install the ports.conf file. If it's already installed, upgrade it
 	if test ! -e ${DESTDIR}/${portconfigdir}/ports.conf ; then \
 		set -x; \
@@ -46,7 +45,7 @@
 		sed -e s/rsync.opendarwin.org/rsync.darwinports.org/ ${DESTDIR}${portconfigdir}/sources.conf > ${DESTDIR}${portconfigdir}/sources.conf.tmp && \
 			mv ${DESTDIR}${portconfigdir}/sources.conf.tmp ${DESTDIR}${portconfigdir}/sources.conf; \
 	fi
-	
+
 	$(SILENT)if test ! -e ${DESTDIR}${portconfigdir}/variants.conf ; then \
 		set -x; \
 		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 variants.conf ${DESTDIR}${portconfigdir}; \

Modified: branches/release_1_4/base/doc/portfile.7
===================================================================
--- branches/release_1_4/base/doc/portfile.7	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/doc/portfile.7	2007-05-08 03:53:32 UTC (rev 24908)
@@ -28,8 +28,8 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .Dd February 13, 2007
-.Dt PORTFILE 7 "Apple Computer, Inc."
-.Os
+.Dt PORTFILE 7 "Apple Inc."
+.Os Darwin
 .Sh NAME
 .Nm Portfile
 .Nd MacPorts description file reference
@@ -1486,20 +1486,19 @@
 .Op Fl depth
 .Op Fl ignoreErrors
 .Ar varname
-.Ar target
-.Op Ar target ...
+.Ar target-list
 .Ar body
 .Xc
-Traverse the filesystem hierarchy rooted in each
-.Ar target
+Traverse the filesystem hierarchy rooted in each element of
+.Ar target-list
 and execute
 .Ar body
-for each found file/directory. Sets
-.Ar varname
-to the path of the file/directory. If
-.Nm break
+for each found file/directory.
+.Va varname
+is set to the path of the file/directory. If
+.Ic break
 is called during execution, the filesystem traversal is stopped. If
-.Nm continue
+.Ic continue
 is called during execution, the current file and any children are skipped
 and traversal continues with the next file/directory.
 .Bl -tag -width indent
@@ -1511,13 +1510,28 @@
 Please note that using
 .Fl depth
 means you cannot prune a directory with
-.Nm continue
+.Ic continue
 as it will be processed after its children.
 .It Fl ignoreErrors
 Causes
-.Nm fs-traverse
+.Ic fs-traverse
 to ignore any permissions/read errors encountered during processing.
 .El
+.Pp
+If
+.Nm fs-traverse
+is called directly on a symbolic link, the link will be followed. All other
+links encountered during traversal will not be followed.
+.Pp
+.Nm fs-traverse
+will not descend into directories that have a different device number than
+the root of the descent.
+.Pp
+If you remove the current directory during traversal, be aware that you must call
+.Nm continue
+to inform
+.Nm fs-traverse
+that the directory should not be descended into.
 .It Xo
 .Ic curl fetch
 .Ar url
@@ -1582,13 +1596,13 @@
 .Xr file n
 for more information on this command.
 .It Ic copy
-Built-in shorthand alternative to "file -copy".
+Built-in shorthand alternative to "file copy".
 .It Ic move
-Built-in shorthand alternative to "file -rename".
+Built-in shorthand alternative to "file rename".
 .It Ic delete
-Built-in shorthand alternative to "file -delete". Required over the latter for Portfiles that perform deleting
+Built-in shorthand alternative to "file delete". Required over the latter for Portfiles that perform deleting
 operations on directories while building the port on Mac OS X 10.3 and earlier, due to a Tcl anomaly on those systems
-that causes "file -delete" to fail.
+that causes "file delete" to fail.
 .It Ic touch
 Built-in command mimicking the BSD touch command.
 .It Ic ln
@@ -1695,3 +1709,4 @@
 .An "Kevin Van Vechten" Aq kevin at opendarwin.org
 .An "Jordan K. Hubbard" Aq jkh at opendarwin.org
 .An "Chris Ridd" Aq cjr at opendarwin.org
+.An "Kevin Ballard" Aq eridius at macports.org

Modified: branches/release_1_4/base/doc/ports.conf.5
===================================================================
--- branches/release_1_4/base/doc/ports.conf.5	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/doc/ports.conf.5	2007-05-08 03:53:32 UTC (rev 24908)
@@ -146,12 +146,10 @@
 .Ic Default:
 rsync.darwinports.org
 .It Va rsync_dir
-Rsync directory from which to pull the base/ component (infrastructure) of the MacPorts system off
-of the default rsync server.
+Rsync directory from which to pull MacPorts sources from the rsync server.
 .br
 .Ic Default:
-dpupdate1/base/ (to pull in the sources from the shipping "release1" branch off of the MacPorts rsync
-server)
+dpupdate1/base/ (which pulls sources for the currently shipping MacPorts release)
 .It Va rsync_options
 Default rsync options to use when connecting to the rsync server.
 .br

Copied: branches/release_1_4/base/portmgr/autosubmit.tcl (from rev 24905, trunk/base/portmgr/autosubmit.tcl)
===================================================================
--- branches/release_1_4/base/portmgr/autosubmit.tcl	                        (rev 0)
+++ branches/release_1_4/base/portmgr/autosubmit.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -0,0 +1,151 @@
+#!/usr/bin/env tclsh
+
+package require darwinports
+package require sqlite3
+
+proc open_db { db_file } {
+	# Open/create our database
+	sqlite3 db $db_file
+	db timeout 10000
+	if { [llength [db eval {pragma table_info('SubmitInfo')}]] == 0 } {
+		db eval {
+			create table SubmitInfo (
+				porturl text unique,
+				portname text,
+				last_mod_date datetime,
+				submitted_mod_date datetime,
+				submit_date datetime
+			)
+		}
+	}
+}
+
+
+proc close_db {} {
+	db close
+}
+
+
+proc sql_date { datetime } {
+	return [clock format $datetime -format "%Y-%m-%d %H:%M:%S"]
+}
+
+
+proc submit_ports {} {
+	global prefix submit_options verbose
+
+	if {[catch {set res [dportsearch "^.*\$"]} result]} {
+		puts "port search failed: $result"
+		exit 1
+	}
+	
+	foreach {name array} $res {
+		array unset portinfo
+		array set portinfo $array
+	
+		if {![info exists portinfo(porturl)]} {
+			puts stderr "Internal error: no porturl for $name"
+			continue
+		}
+		
+		set porturl $portinfo(porturl)
+		if { 0 != [regexp {file://(.*)} $porturl match path] } {
+			set portdir [file normalize $path]
+		} else {
+			set portdir [file normalize [darwinports::getportdir $porturl]]
+		}
+		set portfile "${portdir}/Portfile"
+		if { $verbose } { puts "checking ${name}" }
+	
+		if {[file readable $portfile]} {
+			set mod_date [sql_date [file mtime $portfile]]
+			set cur_date [sql_date [clock seconds]]
+			
+			set post ""
+			set none 1
+			db eval { select * from submitinfo where porturl=$porturl } values {
+				set none 0
+				
+				if { $values(last_mod_date) == "" || $values(last_mod_date) != $mod_date } {
+				
+					# The last_mod_date has changed, so just update it to provide
+					# hysteresis for file changes
+					if { $verbose } { puts "    update ${name} mod date to $mod_date" }
+					set post { update submitinfo set last_mod_date=$mod_date where porturl=$porturl }				
+				
+				} elseif { $values(submitted_mod_date) != $mod_date } {
+				
+					# last_mod_date is correct and stable, but has not yet been submitted
+					# so let's submit it
+	
+					# Open the port
+					set err 0
+					if {[catch {set workername [dportopen $porturl [array get submit_options]]} result]} {
+						global errorInfo
+						ui_debug "$errorInfo"
+						puts "Unable to open port: $result"
+						set err 1
+					}
+	
+					# Submit the port
+					if { !$err && [catch {set result [dportexec $workername submit]} result]} {
+						global errorInfo
+						ui_debug "$errorInfo"
+						puts "Unable to execute port: $result"
+						set err 1
+					}
+			
+					# Close the port
+					dportclose $workername
+					
+					# Update the date in the database for this item
+					if { !$err && !$result } {
+						set post { update submitinfo set submitted_mod_date=$mod_date, submit_date=$cur_date where porturl=$porturl }
+					}
+				} else {
+				
+					# The port has already been submitted
+					if { $verbose } { puts "   submission up to date as of $values(submit_date)" }
+				}
+				
+			}
+			
+			if { $none } {
+				# No record yet, so just create a record for this port
+				# Do nothing else yet to provide hysteresis for file changes
+				if { $verbose } { puts "    set ${name} mod date to $mod_date" }
+				set post { insert into submitinfo (porturl,portname,last_mod_date) values ($porturl, $name, $mod_date) }				
+			}
+			
+			# Do update or insert post processing
+			if { $post != "" } {
+				db eval $post
+			}
+		}
+		
+	}
+}
+
+
+# Globals
+set SUBMITTER_NAME "autosubmit"
+set SUBMITTER_EMAIL "autosubmit at macports.org"
+array set submit_options "submitter_name $SUBMITTER_NAME submitter_email $SUBMITTER_EMAIL"
+
+global darwinports::autoconf::macports_user_dir
+set db_file [file normalize "${darwinports::autoconf::macports_user_dir}/autosubmit.db"]
+
+# Do argument processing
+set verbose 0
+if { [lsearch $argv -v] >= 0 } {
+	set verbose 1
+}
+
+# Initialize dports api
+dportinit
+
+# Submit ports
+puts "Using database at $db_file"
+open_db $db_file
+submit_ports
+close_db

Deleted: branches/release_1_4/base/portmgr/dprsyncup
===================================================================
--- branches/release_1_4/base/portmgr/dprsyncup	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/portmgr/dprsyncup	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1,30 +0,0 @@
-#!/bin/sh
-# fkr, jberry, yeled
-# checks out both HEAD and then the CVS Tag specified in $RELEASE_TAG_FILE
-# made for dulcinea 2005-12-06
-# TODO should clean up after itself.
-# TODO shouldn't refer to the Tag as "dp1.0"
-
-DPROOT="/Volumes/bigsrc/darwinports"
-RELEASE_TAG_FILE="base/config/RELEASE_TAG"
-
-# Check out HEAD
-export HOME=/var/root
-TMPDIR=dp
-cd ${DPROOT} ; cvs -q -R -d /cvs/od co -P -d ${TMPDIR}.tmp darwinports
-rsync -q --exclude=.cvsignore --exclude=CVS -a --delete ${DPROOT}/${TMPDIR}.tmp/ ${DPROOT}/${TMPDIR}/
-#rsync --dry-run --exclude=.cvsignore --exclude=CVS -a --delete ${DPROOT}/${TMPDIR}.tmp/ ${DPROOT}/${TMPDIR}/
-echo `date -u +%s` > ${DPROOT}/${TMPDIR}/TIMESTAMP
-
-# Extract the release tag from HEAD
-read RELEASE_TAG < ${DPROOT}/${TMPDIR}/${RELEASE_TAG_FILE}
-[ -n "${RELEASE_TAG}" ] || ( echo "no RELEASE_TAG specified in cvs HEAD" ; exit 1 )
-
-# Checkout from the release tag specified in HEAD
-export HOME=/var/root
-TMPDIR=dp1.0
-cd ${DPROOT} ; cvs -q -R -d /cvs/od co -r ${RELEASE_TAG} -P -d ${TMPDIR}.tmp darwinports
-rsync -q --exclude=.cvsignore --exclude=CVS -a --delete ${DPROOT}/${TMPDIR}.tmp/ ${DPROOT}/${TMPDIR}/
-#rsync --dry-run --exclude=.cvsignore --exclude=CVS -a --delete ${DPROOT}/${TMPDIR}.tmp/ ${DPROOT}/${TMPDIR}/
-echo `date -u +%s` > ${DPROOT}/${TMPDIR}/TIMESTAMP
-

Modified: branches/release_1_4/base/src/darwinports1.0/darwinports.tcl
===================================================================
--- branches/release_1_4/base/src/darwinports1.0/darwinports.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/darwinports1.0/darwinports.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -41,13 +41,15 @@
     	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 xcodeversion xcodebuildcmd"
+    	rsync_dir startupitem_type xcodeversion xcodebuildcmd \
+    	mp_remote_url mp_remote_submit_url"
     variable user_options "submitter_name submitter_email submitter_key"
     variable portinterp_options "\
-    	portdbpath portpath portbuildpath auto_path prefix portsharepath \
+    	portdbpath 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 \
+    	mp_remote_url mp_remote_submit_url \
     	$user_options"
     
     # deferred options are only computed when needed.
@@ -70,27 +72,37 @@
 # ui_prefix returns the prefix for the messages, if any.
 # ui_channels returns a list of channels to output the message to, empty for
 #     no message.
+# if these functions are not provided, defaults are used, but this should
+# not be relied upon for production code
 
 proc darwinports::ui_init {priority message} {
 	# Get the list of channels.
-	set channels [ui_channels $priority]
+	if {[llength [info commands ui_channels]] > 0} {
+		set channels [ui_channels $priority]
+	} else {
+	    set channels [ui_channels_default $priority]
+	}
 
 	# Simplify ui_$priority.
 	set nbchans [llength $channels]
 	if {$nbchans == 0} {
-		eval "proc ::ui_$priority {str} {}"
+		proc ::ui_$priority {str} {}
 	} else {
-		set prefix [ui_prefix $priority]
+		if {[llength [info commands ui_prefix]] > 0} {
+			set prefix [ui_prefix $priority]
+		} else {
+		    set prefix [ui_prefix_default $priority]
+		}
 
 		if {$nbchans == 1} {
 			set chan [lindex $channels 0]
-			eval "proc ::ui_$priority {str} \{ puts $chan \"$prefix\$str\" \}"
+			proc ::ui_$priority {str} [subst { puts $chan "$prefix\$str" }]
 		} else {
-			eval "proc ::ui_$priority {str} \{ \n\
-				foreach chan $channels \{ \n\
-					puts $chan \"$prefix\$str\" \n\
-				\} \n\
-			\}"
+			proc ::ui_$priority {str} [subst {
+				foreach chan \$channels {
+					puts $chan "$prefix\$str"
+				}
+			}]
 		}
 
 		# Call ui_$priority
@@ -98,8 +110,45 @@
 	}
 }
 
+# Defult implementation of ui_prefix
+proc darwinports::ui_prefix_default {priority} {
+	switch $priority {
+		debug {
+			return "DEBUG: "
+		}
+		error {
+			return "Error: "
+		}
+		warn {
+			return "Warning: "
+		}
+		default {
+			return ""
+		} 
+	}
+}
+
+# Default implementation of ui_channels
+proc darwinports::ui_channels_default {priority} {
+    switch $priority {
+        debug -
+        info {
+            return {}
+        }
+        msg {
+            return {stdout}
+        }
+        error {
+            return {stderr}
+        }
+        default {
+            return {stdout}
+        }
+    }
+}
+
 foreach priority ${darwinports::ui_priorities} {
-    eval "proc ui_$priority {str} \{ darwinports::ui_init $priority \$str \}"
+    proc ui_$priority {str} [subst { darwinports::ui_init $priority \$str }]
 }
 
 # Replace puts to catch errors (typically broken pipes when being piped to head)
@@ -175,13 +224,26 @@
 	}
 }
 
-proc dportinit {up_ui_options up_options up_variations} {
-	upvar  $up_ui_options ui_options
-	upvar  $up_options	  options
-	upvar  $up_variations variations
+proc dportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
+	if {$up_ui_options eq ""} {
+		array set ui_options {}
+	} else {
+		upvar $up_ui_options ui_options
+	}
+	if {$up_options eq ""} {
+		array set options {}
+	} else {
+		upvar $up_options options
+	}
+	if {$up_variations eq ""} {
+		array set $up_variations {}
+	} else {
+		upvar $up_variations variations
+	}
 	
 	global auto_path env
 	global darwinports::autoconf::dports_conf_path
+	global darwinports::autoconf::macports_user_dir
 	global darwinports::bootstrap_options
 	global darwinports::user_options
 	global darwinports::extra_env
@@ -196,6 +258,7 @@
    	global darwinports::destroot_umask
    	global darwinports::libpath
    	global darwinports::prefix
+   	global darwinports::prefix_frozen
    	global darwinports::registry.installtype
    	global darwinports::rsync_dir
    	global darwinports::rsync_options
@@ -204,13 +267,16 @@
    	global darwinports::xcodebuildcmd
    	global darwinports::xcodeversion
    	
+    # Ensure that the macports user directory exists
+    file mkdir $macports_user_dir
+    
    	# Configure the search path for configuration files
    	set conf_files ""
     if {[llength [array names env PORTSRC]] > 0} {
 		set PORTSRC [lindex [array get env PORTSRC] 1]
 		lappend conf_files ${PORTSRC}
     }
-    lappend conf_files "~/.macports/ports.conf" "${dports_conf_path}/ports.conf"
+    lappend conf_files "${macports_user_dir}/ports.conf" "${dports_conf_path}/ports.conf"
     
     # Process the first configuration file we find on conf_files list
 	foreach file $conf_files {
@@ -235,7 +301,7 @@
 	}
 	
 	# Process per-user only settings
-	set per_user "~/.macports/user.conf"
+	set per_user "${macports_user_dir}/user.conf"
 	if [file exists $per_user] {
 		set fd [open $per_user r]
 		while {[gets $fd line] >= 0} {
@@ -249,7 +315,7 @@
 	}
 	
     if {![info exists sources_conf]} {
-        return -code error "sources_conf must be set in $dports_conf_path/ports.conf or in your ~/.portsrc"
+        return -code error "sources_conf must be set in $dports_conf_path/ports.conf or in $macports_user_dir/ports.conf"
     }
     if {[catch {set fd [open $sources_conf r]} result]} {
         return -code error "$result"
@@ -293,7 +359,7 @@
 	}
 
     if {![info exists portdbpath]} {
-	return -code error "portdbpath must be set in $dports_conf_path/ports.conf or in your ~/.portsrc"
+	return -code error "portdbpath must be set in $dports_conf_path/ports.conf or in your $macports_user_dir/ports.conf"
     }
     if {![file isdirectory $portdbpath]} {
 	if {![file exists $portdbpath]} {
@@ -358,6 +424,10 @@
 		}
 	}
 
+    # Duplicate prefix into prefix_frozen, to that port actions
+    # can always get to the original prefix, even if a portfile overrides prefix
+    set darwinports::prefix_frozen $prefix
+    
 	# Export verbosity.
 	if {![info exists portverbose]} {
 		set darwinports::portverbose "no"
@@ -439,6 +509,16 @@
     	global darwinports::startupitem_type
     }
     
+    # Default mp remote options
+    if {![info exists mp_remote_url]} {
+    	set darwinports::mp_remote_url "http://db.macports.org"
+    	global darwinports::mp_remote_url
+    }
+    if {![info exists mp_remote_submit_url]} {
+    	set darwinports::mp_remote_submit_url "${darwinports::mp_remote_url}/submit"
+    	global darwinports::mp_remote_submit_url
+    }
+    
     # ENV cleanup.
 	set keepenvkeys { DISPLAY DYLD_FALLBACK_FRAMEWORK_PATH
 	                  DYLD_FALLBACK_LIBRARY_PATH DYLD_FRAMEWORK_PATH

Modified: branches/release_1_4/base/src/darwinports1.0/darwinports_autoconf.tcl.in
===================================================================
--- branches/release_1_4/base/src/darwinports1.0/darwinports_autoconf.tcl.in	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/darwinports1.0/darwinports_autoconf.tcl.in	2007-05-08 03:53:32 UTC (rev 24908)
@@ -32,5 +32,7 @@
 
 namespace eval darwinports::autoconf {
 	variable dports_conf_path "@PORTCONFIGDIR_EXPANDED@"
+	variable macports_user_dir "~/.macports"
 	variable rsync_path "@RSYNC@"
+	variable open_path "@OPEN@"
 }

Modified: branches/release_1_4/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/release_1_4/base/src/package1.0/portunarchive.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/package1.0/portunarchive.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -152,6 +152,7 @@
 	global unarchive.env unarchive.cmd
 	global unarchive.pre_args unarchive.args unarchive.post_args
 	global unarchive.type unarchive.path
+	global unarchive.pipe_cmd
 	global os.platform os.version env
 
 	# Define appropriate unarchive command and options
@@ -160,6 +161,7 @@
 	set unarchive.pre_args {}
 	set unarchive.args {}
 	set unarchive.post_args {}
+	set unarchive.pipe_cmd ""
 	switch -regex ${unarchive.type} {
 		cp(io|gz) {
 			set pax "pax"
@@ -176,7 +178,7 @@
 					set gzip "gzip"
 					if {[catch {set gzip [binaryInPath $gzip]} errmsg] == 0} {
 						ui_debug "Using $gzip"
-						set unarchive.env "$gzip -d -c ${unarchive.path} |"
+						set unarchive.pipe_cmd "$gzip -d -c ${unarchive.path} |"
 					} else {
 						ui_debug $errmsg
 						return -code error "No '$gzip' was found on this system!"
@@ -195,16 +197,16 @@
 				ui_debug "Using $tar"
 				set unarchive.cmd "$tar"
 				set unarchive.pre_args {-xvpf}
-				if {[regexp {z$} ${unarchive.type}]} {
+				if {[regexp {z2?$} ${unarchive.type}]} {
 					set unarchive.args {-}
-					if {[regexp {bz$} ${unarchive.type}]} {
+					if {[regexp {bz2?$} ${unarchive.type}]} {
 						set gzip "bzip2"
 					} else {
 						set gzip "gzip"
 					}
 					if {[catch {set gzip [binaryInPath $gzip]} errmsg] == 0} {
 						ui_debug "Using $gzip"
-						set unarchive.env "$gzip -d -c ${unarchive.path} |"
+						set unarchive.pipe_cmd "$gzip -d -c ${unarchive.path} |"
 					} else {
 						ui_debug $errmsg
 						return -code error "No '$gzip' was found on this system!"
@@ -256,7 +258,7 @@
 proc unarchive_main {args} {
 	global UI_PREFIX
 	global portname portversion portrevision portvariants
-	global unarchive.dir unarchive.file
+	global unarchive.dir unarchive.file unarchive.pipe_cmd
 
 	# Setup unarchive command
 	unarchive_command_setup
@@ -268,66 +270,25 @@
 
 	# Unpack the archive
 	ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] ${unarchive.file}]"
-	command_exec unarchive
-
-	return 0
-}
-
-proc unarchive_finish {args} {
-	global UI_PREFIX target_state_fd unarchive.file portname workpath destpath
-
-	# Reset state file with archive version
-    set statefile [file join $workpath .darwinports.${portname}.state]
-	file copy -force [file join $destpath "+STATE"] $statefile
-	exec touch $statefile
-
-    # Update the state from unpacked archive version
-    set target_state_fd [open_statefile]
-
-	# Archive unpacked, skip archive target
-	write_statefile target "com.apple.archive" $target_state_fd
-    
-	# Cleanup all control files when finished
-	set control_files [glob -nocomplain -types f [file join $destpath +*]]
-	foreach file $control_files {
-		ui_debug "Removing $file"
-		file delete -force $file
+	if {${unarchive.pipe_cmd} == ""} {
+		command_exec unarchive
+	} else {
+		command_exec unarchive "${unarchive.pipe_cmd} (" ")"
 	}
 
-	ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s unpacked"] ${unarchive.file}]"
 	return 0
 }
 
-proc unarchive_main {args} {
-	global UI_PREFIX
-	global portname portversion portrevision portvariants
-	global unarchive.dir unarchive.file
-
-	# Setup unarchive command
-	unarchive_command_setup
-
-	# Create destination directory for unpacking
-	if {![file isdirectory ${unarchive.dir}]} {
-		file mkdir ${unarchive.dir}
-	}
-
-	# Unpack the archive
-	ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] ${unarchive.file}]"
-	command_exec unarchive
-
-	return 0
-}
-
 proc unarchive_finish {args} {
 	global UI_PREFIX target_state_fd unarchive.file portname workpath destpath
 
 	# Reset state file with archive version
-    set statefile [file join $workpath .darwinports.${portname}.state]
+	set statefile [file join $workpath .darwinports.${portname}.state]
 	file copy -force [file join $destpath "+STATE"] $statefile
 	exec touch $statefile
 
-    # Update the state from unpacked archive version
-    set target_state_fd [open_statefile]
+	# Update the state from unpacked archive version
+	set target_state_fd [open_statefile]
 
 	# Archive unpacked, skip archive target
 	write_statefile target "com.apple.archive" $target_state_fd
@@ -342,4 +303,3 @@
 	ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s unpacked"] ${unarchive.file}]"
 	return 0
 }
-

Modified: branches/release_1_4/base/src/pextlib1.0/Makefile
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/Makefile	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/Makefile	2007-05-08 03:53:32 UTC (rev 24908)
@@ -15,4 +15,5 @@
 	${TCLSH} tests/checksums.tcl ${SHLIB_NAME}
 	${TCLSH} tests/filemap.tcl ${SHLIB_NAME}
 	${TCLSH} tests/fifo.tcl ${SHLIB_NAME}
+	${TCLSH} tests/fs-traverse.tcl ${SHLIB_NAME}
 	${TCLSH} tests/socketpair.tcl ${SHLIB_NAME}

Modified: branches/release_1_4/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/Pextlib.c	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/Pextlib.c	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1094,6 +1094,30 @@
 	return TCL_OK;
 }
 
+/**
+ * symlink value target
+ * Create a symbolic link at target pointing to value
+ * See symlink(2) for possible errors
+ */
+int CreateSymlinkCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+{
+    char *value, *target;
+    
+    if (objc != 3) {
+        Tcl_WrongNumArgs(interp, 1, objv, "value target");
+        return TCL_ERROR;
+    }
+    
+    value = Tcl_GetString(objv[1]);
+    target = Tcl_GetString(objv[2]);
+    
+    if (symlink(value, target) != 0) {
+        Tcl_SetResult(interp, (char *)Tcl_PosixError(interp), TCL_STATIC);
+        return TCL_ERROR;
+    }
+    return TCL_OK;
+}
+
 int Pextlib_Init(Tcl_Interp *interp)
 {
 	if (Tcl_InitStubs(interp, "8.3", 0) == NULL)
@@ -1124,6 +1148,7 @@
 	Tcl_CreateObjCommand(interp, "mkchannelfromfd", MkChannelFromFdCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "pipe", PipeCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "curl", CurlCmd, NULL, NULL);
+    Tcl_CreateObjCommand(interp, "symlink", CreateSymlinkCmd, NULL, NULL);
 	
 	Tcl_CreateObjCommand(interp, "readline", ReadlineCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "rl_history", RLHistoryCmd, NULL, NULL);

Modified: branches/release_1_4/base/src/pextlib1.0/fs-traverse.c
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/fs-traverse.c	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/fs-traverse.c	2007-05-08 03:53:32 UTC (rev 24908)
@@ -49,9 +49,8 @@
 #include <sys/stat.h>
 #endif
 
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
+#include <fts.h>
+#include <errno.h>
 
 #if HAVE_LIMITS_H
 #include <limits.h>
@@ -59,132 +58,151 @@
 
 #include <tcl.h>
 
-static int do_traverse(Tcl_Interp *interp, int flags, char *target, char *varname, char *body);
+static int do_traverse(Tcl_Interp *interp, int flags, char * CONST *targets, Tcl_Obj *varname, Tcl_Obj *body);
 
 #define F_DEPTH 0x1
 #define F_IGNORE_ERRORS 0x2
 
-/* fs-traverse ?-depth? ?-ignoreErrors? varname target ?target ...? body */
+/* fs-traverse ?-depth? ?-ignoreErrors? ?--? varname target-list body */
 int
 FsTraverseCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
-    char *varname;
-    char *body;
+    Tcl_Obj *varname;
+    Tcl_Obj *body;
     int flags = 0;
     int rval = TCL_OK;
+    Tcl_Obj *listPtr;
     Tcl_Obj *CONST *objv_orig = objv;
+    int lobjc;
+    Tcl_Obj **lobjv;
 
-    /* Adjust arguments to remove initial `find' */
+    /* Adjust arguments to remove command name */
     ++objv, --objc;
 
     /* Parse flags */
     while (objc) {
-        if (!strcmp(Tcl_GetString(*objv), "-depth")) {
+        char *arg = Tcl_GetString(*objv);
+        if (!strcmp(arg, "-depth")) {
             flags |= F_DEPTH;
             ++objv, --objc;
             continue;
         }
-        if (!strcmp(Tcl_GetString(*objv), "-ignoreErrors")) {
+        if (!strcmp(arg, "-ignoreErrors")) {
             flags |= F_IGNORE_ERRORS;
             ++objv, --objc;
             continue;
         }
+        if (!strcmp(arg, "--")) {
+            ++objv, --objc;
+            break;
+        }
         break;
     }
     
     /* Parse remaining args */
-    if (objc < 3) {
-        Tcl_WrongNumArgs(interp, 1, objv_orig, "?-depth? ?-ignoreErrors? varname target ?target target ...? body");
+    if (objc != 3) {
+        Tcl_WrongNumArgs(interp, 1, objv_orig, "?-depth? ?-ignoreErrors? ?--? varname target-list body");
         return TCL_ERROR;
     }
     
-    varname = Tcl_GetString(*objv);
+    varname = *objv;
     ++objv, --objc;
     
-    body = Tcl_GetString(objv[objc-1]);
-    --objc;
+    listPtr = *objv;
+    ++objv, --objc;
     
-    while (objc) {
-        char *target = Tcl_GetString(*objv);
-        ++objv, --objc;
-        
-        if ((rval = do_traverse(interp, flags, target, varname, body)) == TCL_CONTINUE) {
-            rval = TCL_OK;
-            continue;
-        } else if (rval == TCL_BREAK) {
-            rval = TCL_OK;
-            break;
-        } else if (rval != TCL_OK) {
-            break;
+    body = *objv;
+    
+    if ((rval = Tcl_ListObjGetElements(interp, listPtr, &lobjc, &lobjv)) == TCL_OK) {
+        char **entries = calloc(objc, sizeof(char *));
+        char **iter = (char **)entries;
+        while (lobjc) {
+            *iter++ = Tcl_GetString(*lobjv);
+            --lobjc, ++lobjv;
         }
+        rval = do_traverse(interp, flags, entries, varname, body);
+        free(entries);
     }
     return rval;
 }
 
 static int
-do_traverse(Tcl_Interp *interp, int flags, char *target, char *varname, char *body)
+do_traverse(Tcl_Interp *interp, int flags, char * CONST *targets, Tcl_Obj *varname, Tcl_Obj *body)
 {
-    DIR *dirp;
-    struct dirent *dp;
     int rval = TCL_OK;
-    struct stat sb;
+    FTS *root_fts;
+    FTSENT *ent;
     
-    /* No permission? */
-    if (lstat(target, &sb) != 0) {
-        if (flags & F_IGNORE_ERRORS) {
-            return TCL_OK;
-        } else {
-            Tcl_ResetResult(interp);
-            Tcl_AppendResult(interp, "Error: no permission to access file/folder `", target, "'");
-            return TCL_ERROR;
-        }
-    }
+    root_fts = fts_open(targets, FTS_PHYSICAL | FTS_COMFOLLOW | FTS_NOCHDIR | FTS_XDEV, NULL);
     
-    /* Handle files now, or directories if !depth */
-    if (!(flags & F_DEPTH) || !(sb.st_mode & S_IFDIR)) {
-        Tcl_SetVar(interp, varname, target, 0);
-        if ((rval = Tcl_EvalEx(interp, body, -1, 0)) != TCL_OK) {
-            return rval;
-        }
-    }
-    
-    /* Handle directories */
-    if (sb.st_mode & S_IFDIR) {
-        if ((dirp = opendir(target)) == NULL) {
-            if (flags & F_IGNORE_ERRORS) {
-                return TCL_OK;
-            } else {
-                Tcl_ResetResult(interp);
-                Tcl_AppendResult(interp, "Error: Could not open directory `", target, "'");
-                return TCL_ERROR;
-            }
-        }
-        
-        while ((dp = readdir(dirp)) != NULL) {
-            char tmp_path[PATH_MAX];
-
-            if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
-                continue;
-            strcpy(tmp_path, target);
-            strcat(tmp_path, "/");
-            strcat(tmp_path, dp->d_name);
-
-            if ((rval = do_traverse(interp, flags, tmp_path, varname, body)) == TCL_CONTINUE) {
-                rval = TCL_OK;
-                continue;
-            } else if (rval != TCL_OK) {
+    while ((ent = fts_read(root_fts)) != NULL) {
+        switch (ent->fts_info) {
+            case FTS_D:  /* directory in pre-order */
+            case FTS_DP: /* directory in post-order*/
+            {
+                if (!(flags & F_DEPTH) != !(ent->fts_info == FTS_D)) {
+                    Tcl_Obj *rpath, *path = Tcl_NewStringObj(ent->fts_path, ent->fts_pathlen);
+                    Tcl_IncrRefCount(path);
+                    rpath = Tcl_ObjSetVar2(interp, varname, NULL, path, TCL_LEAVE_ERR_MSG);
+                    Tcl_DecrRefCount(path);
+                    if (rpath == NULL && !(flags & F_IGNORE_ERRORS)) {
+                        fts_close(root_fts);
+                        return TCL_ERROR;
+                    }
+                    if ((rval = Tcl_EvalObjEx(interp, body, 0)) == TCL_CONTINUE) {
+                        fts_set(root_fts, ent, FTS_SKIP);
+                    } else if (rval == TCL_BREAK) {
+                        fts_close(root_fts);
+                        return TCL_OK;
+                    } else if (rval != TCL_OK) {
+                        fts_close(root_fts);
+                        return rval;
+                    }
+                }
                 break;
             }
-        }
-        (void)closedir(dirp);
-        
-        /* Handle directory now if depth */
-        if (flags & F_DEPTH) {
-            Tcl_SetVar(interp, varname, target, 0);
-            if ((rval = Tcl_EvalEx(interp, body, -1, 0)) != TCL_OK) {
-                return rval;
+            case FTS_F:   /* regular file */
+            case FTS_SL:  /* symbolic link */
+            case FTS_SLNONE: /* symbolic link with non-existant target */
+            case FTS_DEFAULT: /* file type not otherwise handled (e.g., fifo) */
+            {
+                Tcl_Obj *rpath, *path = Tcl_NewStringObj(ent->fts_path, ent->fts_pathlen);
+                Tcl_IncrRefCount(path);
+                rpath = Tcl_ObjSetVar2(interp, varname, NULL, path, TCL_LEAVE_ERR_MSG);
+                Tcl_DecrRefCount(path);
+                if (rpath == NULL && !(flags & F_IGNORE_ERRORS)) {
+                    fts_close(root_fts);
+                    return TCL_ERROR;
+                }
+                if ((rval = Tcl_EvalObjEx(interp, body, 0)) == TCL_CONTINUE) {
+                    fts_set(root_fts, ent, FTS_SKIP); /* probably useless on files/symlinks */
+                } else if (rval == TCL_BREAK) {
+                    fts_close(root_fts);
+                    return TCL_OK;
+                } else if (rval != TCL_OK) {
+                    fts_close(root_fts);
+                    return rval;
+                }
             }
+            case FTS_DC:  /* directory that causes a cycle */
+                break;    /* ignore it */
+            case FTS_DNR: /* directory that cannot be read */
+            case FTS_ERR: /* error return */
+            case FTS_NS:  /* file with no stat(2) information */
+            {
+                if (!(flags & F_IGNORE_ERRORS)) {
+                    Tcl_SetErrno(ent->fts_errno);
+                    Tcl_SetResult(interp, (char *)Tcl_PosixError(interp),  TCL_STATIC);
+                    fts_close(root_fts);
+                    return TCL_ERROR;
+                }
+            }
         }
     }
-    return rval;
+    /* check errno before calling fts_close in case it sets errno to 0 on success */
+    if (errno != 0 || (fts_close(root_fts) != 0 && !(flags & F_IGNORE_ERRORS))) {
+        Tcl_SetResult(interp, (char *)Tcl_PosixError(interp), TCL_STATIC);
+        return TCL_ERROR;
+    }
+    return TCL_OK;
 }

Modified: branches/release_1_4/base/src/pextlib1.0/tests/checksums.tcl
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/tests/checksums.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/tests/checksums.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -6,7 +6,7 @@
 proc main {pextlibname} {
 	load $pextlibname
 	
-	set testfile "/tmp/darwinports-pextlib-testchecksums"
+	set testfile "/tmp/macports-pextlib-testchecksums"
 	file delete -force $testfile
 
 	# create a dummy file.

Modified: branches/release_1_4/base/src/pextlib1.0/tests/curl.tcl
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/tests/curl.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/tests/curl.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -5,7 +5,7 @@
 proc main {pextlibname} {
 	load $pextlibname
 
-	set tempfile /tmp/darwinports-pextlib-testcurl
+	set tempfile /tmp/macports-pextlib-testcurl
 
 	# download a dummy file over HTTP.
 	curl fetch http://www.opendarwin.org/~pguyot/kilroy $tempfile

Modified: branches/release_1_4/base/src/pextlib1.0/tests/fifo.tcl
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/tests/fifo.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/tests/fifo.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -6,7 +6,7 @@
 proc main {pextlibname} {
 	load $pextlibname
 	
-	set fifo_path "/tmp/darwinports-pextlib-fifo"
+	set fifo_path "/tmp/macports-pextlib-fifo"
 	
 	file delete -force $fifo_path
 
@@ -27,7 +27,7 @@
 
 	file delete -force $fifo_path
 	
-	set fifo_path "/tmp/darwinports-pextlib-fifo-dummydir/foo"
+	set fifo_path "/tmp/macports-pextlib-fifo-dummydir/foo"
 
 	# Test that mkfifo returns an error if the directory doesn't exist.
 	if {![catch {mkfifo $fifo_path}]} {

Modified: branches/release_1_4/base/src/pextlib1.0/tests/filemap.tcl
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/tests/filemap.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/pextlib1.0/tests/filemap.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -6,9 +6,9 @@
 proc main {pextlibname} {
 	load $pextlibname
 	
-	file delete -force "/tmp/darwinports-pextlib-testmap"
+	file delete -force "/tmp/macports-pextlib-testmap"
 
-	filemap open testmap "/tmp/darwinports-pextlib-testmap"
+	filemap open testmap "/tmp/macports-pextlib-testmap"
 	if {[filemap exists testmap "/foo/bar"]} {
 		puts {[filemap exists testmap "/foo/bar"]}
 		exit 1
@@ -87,7 +87,7 @@
 
 	filemap close testmap
 
-	filemap open testmap2 "/tmp/darwinports-pextlib-testmap"
+	filemap open testmap2 "/tmp/macports-pextlib-testmap"
 	if {[filemap exists testmap2 "/foo/foobar"]} {
 		puts {[filemap exists testmap2 "/foo/foobar"]}
 		exit 1
@@ -164,10 +164,10 @@
 	filemap close testmap2
 
 	# open it again, r/o
-	filemap open testmap3 "/tmp/darwinports-pextlib-testmap" readonly
+	filemap open testmap3 "/tmp/macports-pextlib-testmap" readonly
 
 	# open it again, r/w
-	filemap open testmap4 "/tmp/darwinports-pextlib-testmap"
+	filemap open testmap4 "/tmp/macports-pextlib-testmap"
 	
 	# put a key (r/w copy)
 	filemap set testmap4 "/rw/foobar" "foobar"
@@ -196,27 +196,27 @@
 	filemap close testmap3
 
 	# concurrency bug test
-	filemap open testmap7 "/tmp/darwinports-pextlib-testmap"
+	filemap open testmap7 "/tmp/macports-pextlib-testmap"
 	filemap set testmap7 "/rw/foobar" "foobar"
 	filemap save testmap7
 	filemap close testmap7
-	filemap open testmap6 "/tmp/darwinports-pextlib-testmap" readonly
-	filemap open testmap8 "/tmp/darwinports-pextlib-testmap"
+	filemap open testmap6 "/tmp/macports-pextlib-testmap" readonly
+	filemap open testmap8 "/tmp/macports-pextlib-testmap"
 	filemap unset testmap8 "/rw/foobar"
 	filemap save testmap8
 	filemap close testmap8
 	filemap close testmap6
-	filemap open testmap9 "/tmp/darwinports-pextlib-testmap" readonly
+	filemap open testmap9 "/tmp/macports-pextlib-testmap" readonly
 	if {[filemap exists testmap9 "/rw/foobar"]} {
 		puts {[filemap exists testmap9 "/rw/foobar"]}
 		exit 1
 	}
 	filemap close testmap9
 
-	file delete -force "/tmp/darwinports-pextlib-testmap"
+	file delete -force "/tmp/macports-pextlib-testmap"
 
 	# delete the lock file as well.
-	file delete -force "/tmp/darwinports-pextlib-testmap.lock"
+	file delete -force "/tmp/macports-pextlib-testmap.lock"
 	
 	# create a RAM-based map.
 	filemap create testmap5

Copied: branches/release_1_4/base/src/pextlib1.0/tests/fs-traverse.tcl (from rev 24905, trunk/base/src/pextlib1.0/tests/fs-traverse.tcl)
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/tests/fs-traverse.tcl	                        (rev 0)
+++ branches/release_1_4/base/src/pextlib1.0/tests/fs-traverse.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -0,0 +1,336 @@
+# Test file for Pextlib's fs-traverse
+# Requires r/w access to /tmp
+# Syntax:
+# tclsh fs-traverse.tcl <Pextlib name>
+
+proc main {pextlibname} {
+    global trees errorInfo
+    
+    load $pextlibname
+    
+    set root "/tmp/macports-pextlib-fs-traverse"
+    
+    file delete -force $root
+    
+    setup_trees $root
+    
+    # make the directory root structure
+    make_root
+    
+    # perform tests
+    set result [catch {
+        # Basic fs-traverse test
+        set output [list]
+        fs-traverse file $root {
+            lappend output $file
+        }
+        check_output $output $trees(1)
+        
+        # Test starting with a symlink
+        set output [list]
+        fs-traverse file $root/a/c/a {
+            lappend output $file
+        }
+        check_output $output $trees(sub1)
+        
+        # Test -depth
+        set output [list]
+        fs-traverse -depth file $root {
+            lappend output $file
+        }
+        check_output $output $trees(2)
+        
+        # Test multiple sources
+        set output [list]
+        fs-traverse file [list $root/a $root/b] {
+            lappend output $file
+        }
+        check_output $output $trees(3)
+        
+        # Test multiple sources with -depth
+        set output [list]
+        fs-traverse -depth file [list $root/a $root/b] {
+            lappend output $file
+        }
+        check_output $output $trees(4)
+        
+        # Error raised for traversing directory that does not exist
+        if {![catch {fs-traverse file $root/does_not_exist {}}]} {
+            error "fs-traverse did not raise an error for a missing directory"
+        }
+        
+        # Test -ignoreErrors
+        if {[catch {fs-traverse -ignoreErrors file $root/does_not_exist {}}]} {
+            error "fs-traverse raised an error despite -ignoreErrors"
+        }
+        
+        # Test -ignoreErrors with multiple sources, make sure it still gets the sources after the error
+        if {[catch {
+            set output [list]
+            fs-traverse -depth -ignoreErrors file [list $root/a $root/c $root/b] {
+                lappend output $file
+            }
+            check_output $output $trees(4)
+        }]} {
+            error "fs-traverse raised an error despite -ignoreErrors"
+        }
+        
+        # Test skipping parts of the tree
+        set output [list]
+        fs-traverse file $root {
+            if {[string match */a $file]} {
+                continue
+            }
+            lappend output $file
+        }
+        check_output $output $trees(5)
+        
+        # Test cutting the traversal short
+        set output [list]
+        fs-traverse file $root {
+            lappend output $file
+            if {[file type $file] eq "link"} {
+                break
+            }
+        }
+        
+        # Test using an array variable as varname
+        # It should error out
+        if {![catch {
+            array set aryvar {}
+            fs-traverse aryvar $root {}
+        }]} {
+            error "fs-traverse did not error when setting the variable"
+        }
+        
+        # Same test with -ignoreErrors
+        if {[catch {
+            array set aryvar {}
+            fs-traverse -ignoreErrors aryvar $root {}
+        }]} {
+            error "fs-traverse errored out when setting the variable despite -ignoreErrors"
+        }
+        
+        # Test using a malformed target list
+        if {![catch {fs-traverse file "$root/a \{$root/b" {}}]} {
+            error "fs-traverse did not error with malformed target list"
+        }
+        
+        # Test again with -ignoreErrors - this is the one case where it should still error
+        if {![catch {fs-traverse -ignoreErrors file "$root/a \{$root/b" {}}]} {
+            error "fs-traverse did not error with malformed target list using -ignoreErrors"
+        }
+        
+        # Test wacky variable name called -depth
+        set output [list]
+        fs-traverse -- -depth $root {
+            lappend output ${-depth}
+        }
+        check_output $output $trees(1)
+        
+        # NOTE: This should be the last test performed, as it modifies the file tree
+        # Test to make sure deleting files during traversal works as expected
+        set output [list]
+        fs-traverse file $root {
+            if {[string match */a $file]} {
+                # use /bin/rm because on 10.3 file delete doesn't work on directories properly
+                exec /bin/rm -rf $file
+                continue
+            }
+            lappend output $file
+        }
+        check_output $output $trees(5)
+    } errMsg]
+    set savedInfo $errorInfo
+    
+    # Clean up
+    file delete -force $root
+    
+    # Re-raise error if one occurred in the test block
+    if {$result} {
+        error $errMsg $savedInfo
+    }
+}
+
+proc check_output {output tree} {
+    foreach file $output {entry typelist} $tree {
+        set type [lindex $typelist 0]
+        set link [lindex $typelist 1]
+        if {$file ne $entry} {
+            error "Found `$file', expected `$entry'"
+        } elseif {[file type $file] ne $type} {
+            error "File `$file' had type `[file type $file]', expected type `$type'"
+        } elseif {$type eq "link" && [file readlink $file] ne $link} {
+            error "File `$file' linked to `[file readlink $file]', expected link to `$link'"
+        }
+    }
+}
+
+proc make_root {} {
+    global trees
+    foreach {entry typelist} $trees(1) {
+        set type [lindex $typelist 0]
+        set link [lindex $typelist 1]
+        switch $type {
+            directory {
+                file mkdir $entry
+            }
+            file {
+                # touch
+                close [open $entry w]
+            }
+            link {
+                # file link doesn't let you link to files that don't exist
+                # so lets farm out to /bin/ln
+                exec /bin/ln -s $link $entry
+            }
+            default {
+                return -code error "Unknown file map type: $typelist"
+            }
+        }
+    }
+}
+
+proc setup_trees {root} {
+    global trees
+    
+    array set trees {}
+    
+    set trees(1) "
+        $root           directory
+        $root/a         directory
+        $root/a/a       file
+        $root/a/b       file
+        $root/a/c       directory
+        $root/a/c/a     {link ../d}
+        $root/a/c/b     file
+        $root/a/c/c     directory
+        $root/a/c/d     file
+        $root/a/d       directory
+        $root/a/d/a     file
+        $root/a/d/b     {link ../../b/a}
+        $root/a/d/c     directory
+        $root/a/d/d     file
+        $root/a/e       file
+        $root/b         directory
+        $root/b/a       directory
+        $root/b/a/a     file
+        $root/b/a/b     file
+        $root/b/a/c     file
+        $root/b/b       directory
+        $root/b/c       directory
+        $root/b/c/a     file
+        $root/b/c/b     file
+        $root/b/c/c     file
+    "
+    
+    set trees(sub1) "
+        $root/a/c/a     {link ../d}
+        $root/a/c/a/a   file
+        $root/a/c/a/b   {link ../../b/a}
+        $root/a/c/a/c   directory
+        $root/a/c/a/d   file
+    "
+    
+    set trees(2) "
+        $root/a/a       file
+        $root/a/b       file
+        $root/a/c/a     {link ../d}
+        $root/a/c/b     file
+        $root/a/c/c     directory
+        $root/a/c/d     file
+        $root/a/c       directory
+        $root/a/d/a     file
+        $root/a/d/b     {link ../../b/a}
+        $root/a/d/c     directory
+        $root/a/d/d     file
+        $root/a/d       directory
+        $root/a/e       file
+        $root/a         directory
+        $root/b/a/a     file
+        $root/b/a/b     file
+        $root/b/a/c     file
+        $root/b/a       directory
+        $root/b/b       directory
+        $root/b/c/a     file
+        $root/b/c/b     file
+        $root/b/c/c     file
+        $root/b/c       directory
+        $root/b         directory
+        $root           directory
+    "
+    
+    set trees(3) "
+        $root/a         directory
+        $root/a/a       file
+        $root/a/b       file
+        $root/a/c       directory
+        $root/a/c/a     {link ../d}
+        $root/a/c/b     file
+        $root/a/c/c     directory
+        $root/a/c/d     file
+        $root/a/d       directory
+        $root/a/d/a     file
+        $root/a/d/b     {link ../../b/a}
+        $root/a/d/c     directory
+        $root/a/d/d     file
+        $root/a/e       file
+        $root/b         directory
+        $root/b/a       directory
+        $root/b/a/a     file
+        $root/b/a/b     file
+        $root/b/a/c     file
+        $root/b/b       directory
+        $root/b/c       directory
+        $root/b/c/a     file
+        $root/b/c/b     file
+        $root/b/c/c     file
+    "
+    
+    set trees(4) "
+        $root/a/a       file
+        $root/a/b       file
+        $root/a/c/a     {link ../d}
+        $root/a/c/b     file
+        $root/a/c/c     directory
+        $root/a/c/d     file
+        $root/a/c       directory
+        $root/a/d/a     file
+        $root/a/d/b     {link ../../b/a}
+        $root/a/d/c     directory
+        $root/a/d/d     file
+        $root/a/d       directory
+        $root/a/e       file
+        $root/a         directory
+        $root/b/a/a     file
+        $root/b/a/b     file
+        $root/b/a/c     file
+        $root/b/a       directory
+        $root/b/b       directory
+        $root/b/c/a     file
+        $root/b/c/b     file
+        $root/b/c/c     file
+        $root/b/c       directory
+        $root/b         directory
+    "
+    
+    set trees(5) "
+        $root           directory
+        $root/b         directory
+        $root/b/b       directory
+        $root/b/c       directory
+        $root/b/c/b     file
+        $root/b/c/c     file
+    "
+    
+    set trees(6) "
+        $root           directory
+        $root/a         directory
+        $root/a/a       file
+        $root/a/b       file
+        $root/a/c       directory
+        $root/a/c/a     {link ../d}
+    "
+}
+
+main $argv
\ No newline at end of file

Copied: branches/release_1_4/base/src/pextlib1.0/tests/symlink.tcl (from rev 24905, trunk/base/src/pextlib1.0/tests/symlink.tcl)
===================================================================
--- branches/release_1_4/base/src/pextlib1.0/tests/symlink.tcl	                        (rev 0)
+++ branches/release_1_4/base/src/pextlib1.0/tests/symlink.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -0,0 +1,38 @@
+# Test file for Pextlib's symlink.
+# Requires r/w access to /tmp/
+# Syntax:
+# tclsh mkfifo.tcl <Pextlib name>
+
+proc main {pextlibname} {
+    load $pextlibname
+    
+    set root "/tmp/macports-pextlib-symlink"
+    
+    file delete -force $root
+    
+    file mkdir $root
+    
+    symlink foobar $root/test
+    
+    if {[catch {file type $root/test}] || [file type $root/test] ne "link" || [file readlink $root/test] ne "foobar"} {
+        set message "symlink failed: "
+        if {[catch {file type $root/test}]} {
+            append message "symlink not created"
+        } elseif {[file type $root/test] ne "link"} {
+            append message "created [file type $root/test], not link"
+        } else {
+            append message "link to `[file readlink $root/test]', expected `foobar'"
+        }
+        file delete -force $root
+        error $message
+    }
+    
+    if {![catch {symlink barfoo $root/test}]} {
+        file delete -force $root
+        error "symlink did not raise error when file already exists"
+    }
+    
+    file delete -force $root
+}
+
+main $argv

Modified: branches/release_1_4/base/src/port/port.tcl
===================================================================
--- branches/release_1_4/base/src/port/port.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port/port.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1883,19 +1883,20 @@
 	set status 0
 	require_portlist portlist
 	foreachport $portlist {
+		# Verify the portname, getting portinfo to map to a porturl
+		if {[catch {set res [dportsearch $portname no exact]} result]} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			break_softcontinue "search for portname $portname failed: $result" 1 status
+		}
+		if {[llength $res] < 2} {
+			break_softcontinue "Port $portname not found" 1 status
+		}
+		array set portinfo [lindex $res 1]
+
 		# If we have a url, use that, since it's most specific
 		# otherwise try to map the portname to a url
 		if {$porturl == ""} {
-			# Verify the portname, getting portinfo to map to a porturl
-			if {[catch {set res [dportsearch $portname no exact]} result]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				break_softcontinue "search for portname $portname failed: $result" 1 status
-			}
-			if {[llength $res] < 2} {
-				break_softcontinue "Port $portname not found" 1 status
-			}
-			array set portinfo [lindex $res 1]
 			set porturl $portinfo(porturl)
 		}
 		
@@ -1967,6 +1968,15 @@
 					# output the path to the port's portfile
 					puts $portfile
 				}
+
+				gohome {
+					set homepage $portinfo(homepage)
+					if { $homepage != "" } {
+						system "${darwinports::autoconf::open_path} $homepage"
+					} else {
+						puts "(no homepage)"
+					}
+				}
 			}
 		} else {
 			break_softcontinue "Could not read $portfile" 1 status
@@ -2135,6 +2145,7 @@
 	cd			action_portcmds
 	url			action_portcmds
 	file		action_portcmds
+	gohome		action_portcmds
 	
 	depends		action_target
 	fetch		action_target
@@ -2423,13 +2434,14 @@
 
 proc process_command_file { in } {
 	global current_portdir
+	global darwinports::autoconf::macports_user_dir
 
 	# Initialize readline
 	set isstdin [string match $in "stdin"]
 	set name "port"
 	set use_readline [expr $isstdin && [readline init $name]]
-	set history_file [file normalize "~/.${name}_history"]
-	
+	set history_file [file normalize "${macports_user_dir}/history"]
+
 	# Read readline history
 	if {$use_readline} {
 		rl_history read $history_file


Property changes on: branches/release_1_4/base/src/port/port.tcl
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: branches/release_1_4/base/src/port/portindex.tcl
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: branches/release_1_4/base/src/port/portmirror.tcl
___________________________________________________________________
Name: svn:executable
   - *

Modified: branches/release_1_4/base/src/port1.0/Makefile
===================================================================
--- branches/release_1_4/base/src/port1.0/Makefile	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/Makefile	2007-05-08 03:53:32 UTC (rev 24908)
@@ -12,6 +12,8 @@
 include ../../Mk/dports.subdir.mk
 include ../../Mk/dports.autoconf.mk
 
+.PHONY: test
+
 all::
 
 clean::
@@ -25,3 +27,6 @@
 		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \
 	done
 	$(SILENT) $(TCLSH) ../pkg_mkindex.tcl ${INSTALLDIR}
+
+test::
+	${TCLSH} tests/portutil.tcl

Modified: branches/release_1_4/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/release_1_4/base/src/port1.0/port_autoconf.tcl.in	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/port_autoconf.tcl.in	2007-05-08 03:53:32 UTC (rev 24908)
@@ -32,7 +32,10 @@
 
 namespace eval portutil::autoconf {
 	variable cvs_path "@CVS@"
+	variable svn_path "@SVN@"
 	variable rsync_path "@RSYNC@"
+	variable mtree_path "@MTREE@"
+	variable xar_path "@XAR@"
 	variable tar_command "@TAR_CMD@"
 	variable have_launchd "@HAVE_LAUNCHD@"
 	variable launchctl_path "@LAUNCHCTL@"

Modified: branches/release_1_4/base/src/port1.0/portdepends.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/portdepends.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/portdepends.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -42,14 +42,14 @@
 option_proc depends_run validate_depends_options
 option_proc depends_lib validate_depends_options
 
-proc validate_depends_options {option action args} {
+proc validate_depends_options {option action {value ""}} {
     global targets
-    switch -regex $action {
-		set|append|delete {
-			foreach depspec $args {
+    switch $action {
+		set {
+			foreach depspec $value {
 				switch -regex $depspec {
-					(lib|bin|path):([-A-Za-z0-9_/.${}^?+()|\\\\]+):([-A-Za-z./0-9_]+) {}
-					(port):([-A-Za-z./0-9_]+) {}
+					^(lib|bin|path):([-A-Za-z0-9_/.${}^?+()|\\\\]+):([-A-Za-z./0-9_]+)$ {}
+					^(port):([-A-Za-z./0-9_]+)$ {}
 					default { return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec] }
 				}
 			}

Modified: branches/release_1_4/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/portdestroot.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/portdestroot.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -85,6 +85,7 @@
     ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${portname}]"
 
     set oldmask [umask ${destroot.umask}]
+    set mtree ${portutil::autoconf::mtree_path}
     
     if { ${destroot.clean} == "yes" } {
 	system "rm -Rf \"${destroot}\""
@@ -92,10 +93,10 @@
     
     file mkdir "${destroot}"
     if { ${os.platform} == "darwin" } {
-	system "cd \"${destroot}\" && mtree -e -U -f ${portresourcepath}/install/macosx.mtree"
+	system "cd \"${destroot}\" && ${mtree} -e -U -f ${portresourcepath}/install/macosx.mtree"
     }
     file mkdir "${destroot}/${prefix}"
-    system "cd \"${destroot}/${prefix}\" && mtree -e -U -f ${portresourcepath}/install/prefix.mtree"
+    system "cd \"${destroot}/${prefix}\" && ${mtree} -e -U -f ${portresourcepath}/install/prefix.mtree"
 }
 
 proc destroot_main {args} {

Modified: branches/release_1_4/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/portfetch.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/portfetch.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -67,7 +67,7 @@
 default cvs.args ""
 default cvs.post_args {"${cvs.module}"}
 
-default svn.cmd {svn}
+default svn.cmd {$portutil::autoconf::svn_path}
 default svn.dir {${workpath}}
 default svn.tag ""
 default svn.env {}
@@ -353,12 +353,12 @@
 
 # Perform an svn fetch
 proc svnfetch {args} {
-    global workpath prefix
+    global workpath prefix_frozen
     global svn.env svn.cmd svn.args svn.post_args svn.tag svn.url
     
     # Look for the svn command, either in the path or in the prefix
     set goodcmd 0
-    foreach svncmd "${svn.cmd} ${prefix}/bin/svn svn" {
+    foreach svncmd "${svn.cmd} ${prefix_frozen}/bin/svn svn" {
  	if { [file executable ${svncmd}] } {
  	   	  set svn.cmd $svncmd
  	   	  set goodcmd 1

Modified: branches/release_1_4/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/portlivecheck.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/portlivecheck.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -62,6 +62,7 @@
 	set updated 0
 	set updated_version "unknown"
 	set has_master_sites [info exists master_sites]
+	set has_homepage [info exists homepage]
 
 	set tempfile ${workpath}/livecheck.TMP
 	set port_moddate [file mtime ${portpath}/Portfile]
@@ -79,7 +80,7 @@
 		} else {
 		    set livecheck.check "freshmeat"
 		}
-		if {[regexp {^http://code.google.com/p/([^/]+)} $homepage _ tag]} {
+		if {$has_homepage && [regexp {^http://code.google.com/p/([^/]+)} $homepage _ tag]} {
 		    if {${livecheck.name} eq "default"} {
 		        set livecheck.name $tag
 		    }
@@ -93,7 +94,7 @@
 	# Perform the check depending on the type.
 	switch ${livecheck.check} {
 	    "freshmeat" {
-    		if {![info exists homepage] || ${livecheck.url} eq ${homepage}} {
+    		if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
     			set livecheck.url "http://freshmeat.net/projects-xml/${livecheck.name}/${livecheck.name}.xml"
     		}
     		if {${livecheck.regex} eq ""} {
@@ -102,7 +103,7 @@
     		set livecheck.check "regex"
 		}
 		"sourceforge" {
-    		if {![info exists homepage] || ${livecheck.url} eq ${homepage}} {
+    		if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
     			set livecheck.url "http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}"
     		}
     		if {${livecheck.distname} eq "default"} {
@@ -114,7 +115,7 @@
     		set livecheck.check "regex"
 		}
 		"googlecode" {
-		    if {![info exists homepage] || ${livecheck.url} eq ${homepage}} {
+		    if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
 		        set livecheck.url "http://code.google.com/p/${livecheck.name}/downloads/list"
 		    }
 		    if {${livecheck.distname} eq "default"} {

Modified: branches/release_1_4/base/src/port1.0/portsubmit.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/portsubmit.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/portsubmit.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -40,6 +40,26 @@
 
 set_ui_prefix
 
+
+proc xar_path {args} {
+	global prefix_frozen
+    set xar ""
+    foreach path "${portutil::autoconf::xar_path} ${prefix_frozen}/bin/xar xar" {
+ 	if { [file executable ${path}] } {
+ 	   	  set xar $path
+ 	      break;
+ 	   }
+    }
+    if { "${xar}" == "" } {
+    	ui_error "The xar tool is required to submit ports"
+    	ui_error "Please install the xar port before proceeding."
+		return -code error [msgcat::mc "Submit failed"]
+    }
+    
+    return $xar
+}
+
+
 # escape quotes, and things that make the shell cry
 proc shell_escape {str} {
 	regsub -all -- {\\} $str {\\\\} str
@@ -48,9 +68,179 @@
 	return $str
 }
 
-proc submit_main {args} {
+
+proc putel { fd el data } {
+	# Quote xml data
+	set quoted [string map  { & &amp; < &lt; > &gt; } $data]
+	# Write the element
+	puts $fd "<${el}>${quoted}</${el}>"
+}
+
+
+proc putlist { fd listel itemel list } {
+	puts $fd "<$listel>"
+	foreach item $list {
+		putel $fd $itemel $item
+	}
+	puts $fd "</$listel>"
+}
+
+
+proc create_portpkg {} {
     global portname portversion prefix UI_PREFIX workpath portpath
 
+	set xar [xar_path]
+	
+    set dirname "portpkg"
+    set dirpath "${workpath}/${dirname}"
+    set pkgpath "${workpath}/${portname}.portpkg"
+    set metaname "portpkg_meta.xml"
+    set metapath "${workpath}/${metaname}"
+    
+    # Expose and default some global variables
+    set vars " portname portversion maintainers categories description \
+    	long_description master_sites homepage epoch version revision \
+    	PortInfo \
+    	submitter_name submitter_email submitter_key \
+    	"
+	eval "global $vars"
+	foreach var $vars {
+		if {![info exists $var]} { set $var {} }
+	}
+
+    # Make sure our workpath is clean
+    file delete -force $dirpath $metapath $pkgpath
+    
+    # Create the portpkg directory
+    file mkdir $dirpath
+
+    # Move in the Portfile
+    file copy Portfile ${dirpath}
+    
+    # Move in files    
+    if {[file isdirectory "files"]} {
+        file copy files ${dirpath}
+    }
+    
+    # Preconditions for submit
+    if {$submitter_email == ""} {
+		return -code error [format [msgcat::mc "Submitter email is required to submit a port"]]
+    }
+
+    # Create the metadata subdoc
+    set sd [open ${metapath} w]
+    puts $sd "<portpkg version='1'>"
+    
+		puts $sd "<submitter>"
+			putel $sd name $submitter_name
+			putel $sd email $submitter_email
+			
+			# TODO provide means to set notes?
+			putel $sd notes ""
+		puts $sd "</submitter>"
+		
+		puts $sd "<package>"
+			putel $sd name $portname
+			putel $sd homepage $homepage
+			putlist $sd categories category $categories
+			putlist $sd maintainers maintainer $maintainers
+			
+			putel $sd epoch $epoch
+			putel $sd version $version
+			putel $sd revision $revision
+			
+			putel $sd description $description
+			putel $sd long_description $long_description
+		
+			# TODO: variants has platforms in it
+			if {[info exists PortInfo(variants)]} {
+				putlist $sd variants variant $PortInfo(variants)
+			} else {
+				putel $sd variants ""
+			}
+			
+			# TODO: Dependencies and platforms
+			#putel $sd dependencies ""
+			#putel $sd platforms ""
+			
+		puts $sd "</package>"
+		
+    puts $sd "</portpkg>"
+    close $sd
+    
+    # Create portpkg.xar, including the metadata and the portpkg directory contents
+    set cmd "cd ${workpath}; ${xar} -cf ${pkgpath} --exclude \\.DSStore --exclude \\.svn ${dirname} -s ${metapath} -n ${metaname}"
+    if {[system $cmd] != ""} {
+		return -code error [format [msgcat::mc "Failed to create portpkg for port : %s"] $portname]
+    }
+    
+    return ${pkgpath}
+}
+
+
+proc submit_main {args} {
+    global mp_remote_submit_url portname portversion portverbose prefix UI_PREFIX workpath portpath
+    
+    set submiturl $mp_remote_submit_url
+  
+   	# Create portpkg.xar in the work directory
+   	set pkgpath [create_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}"
+    lappend args "--output ${workpath}/.portsubmit.out"
+    lappend args "-F machine=true"
+    lappend args "-F portpkg=@${pkgpath}"
+    #lappend args "-F signeddigest=${digest}"
+    set cmd [join $args]
+
+    if {[tbool portverbose]} {
+    	ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
+    }
+
+    ui_debug $cmd
+    if {[system $cmd] != ""} {
+		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]
+	}
+
+    return
+    
+    # REMNANTS OF KEVIN'S CODE
+
     # start with the Portfile, and add the files directory if it exists.
     # don't pick up any CVS directories, or .DS_Store turds
     set cmd "tar czvf ${workpath}/Portfile.tar.gz "
@@ -95,7 +285,8 @@
     puts ""
     exec stty echo
     
-    set vars {portname portversion maintainers categories description long_description master_sites}
+    set vars {portname portversion maintainers categories description \
+    	long_description master_sites}
 	eval "global $vars"
 	foreach var $vars {
 		if {![info exists $var]} { set $var {} }

Modified: branches/release_1_4/base/src/port1.0/portutil.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/portutil.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/portutil.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -90,47 +90,53 @@
 # Arguments: <list of options>
 proc options {args} {
     foreach option $args {
-        proc $option {args} "
-            global ${option} user_options option_procs
-            if {!\[info exists user_options(${option})\]} {
-                set ${option} \$args
+        proc $option {args} [subst -nocommands {
+            global $option user_options option_procs
+            if {![info exists user_options($option)]} {
+                set $option \$args
             }
-        "
-        proc ${option}-delete {args} "
-            global ${option} user_options option_procs
-            if {!\[info exists user_options(${option})\] && \[info exists ${option}\]} {
+        }]
+        proc ${option}-delete {args} [subst -nocommands {
+            global $option user_options option_procs
+            if {![info exists user_options($option)] && [info exists $option]} {
+                set temp $option
                 foreach val \$args {
-                   set ${option} \[ldelete \${$option} \$val\]
+                   set temp [ldelete \${$option} \$val]
                 }
-                if {\[string length \${${option}}\] == 0} {
-                    unset ${option}
+                if {\$temp eq ""} {
+                    unset $option
+                } else {
+                    set $option \$temp
                 }
             }
-        "
-        proc ${option}-append {args} "
-            global ${option} user_options option_procs
-            if {!\[info exists user_options(${option})\]} {
-                if {\[info exists ${option}\]} {
-                    set ${option} \[concat \${$option} \$args\]
+        }]
+        proc ${option}-append {args} [subst -nocommands {
+            global $option user_options option_procs
+            if {![info exists user_options($option)]} {
+                if {[info exists $option]} {
+                    set $option [concat \${$option} \$args]
                 } else {
-                    set ${option} \$args
+                    set $option \$args
                 }
             }
-        "
+        }]
     }
 }
 
 proc options_export {args} {
     foreach option $args {
-        proc options::export-${option} {args} "
-            global ${option} PortInfo
-            if {\[info exists ${option}\]} {
-                set PortInfo(${option}) \${${option}}
-            } else {
-                unset PortInfo(${option})
+        proc options::export-${option} {option action {value ""}} [subst -nocommands {
+            global $option PortInfo
+            switch \$action {
+                set {
+                    set PortInfo($option) \$value
+                }
+                delete {
+                    unset PortInfo($option)
+                }
             }
-        "
-        option_proc ${option} options::export-${option}
+        }]
+        option_proc $option options::export-$option
     }
 }
 
@@ -140,55 +146,58 @@
     # If a new option is specified, default the option to {${newoption}}
     # Display a warning
     if {$newoption != ""} {
-        proc warn_deprecated_${option} {option action args} "
+        proc warn_deprecated_${option} {option action args} [subst -nocommands {
             global portname $option $newoption
-            if {\$action != \"read\"} {
+            if {\$action != "read"} {
                 $newoption \$$option
             } else {
-                ui_warn \"Port \$portname using deprecated option \\\"$option\\\".\"
+                ui_warn "Port \$portname using deprecated option \\\"$option\\\"."
                 $option \[set $newoption\]
             }
-        "
+        }]
     } else {
-        proc warn_deprecated_$option {option action args} "
+        proc warn_deprecated_$option {option action args} [subst -nocommands {
             global portname $option $newoption
-            ui_warn \"Port \$portname using deprecated option \\\"$option\\\".\"
-        "
+            ui_warn "Port \$portname using deprecated option \\\"$option\\\"."
+        }]
     }
     option_proc $option warn_deprecated_$option
 }
 
 proc option_proc {option args} {
     global option_procs $option
-    eval lappend option_procs($option) $args
-    # Add a read trace to the variable, as the option procedures have no access to reads
-    trace variable $option rwu option_proc_trace
+    if {[info exists option_procs($option)]} {
+        set option_procs($option) [concat $option_procs($option) $args]
+        # we're already tracing
+    } else {
+        set option_procs($option) $args
+        trace add variable $option {read write unset} option_proc_trace
+    }
 }
 
 # option_proc_trace
 # trace handler for option reads. Calls option procedures with correct arguments.
 proc option_proc_trace {optionName index op} {
     global option_procs
-    upvar $optionName optionValue
+    upvar $optionName $optionName
     switch $op {
-        w {
+        write {
             foreach p $option_procs($optionName) {
-                $p $optionName set $optionValue
+                $p $optionName set [set $optionName]
             }
-            return
         }
-        r {
+        read {
             foreach p $option_procs($optionName) {
                 $p $optionName read
             }
-            return
         }
-        u {
+        unset {
             foreach p $option_procs($optionName) {
-                $p $optionName delete
-                trace vdelete $optionName rwu $p
+                if {[catch {$p $optionName delete} result]} {
+                    ui_debug "error during unset trace ($p): $result\n$::errorInfo"
+                }
             }
-            return
+            trace add variable $optionName {read write unset} option_proc_trace
         }
     }
 }
@@ -375,11 +384,11 @@
     # (don't list it twice if the variant was already defined, which can happen
     # with universal or group code).
     set variant_provides [ditem_key $ditem provides]
-	if {![info exists PortInfo(variants)] || [lsearch -exact $PortInfo(variants) $variant_provides] < 0} {
-	    lappend PortInfo(variants) $variant_provides
-	} else {
+    if {[variant_exists $variant_provides]} {
 		# This variant was already defined. Remove it from the dlist.
 		variant_remove_ditem $variant_provides
+	} else {
+	    lappend PortInfo(variants) $variant_provides
 	}
 
 	# Finally append the ditem to the dlist.
@@ -454,6 +463,18 @@
 	}
 }
 
+# variant_exists name
+# determine if a variant exists.
+proc variant_exists {name} {
+	global PortInfo
+	if {[info exists PortInfo(variants)] &&
+		[lsearch -exact $PortInfo(variants) $name] >= 0} {
+		return 1
+	}
+	
+	return 0
+}
+
 # platform <os> [<release>] [<arch>] 
 # Portfile level procedure to provide support for declaring platform-specifics
 # Basically, just wrap 'variant', so that Portfiles' platform declarations can
@@ -482,6 +503,15 @@
     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
@@ -690,30 +720,12 @@
 
 # delete
 # file delete -force by itself doesn't handle directories properly
-# on systems older than Tiger. However we can recurse this thing ourselves
+# on systems older than Tiger. Lets recurse using fs-traverse instead
 proc delete {args} {
-    foreach arg $args {
-        ui_debug "delete: $arg"
-        set stack [list $arg]
-        while {[llength $stack] > 0} {
-            set file [lindex $stack 0]
-            if {[string equal [file type $file] directory]} {
-                # it's a directory
-                set children [glob -nocomplain -directory $file * .*]
-                set children [ldelete [ldelete $children $file/.] $file/..]
-                if {[llength $children] > 0} {
-                    set stack [concat $children $stack]
-                } else {
-                    # directory is empty
-                    file delete -force -- $file
-                    set stack [lrange $stack 1 end]
-                }
-            } else {
-                # it's not a directory - kill it now
-                file delete -force -- $file
-                set stack [lrange $stack 1 end]
-            }
-        }
+    ui_debug "delete: $args"
+    fs-traverse -depth file $args {
+        file delete -force -- $file
+        continue
     }
 }
 
@@ -828,7 +840,13 @@
 proc ln {args} {
     while {[string match -* [lindex $args 0]]} {
         set arg [string range [lindex $args 0] 1 end]
-        set args [lrange $args 1 end]
+        if {[string length $arg] > 1} {
+            set remainder -[string range $arg 1 end]
+            set arg [string range $arg 0 0]
+            set args [lreplace $args 0 0 $remainder]
+        } else {
+            set args [lreplace $args 0 0]
+        }
         switch -- $arg {
             f -
             h -
@@ -856,14 +874,18 @@
             return -code error "ln: $file: Is a directory"
         }
         
-        if {[file isdirectory $target] && ![info exists options(h)]} {
+        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 {[file exists $linktarget] && ![info exists options(f)]} {
-            return -code error "ln: $linktarget: File exists"
+        if {![catch {file type $linktarget}]} {
+            if {[info exists options(f)]} {
+                file delete $linktarget
+            } else {
+                return -code error "ln: $linktarget: File exists"
+            }
         }
         
         if {[llength $files] > 2} {
@@ -879,7 +901,7 @@
             ui_msg "ln: $linktarget -> $file"
         }
         if {[info exists options(s)]} {
-            file link -symbolic $linktarget $file
+            symlink $file $linktarget
         } else {
             file link -hard $linktarget $file
         }
@@ -1102,6 +1124,7 @@
 						mpkg		-
 						rpmpackage	-
 						dpkg		-
+						activate    -
 						""			{ set deptypes "depends_lib depends_build depends_run" }
 					}
 					
@@ -1383,24 +1406,25 @@
     # If they don't match, print an error indicating a 'port clean' 
     # should be performed.  
     # - Skip this test if the statefile is empty.
-    # - Skip this test if performing a clean.
+    # - Skip this test if performing a clean or submit.
     # - Skip this test if ports_force was specified.
     
-    if {$target != "clean" && 
-	!([info exists ports_force] && $ports_force == "yes")} {
-	set state_fd [open_statefile]
+    if { [lsearch "clean submit" $target] < 0 && 
+		!([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
-	} else {
-	    # Write variations out to the statefile
-	    foreach key [array names upvariations *] {
-		write_statefile variant $upvariations($key)$key $state_fd
-	    }
-	}
-	
-	close $state_fd
+		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
+		} else {
+			# Write variations out to the statefile
+			foreach key [array names upvariations *] {
+			write_statefile variant $upvariations($key)$key $state_fd
+			}
+		}
+		
+		close $state_fd
     }
     
     return $result
@@ -1519,11 +1543,11 @@
     return $ditem
 }
 
-proc handle_default_variants {option action args} {
+proc handle_default_variants {option action {value ""}} {
     global variations
     switch -regex $action {
 	set|append {
-	    foreach v $args {
+	    foreach v $value {
 		if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant]} {
 		    if {![info exists variations($variant)]} {
 			set variations($variant) $val
@@ -1726,8 +1750,8 @@
 		t(ar|bz|gz) {
 			set tar "tar"
 			if {[catch {set tar [binaryInPath $tar]} errmsg] == 0} {
-				if {[regexp {z$} $type]} {
-					if {[regexp {bz$} $type]} {
+				if {[regexp {z2?$} $type]} {
+					if {[regexp {bz2?$} $type]} {
 						set gzip "bzip2"
 					} else {
 						set gzip "gzip"

Modified: branches/release_1_4/base/src/port1.0/resources/fetch/mirror_sites.tcl
===================================================================
--- branches/release_1_4/base/src/port1.0/resources/fetch/mirror_sites.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/port1.0/resources/fetch/mirror_sites.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -126,6 +126,7 @@
 set portfetch::mirror_sites::sites(macports) {
     http://svn.macports.org/repository/macports/distfiles/
     http://svn.macports.org/repository/macports/distfiles/general/:nosubdir
+    http://svn.macports.org/repository/macports/downloads/
 }
 
 set portfetch::mirror_sites::sites(opendarwin) {

Copied: branches/release_1_4/base/src/port1.0/tests (from rev 24905, trunk/base/src/port1.0/tests)

Deleted: branches/release_1_4/base/src/port1.0/tests/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/tests/portutil.tcl	2007-05-08 03:33:26 UTC (rev 24905)
+++ branches/release_1_4/base/src/port1.0/tests/portutil.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -1,194 +0,0 @@
-# Test file for Pextlib's fs-traverse
-# Requires r/w access to /tmp
-# MacPorts must be installed for this to work
-
-package require darwinports
-dportinit
-
-# load the current copy of portutil instead of the installed one
-source [file dirname [info script]]/../portutil.tcl
-
-# end boilerplate
-
-namespace eval tests {
-
-proc test_delete {} {
-    set root "/tmp/macports-portutil-delete"
-    # use file delete -force to kill the test directory if it already exists
-    # yeah I realize this will fail on 10.3 if it already exists. oh well.
-    file delete -force $root
-    
-    try {
-        mtree $root {
-            a               directory
-            a/a             file
-            a/b             file
-            a/c             directory
-            a/c/a           file
-            a/c/b           {link ../b}
-            a/c/c           {link ../../b}
-            a/c/d           directory
-            a/c/d/a         file
-            a/c/d/b         directory
-            a/c/d/c         file
-            a/d             file
-            b               directory
-            b/a             file
-            b/b             {link q}
-            b/c             directory
-            b/c/a           file
-            b/c/b           file
-            b/d             file
-        }
-    
-        # test multiple args
-        delete $root/a $root/b
-    
-        if {[file exists $root/a] || [file exists $root/b]} {
-            error "delete failed"
-        }
-    } finally {
-        file delete -force $root
-    }
-}
-
-proc test_touch {} {
-    set root "/tmp/macports-portutil-touch"
-    file delete -force $root
-    
-    try {
-        touch -c $root
-        if {[file exists $root]} { error "touch failed" }
-    
-        touch $root
-        if {![file exists $root]} { error "touch failed" }
-    
-        touch -a -t 199912010001.01 $root
-        if {[file atime $root] != [clock scan 19991201T000101]} { error "touch failed" }
-        if {[file mtime $root] == [clock scan 19991201T000101]} { error "touch failed" }
-    
-        touch -m -t 200012010001.01 $root
-        if {[file atime $root] == [clock scan 20001201T000101]} { error "touch failed" }
-        if {[file mtime $root] != [clock scan 20001201T000101]} { error "touch failed" }
-    
-        touch -a -m -t 200112010001.01 $root
-        if {[file atime $root] != [clock scan 20011201T000101]} { error "touch failed" }
-        if {[file mtime $root] != [clock scan 20011201T000101]} { error "touch failed" }
-    
-        touch -r ~ $root
-        if {[file atime $root] != [file atime ~]} { error "touch failed" }
-        if {[file mtime $root] != [file mtime ~]} { error "touch failed" }
-    } finally {
-        file delete -force $root
-    }
-}
-
-proc test_ln {} {
-    set root "/tmp/macports-portutil-ln"
-    file delete -force $root
-    
-    file mkdir $root
-    try {
-        close [open $root/a w]
-        ln -s a $root/b
-        if {[catch {file type $root/b}] || [file type $root/b] ne "link"} {
-            set message "ln failed: "
-            if {[catch {file type $root/b}]} {
-                append message "symlink not created"
-            } elseif {[file type $root/b] ne "link"} {
-                append message "created [file type $root/b], expected link"
-            }
-            error $message
-        }
-    
-        close [open $root/c w]
-        if {![catch {ln -s c $root/b}]} { error "ln failed" }
-    
-        ln -s -f c $root/b
-        if {[catch {file type $root/b}] || [file type $root/b] ne "link"} { error "ln failed" }
-    
-        file delete $root/b
-    
-        ln $root/a $root/b
-        if {[catch {file type $root/b}] || [file type $root/b] ne "file"} { error "ln failed" }
-    
-        file delete $root/b
-        file mkdir $root/dir
-        ln -s dir $root/b
-        ln -s a $root/b
-        if {[catch {file type $root/dir/a}] || [file type $root/dir/a] ne "link"} { error "ln failed" }
-        file delete $root/dir/a
-    
-        ln -s -f -h a $root/b
-        if {[catch {file type $root/b}] || [file type $root/b] ne "link" || [file readlink $root/b] ne "a"} { error "ln failed" }
-    
-        cd $root/dir
-        ln -s ../c
-        if {[catch {file type $root/dir/c}] || [file type $root/dir/c] ne "link"} { error "ln failed" }
-    
-        ln -s foobar $root/d
-        if {[catch {file type $root/d}] || [file type $root/d] ne "link" || [file readlink $root/d] ne "foobar"} { error "ln failed" }
-        
-        ln -s -f -h z $root/dir
-        if {[catch {file type $root/dir/z}] || [file type $root/dir/z] ne "link"} { error "ln failed" }
-        
-        # test combined flags
-        ln -sf q $root/dir
-        if {[catch {file type $root/dir/q}] || [file type $root/dir/q] ne "link"} { error "ln failed" }
-    } finally {
-        file delete -force $root
-    }
-}
-
-# Create a filesystem hierarchy based on the given specification
-# The mtree spec consists of name/type pairings, where type can be
-# one of directory, file or link. If type is link, it must be a
-# two-element list containing the path as the second element
-proc mtree {root spec} {
-    foreach {entry typelist} $spec {
-        set type [lindex $typelist 0]
-        set link [lindex $typelist 1]
-        set file [file join $root $entry]
-        switch $type {
-            directory {
-                file mkdir $file
-            }
-            file {
-                # touch
-                close [open $file w]
-            }
-            link {
-                # file link doesn't let you link to files that don't exist
-                # so lets farm out to /bin/ln
-                exec /bin/ln -s $link $file
-            }
-            default {
-                return -code error "Unknown file map type: $typelist"
-            }
-        }
-    }
-}
-
-# try-finally block
-# Usage: try { script1 } finally { script2 }
-proc try {script1 finally script2} {
-    if {$finally ne "finally"} {
-        error "Usage: try { script1 } finally { script2 }"
-    }
-    if {[set fail [catch {uplevel $script1} result]]} {
-        set savedInfo $::errorInfo
-        set savedCode $::errorCode
-    }
-    uplevel $script2
-    if {$fail} {
-        return -code $fail -errorinfo $savedInfo -errorcode $savedCode $result
-    }
-}
-
-# run all tests
-foreach proc [info procs test_*] {
-    $proc
-}
-
-# namespace eval tests
-}

Copied: branches/release_1_4/base/src/port1.0/tests/portutil.tcl (from rev 24905, trunk/base/src/port1.0/tests/portutil.tcl)
===================================================================
--- branches/release_1_4/base/src/port1.0/tests/portutil.tcl	                        (rev 0)
+++ branches/release_1_4/base/src/port1.0/tests/portutil.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -0,0 +1,194 @@
+# Test file for Pextlib's fs-traverse
+# Requires r/w access to /tmp
+# MacPorts must be installed for this to work
+
+package require darwinports
+dportinit
+
+# load the current copy of portutil instead of the installed one
+source [file dirname [info script]]/../portutil.tcl
+
+# end boilerplate
+
+namespace eval tests {
+
+proc test_delete {} {
+    set root "/tmp/macports-portutil-delete"
+    # use file delete -force to kill the test directory if it already exists
+    # yeah I realize this will fail on 10.3 if it already exists. oh well.
+    file delete -force $root
+    
+    try {
+        mtree $root {
+            a               directory
+            a/a             file
+            a/b             file
+            a/c             directory
+            a/c/a           file
+            a/c/b           {link ../b}
+            a/c/c           {link ../../b}
+            a/c/d           directory
+            a/c/d/a         file
+            a/c/d/b         directory
+            a/c/d/c         file
+            a/d             file
+            b               directory
+            b/a             file
+            b/b             {link q}
+            b/c             directory
+            b/c/a           file
+            b/c/b           file
+            b/d             file
+        }
+    
+        # test multiple args
+        delete $root/a $root/b
+    
+        if {[file exists $root/a] || [file exists $root/b]} {
+            error "delete failed"
+        }
+    } finally {
+        file delete -force $root
+    }
+}
+
+proc test_touch {} {
+    set root "/tmp/macports-portutil-touch"
+    file delete -force $root
+    
+    try {
+        touch -c $root
+        if {[file exists $root]} { error "touch failed" }
+    
+        touch $root
+        if {![file exists $root]} { error "touch failed" }
+    
+        touch -a -t 199912010001.01 $root
+        if {[file atime $root] != [clock scan 19991201T000101]} { error "touch failed" }
+        if {[file mtime $root] == [clock scan 19991201T000101]} { error "touch failed" }
+    
+        touch -m -t 200012010001.01 $root
+        if {[file atime $root] == [clock scan 20001201T000101]} { error "touch failed" }
+        if {[file mtime $root] != [clock scan 20001201T000101]} { error "touch failed" }
+    
+        touch -a -m -t 200112010001.01 $root
+        if {[file atime $root] != [clock scan 20011201T000101]} { error "touch failed" }
+        if {[file mtime $root] != [clock scan 20011201T000101]} { error "touch failed" }
+    
+        touch -r ~ $root
+        if {[file atime $root] != [file atime ~]} { error "touch failed" }
+        if {[file mtime $root] != [file mtime ~]} { error "touch failed" }
+    } finally {
+        file delete -force $root
+    }
+}
+
+proc test_ln {} {
+    set root "/tmp/macports-portutil-ln"
+    file delete -force $root
+    
+    file mkdir $root
+    try {
+        close [open $root/a w]
+        ln -s a $root/b
+        if {[catch {file type $root/b}] || [file type $root/b] ne "link"} {
+            set message "ln failed: "
+            if {[catch {file type $root/b}]} {
+                append message "symlink not created"
+            } elseif {[file type $root/b] ne "link"} {
+                append message "created [file type $root/b], expected link"
+            }
+            error $message
+        }
+    
+        close [open $root/c w]
+        if {![catch {ln -s c $root/b}]} { error "ln failed" }
+    
+        ln -s -f c $root/b
+        if {[catch {file type $root/b}] || [file type $root/b] ne "link"} { error "ln failed" }
+    
+        file delete $root/b
+    
+        ln $root/a $root/b
+        if {[catch {file type $root/b}] || [file type $root/b] ne "file"} { error "ln failed" }
+    
+        file delete $root/b
+        file mkdir $root/dir
+        ln -s dir $root/b
+        ln -s a $root/b
+        if {[catch {file type $root/dir/a}] || [file type $root/dir/a] ne "link"} { error "ln failed" }
+        file delete $root/dir/a
+    
+        ln -s -f -h a $root/b
+        if {[catch {file type $root/b}] || [file type $root/b] ne "link" || [file readlink $root/b] ne "a"} { error "ln failed" }
+    
+        cd $root/dir
+        ln -s ../c
+        if {[catch {file type $root/dir/c}] || [file type $root/dir/c] ne "link"} { error "ln failed" }
+    
+        ln -s foobar $root/d
+        if {[catch {file type $root/d}] || [file type $root/d] ne "link" || [file readlink $root/d] ne "foobar"} { error "ln failed" }
+        
+        ln -s -f -h z $root/dir
+        if {[catch {file type $root/dir/z}] || [file type $root/dir/z] ne "link"} { error "ln failed" }
+        
+        # test combined flags
+        ln -sf q $root/dir
+        if {[catch {file type $root/dir/q}] || [file type $root/dir/q] ne "link"} { error "ln failed" }
+    } finally {
+        file delete -force $root
+    }
+}
+
+# Create a filesystem hierarchy based on the given specification
+# The mtree spec consists of name/type pairings, where type can be
+# one of directory, file or link. If type is link, it must be a
+# two-element list containing the path as the second element
+proc mtree {root spec} {
+    foreach {entry typelist} $spec {
+        set type [lindex $typelist 0]
+        set link [lindex $typelist 1]
+        set file [file join $root $entry]
+        switch $type {
+            directory {
+                file mkdir $file
+            }
+            file {
+                # touch
+                close [open $file w]
+            }
+            link {
+                # file link doesn't let you link to files that don't exist
+                # so lets farm out to /bin/ln
+                exec /bin/ln -s $link $file
+            }
+            default {
+                return -code error "Unknown file map type: $typelist"
+            }
+        }
+    }
+}
+
+# try-finally block
+# Usage: try { script1 } finally { script2 }
+proc try {script1 finally script2} {
+    if {$finally ne "finally"} {
+        error "Usage: try { script1 } finally { script2 }"
+    }
+    if {[set fail [catch {uplevel $script1} result]]} {
+        set savedInfo $::errorInfo
+        set savedCode $::errorCode
+    }
+    uplevel $script2
+    if {$fail} {
+        return -code $fail -errorinfo $savedInfo -errorcode $savedCode $result
+    }
+}
+
+# run all tests
+foreach proc [info procs test_*] {
+    $proc
+}
+
+# namespace eval tests
+}

Modified: branches/release_1_4/base/src/registry1.0/portimage.tcl
===================================================================
--- branches/release_1_4/base/src/registry1.0/portimage.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/registry1.0/portimage.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -95,7 +95,7 @@
 			set	ivariants [lindex $i 3]
 			set iactive [lindex $i 4]
 			if { ![string equal ${iversion}_${irevision}${ivariants} ${version}_${revision}${variants}] && $iactive == 1 } {
-				return -code error "Image error: Another version of $iname (${iversion}_${irevision}${ivariants}) is already active."
+				return -code error "Image error: Another version of this port ($iname @${iversion}_${irevision}${ivariants}) is already active."
 			}
 		}
 	}
@@ -103,13 +103,13 @@
 	set ref [registry::open_entry $name $version $revision $variants]
 	
 	if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
-		return -code error "Image error: ${name} ${version}_${revision}${variants} not installed as an image."
+		return -code error "Image error: ${name} @${version}_${revision}${variants} not installed as an image."
 	}
 	if { [registry::property_retrieve $ref active] != 0 } {
-		return -code error "Image error: ${name} ${version}_${revision}${variants} is already active."
+		return -code error "Image error: ${name} @${version}_${revision}${variants} is already active."
 	} 
 	if { [registry::property_retrieve $ref compact] != 0 } {
-		return -code error "Image error: ${name} ${version}_${revision}${variants} is compactd."
+		return -code error "Image error: ${name} @${version}_${revision}${variants} is compactd."
 	} 
 
 	set imagedir [registry::property_retrieve $ref imagedir]
@@ -162,13 +162,13 @@
 	set ref [registry::open_entry $name $version $revision $variants]
 
 	if { ![string equal [registry::property_retrieve $ref installtype] "image"] } {
-		return -code error "Image error: ${name} ${fqversion} not installed as an image."
+		return -code error "Image error: ${name} @${fqversion} not installed as an image."
 	}
 	if { [registry::property_retrieve $ref active] != 1 } {
-		return -code error "Image error: ${name} ${fqversion} is not active."
+		return -code error "Image error: ${name} @${fqversion} is not active."
 	} 
 	if { [registry::property_retrieve $ref compact] != 0 } {
-		return -code error "Image error: ${name} ${fqversion} is compactd."
+		return -code error "Image error: ${name} @${fqversion} is compactd."
 	} 
 
 	set imagedir [registry::property_retrieve $ref imagedir]

Modified: branches/release_1_4/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- branches/release_1_4/base/src/registry1.0/receipt_flat.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/registry1.0/receipt_flat.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -111,7 +111,7 @@
 		
 		if {![string length $receipt_file]} {
 			if { $version != 0 } {
-				return -code error "Registry error: ${name} ${version}_${revision}${variants} not registered as installed."
+				return -code error "Registry error: ${name} @${version}_${revision}${variants} not registered as installed."
 			} else {
 				return -code error "Registry error: ${name} not registered as installed."
 			}
@@ -138,7 +138,7 @@
 		}
 	
 		if { ![entry_exists $name $version $revision $variants] } {
-			return -code error "Registry error: ${name} ${version}_${revision}${variants} not registered as installed."
+			return -code error "Registry error: ${name} @${version}_${revision}${variants} not registered as installed."
 		}
 	
 		set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
@@ -154,7 +154,7 @@
 		set receipt_contents [read $receipt_handle]
 		close $receipt_handle
 	} else {
-		return -code error "Registry error: receipt for ${name} ${version}_${revision}${variants} seems to be compressed, but bzip2 couln't be found."
+		return -code error "Registry error: receipt for ${name} @${version}_${revision}${variants} seems to be compressed, but bzip2 couln't be found."
 	}
 
 	set ref [new_entry]
@@ -176,7 +176,7 @@
 	} elseif {[string match "# Version: *" $receipt_contents]} {
 		# This is new format
 		if {![string match "# Version: 1.0*" $receipt_contents]} {
-			return -code error "Registry error: receipt ${name} ${version}_${revision}${variants} is in an unknown format (version too new?)."
+			return -code error "Registry error: receipt ${name} @${version}_${revision}${variants} is in an unknown format (version too new?)."
 		}
 
 		# Remove any line starting with #

Modified: branches/release_1_4/base/src/registry1.0/registry.tcl
===================================================================
--- branches/release_1_4/base/src/registry1.0/registry.tcl	2007-05-08 03:44:55 UTC (rev 24907)
+++ branches/release_1_4/base/src/registry1.0/registry.tcl	2007-05-08 03:53:32 UTC (rev 24908)
@@ -71,7 +71,7 @@
 
 		return $ref
 	} else {
-		return -code error "Registry error: ${name} ${version}_${revision}${variants} already registered as installed.  Please uninstall it first."
+		return -code error "Registry error: ${name} @${version}_${revision}${variants} already registered as installed.  Please uninstall it first."
 	}
 }
 
@@ -217,9 +217,9 @@
 			set ivariants [lindex $i 3]
 			set iactive [lindex $i 4]
 			if { $iactive == 0 } {
-				puts "	$iname ${iversion}_${irevision}${ivariants}"
+				puts "	$iname @${iversion}_${irevision}${ivariants}"
 			} elseif { $iactive == 1 } {
-				puts "	$iname ${iversion}_${irevision}${ivariants} (active)"
+				puts "	$iname @${iversion}_${irevision}${ivariants} (active)"
 			}
 		}
 		return -1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070507/22dcc67b/attachment.html


More information about the macports-changes mailing list