[52218] branches/gsoc09-logging/base

enl at macports.org enl at macports.org
Fri Jun 12 01:57:54 PDT 2009


Revision: 52218
          http://trac.macports.org/changeset/52218
Author:   enl at macports.org
Date:     2009-06-12 01:57:53 -0700 (Fri, 12 Jun 2009)
Log Message:
-----------
Merge from trunc

Modified Paths:
--------------
    branches/gsoc09-logging/base/aclocal.m4
    branches/gsoc09-logging/base/configure
    branches/gsoc09-logging/base/configure.ac
    branches/gsoc09-logging/base/doc/macports.conf.in
    branches/gsoc09-logging/base/doc/portgroup.7
    branches/gsoc09-logging/base/portmgr/bots/port.rb
    branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl
    branches/gsoc09-logging/base/portmgr/packaging/dpkgall.tcl
    branches/gsoc09-logging/base/portmgr/packaging/packageall.tcl
    branches/gsoc09-logging/base/portmgr/packaging/rpmall.tcl
    branches/gsoc09-logging/base/src/Makefile.in
    branches/gsoc09-logging/base/src/cregistry/Makefile
    branches/gsoc09-logging/base/src/macports1.0/Makefile
    branches/gsoc09-logging/base/src/macports1.0/macports.tcl
    branches/gsoc09-logging/base/src/macports1.0/macports_autoconf.tcl.in
    branches/gsoc09-logging/base/src/macports1.0/macports_fastload.tcl.in
    branches/gsoc09-logging/base/src/package1.0/Makefile
    branches/gsoc09-logging/base/src/package1.0/portarchive.tcl
    branches/gsoc09-logging/base/src/package1.0/portdmg.tcl
    branches/gsoc09-logging/base/src/package1.0/portdpkg.tcl
    branches/gsoc09-logging/base/src/package1.0/portmdmg.tcl
    branches/gsoc09-logging/base/src/package1.0/portmpkg.tcl
    branches/gsoc09-logging/base/src/package1.0/portpkg.tcl
    branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl
    branches/gsoc09-logging/base/src/package1.0/portrpm.tcl
    branches/gsoc09-logging/base/src/package1.0/portsrpm.tcl
    branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl
    branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c
    branches/gsoc09-logging/base/src/pextlib1.0/filemap.c
    branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c
    branches/gsoc09-logging/base/src/pextlib1.0/tty.c
    branches/gsoc09-logging/base/src/pextlib1.0/uid.c
    branches/gsoc09-logging/base/src/pextlib1.0/uid.h
    branches/gsoc09-logging/base/src/port/Makefile
    branches/gsoc09-logging/base/src/port/port-help.tcl
    branches/gsoc09-logging/base/src/port/port.tcl
    branches/gsoc09-logging/base/src/port/portindex.tcl
    branches/gsoc09-logging/base/src/port1.0/Makefile
    branches/gsoc09-logging/base/src/port1.0/port_autoconf.tcl.in
    branches/gsoc09-logging/base/src/port1.0/portactivate.tcl
    branches/gsoc09-logging/base/src/port1.0/portbuild.tcl
    branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl
    branches/gsoc09-logging/base/src/port1.0/portclean.tcl
    branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl
    branches/gsoc09-logging/base/src/port1.0/portdepends.tcl
    branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl
    branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl
    branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl
    branches/gsoc09-logging/base/src/port1.0/portextract.tcl
    branches/gsoc09-logging/base/src/port1.0/portfetch.tcl
    branches/gsoc09-logging/base/src/port1.0/portinstall.tcl
    branches/gsoc09-logging/base/src/port1.0/portlint.tcl
    branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl
    branches/gsoc09-logging/base/src/port1.0/portmain.tcl
    branches/gsoc09-logging/base/src/port1.0/portmirror.tcl
    branches/gsoc09-logging/base/src/port1.0/portpatch.tcl
    branches/gsoc09-logging/base/src/port1.0/portstartupitem.tcl
    branches/gsoc09-logging/base/src/port1.0/portsubmit.tcl
    branches/gsoc09-logging/base/src/port1.0/porttest.tcl
    branches/gsoc09-logging/base/src/port1.0/portutil.tcl
    branches/gsoc09-logging/base/src/registry1.0/Makefile
    branches/gsoc09-logging/base/src/registry1.0/portimage.tcl
    branches/gsoc09-logging/base/src/registry1.0/portuninstall.tcl
    branches/gsoc09-logging/base/src/registry2.0/Makefile

Property Changed:
----------------
    branches/gsoc09-logging/base/


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

Modified: branches/gsoc09-logging/base/aclocal.m4
===================================================================
--- branches/gsoc09-logging/base/aclocal.m4	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/aclocal.m4	2009-06-12 08:57:53 UTC (rev 52218)
@@ -502,9 +502,9 @@
 
 	if test "x$UNIVERSAL_SYSROOT" = "x"; then
 	    if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
-		UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
+		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
 	    else
-		UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
+		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
 	    fi
 	fi
 

Modified: branches/gsoc09-logging/base/configure
===================================================================
--- branches/gsoc09-logging/base/configure	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/configure	2009-06-12 08:57:53 UTC (rev 52218)
@@ -714,6 +714,8 @@
 OPEN
 XAR
 PAX
+MKBOM
+LSBOM
 BZIP2
 GNUMAKE
 GNUTAR
@@ -722,17 +724,28 @@
 HAVE_LAUNCHD
 HDIUTIL
 MAKE
+BSDMAKE
 ZIP
 UNZIP
 TAR
 SED
 RSYNC
 RMDIR
+PATCH
+NICE
+LIPO
 GZIP
+HG
 GIT
 SVN
 CVS
+FILE
+DSCL
+DITTO
+DIFF
+CPIO
 CP
+CHOWN
 MTREE
 LN_S
 SET_MAKE
@@ -749,6 +762,7 @@
 LDFLAGS
 CFLAGS
 CC
+DEVELOPER_DIR
 XCODE_SELECT
 DEFAULTS
 SW_VERS
@@ -2348,8 +2362,11 @@
   DEVELOPER_DIR=`$XCODE_SELECT -print-path`
   { $as_echo "$as_me:$LINENO: result: $DEVELOPER_DIR" >&5
 $as_echo "$DEVELOPER_DIR" >&6; }
+else
+  DEVELOPER_DIR=/Developer
 fi
 
+
 XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
 if test -r "$XCODEPLIST"; then
   { $as_echo "$as_me:$LINENO: checking Xcode version" >&5
@@ -3748,6 +3765,47 @@
 fi
 
 
+# Extract the first word of "chown", so it can be a program name with args.
+set dummy chown; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CHOWN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $CHOWN in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/usr/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_CHOWN="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CHOWN=$ac_cv_path_CHOWN
+if test -n "$CHOWN"; then
+  { $as_echo "$as_me:$LINENO: result: $CHOWN" >&5
+$as_echo "$CHOWN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3788,6 +3846,206 @@
 fi
 
 
+# Extract the first word of "cpio", so it can be a program name with args.
+set dummy cpio; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CPIO+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $CPIO in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CPIO="$CPIO" # 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_CPIO="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CPIO=$ac_cv_path_CPIO
+if test -n "$CPIO"; then
+  { $as_echo "$as_me:$LINENO: result: $CPIO" >&5
+$as_echo "$CPIO" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "diff", so it can be a program name with args.
+set dummy diff; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DIFF+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $DIFF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DIFF="$DIFF" # 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_DIFF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DIFF=$ac_cv_path_DIFF
+if test -n "$DIFF"; then
+  { $as_echo "$as_me:$LINENO: result: $DIFF" >&5
+$as_echo "$DIFF" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "ditto", so it can be a program name with args.
+set dummy ditto; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DITTO+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $DITTO in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DITTO="$DITTO" # 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_DITTO="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DITTO=$ac_cv_path_DITTO
+if test -n "$DITTO"; then
+  { $as_echo "$as_me:$LINENO: result: $DITTO" >&5
+$as_echo "$DITTO" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "dscl", so it can be a program name with args.
+set dummy dscl; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DSCL+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $DSCL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DSCL="$DSCL" # 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_DSCL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DSCL=$ac_cv_path_DSCL
+if test -n "$DSCL"; then
+  { $as_echo "$as_me:$LINENO: result: $DSCL" >&5
+$as_echo "$DSCL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "file", so it can be a program name with args.
+set dummy file; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FILE+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $FILE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FILE="$FILE" # 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_FILE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+FILE=$ac_cv_path_FILE
+if test -n "$FILE"; then
+  { $as_echo "$as_me:$LINENO: result: $FILE" >&5
+$as_echo "$FILE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "cvs", so it can be a program name with args.
 set dummy cvs; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3908,6 +4166,46 @@
 fi
 
 
+# Extract the first word of "hg", so it can be a program name with args.
+set dummy hg; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_HG+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $HG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_HG="$HG" # 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_HG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+HG=$ac_cv_path_HG
+if test -n "$HG"; then
+  { $as_echo "$as_me:$LINENO: result: $HG" >&5
+$as_echo "$HG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3948,6 +4246,126 @@
 fi
 
 
+# Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LIPO+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $LIPO in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LIPO="$LIPO" # 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_LIPO="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+LIPO=$ac_cv_path_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "nice", so it can be a program name with args.
+set dummy nice; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_NICE+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $NICE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NICE="$NICE" # 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_NICE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+NICE=$ac_cv_path_NICE
+if test -n "$NICE"; then
+  { $as_echo "$as_me:$LINENO: result: $NICE" >&5
+$as_echo "$NICE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "patch", so it can be a program name with args.
+set dummy patch; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PATCH+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $PATCH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PATCH="$PATCH" # 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_PATCH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PATCH=$ac_cv_path_PATCH
+if test -n "$PATCH"; then
+  { $as_echo "$as_me:$LINENO: result: $PATCH" >&5
+$as_echo "$PATCH" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "rmdir", so it can be a program name with args.
 set dummy rmdir; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -4188,6 +4606,46 @@
 fi
 
 
+# Extract the first word of "bsdmake", so it can be a program name with args.
+set dummy bsdmake; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BSDMAKE+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $BSDMAKE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_BSDMAKE="$BSDMAKE" # 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_BSDMAKE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+BSDMAKE=$ac_cv_path_BSDMAKE
+if test -n "$BSDMAKE"; then
+  { $as_echo "$as_me:$LINENO: result: $BSDMAKE" >&5
+$as_echo "$BSDMAKE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "make", so it can be a program name with args.
 set dummy make; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -4517,6 +4975,86 @@
 fi
 
 
+# Extract the first word of "lsbom", so it can be a program name with args.
+set dummy lsbom; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LSBOM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $LSBOM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LSBOM="$LSBOM" # 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_LSBOM="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+LSBOM=$ac_cv_path_LSBOM
+if test -n "$LSBOM"; then
+  { $as_echo "$as_me:$LINENO: result: $LSBOM" >&5
+$as_echo "$LSBOM" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "mkbom", so it can be a program name with args.
+set dummy mkbom; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MKBOM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MKBOM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MKBOM="$MKBOM" # 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_MKBOM="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MKBOM=$ac_cv_path_MKBOM
+if test -n "$MKBOM"; then
+  { $as_echo "$as_me:$LINENO: result: $MKBOM" >&5
+$as_echo "$MKBOM" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "pax", so it can be a program name with args.
 set dummy pax; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7565,9 +8103,9 @@
 
 	if test "x$UNIVERSAL_SYSROOT" = "x"; then
 	    if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
-		UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
+		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
 	    else
-		UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
+		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
 	    fi
 	fi
 
@@ -10446,7 +10984,7 @@
 
 # Check whether --with-trace-sdk was given.
 if test "${with_trace_sdk+set}" = set; then
-  withval=$with_trace_sdk; test -d /Developer/SDKs/$withval && cat >>confdefs.h <<_ACEOF
+  withval=$with_trace_sdk; test -d ${DEVELOPER_DIR}/SDKs/$withval && cat >>confdefs.h <<_ACEOF
 #define TRACE_SDK "${withval}"
 _ACEOF
 

Modified: branches/gsoc09-logging/base/configure.ac
===================================================================
--- branches/gsoc09-logging/base/configure.ac	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/configure.ac	2009-06-12 08:57:53 UTC (rev 52218)
@@ -48,7 +48,10 @@
   AC_MSG_CHECKING(Xcode location)
   DEVELOPER_DIR=`$XCODE_SELECT -print-path`
   AC_MSG_RESULT([$DEVELOPER_DIR])
+else
+  DEVELOPER_DIR=/Developer
 fi
+AC_SUBST(DEVELOPER_DIR)
 
 XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
 if test -r "$XCODEPLIST"; then
@@ -84,17 +87,28 @@
 AC_PROG_MAKE_SET
 AC_PROG_LN_S
 AC_PATH_PROG(MTREE, [mtree], [], [$PATH:/usr/sbin])
+AC_PATH_PROG(CHOWN, [chown], [], [$PATH:/usr/sbin])
 AC_PATH_PROG(CP, [cp], [])
+AC_PATH_PROG(CPIO, [cpio], [])
+AC_PATH_PROG(DIFF, [diff], [])
+AC_PATH_PROG(DITTO, [ditto], [])
+AC_PATH_PROG(DSCL, [dscl], [])
+AC_PATH_PROG(FILE, [file], [])
 AC_PATH_PROG(CVS, [cvs], [])
 AC_PATH_PROG(SVN, [svn], [])
 AC_PATH_PROG(GIT, [git], [])
+AC_PATH_PROG(HG, [hg], [])
 AC_PATH_PROG(GZIP, [gzip], [])
+AC_PATH_PROG(LIPO, [lipo], [])
+AC_PATH_PROG(NICE, [nice], [])
+AC_PATH_PROG(PATCH, [patch], [])
 AC_PATH_PROG(RMDIR, [rmdir], [])
 AC_PATH_PROG(RSYNC, [rsync], [])
 AC_PATH_PROG(SED, [sed])
 AC_PATH_PROG(TAR, [tar])
 AC_PATH_PROG(UNZIP, [unzip])
 AC_PATH_PROG(ZIP, [zip])
+AC_PATH_PROG(BSDMAKE, [bsdmake])
 AC_PATH_PROG(MAKE, [make])
 AC_PATH_PROG(HDIUTIL, [hdiutil], [])
 AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
@@ -103,6 +117,8 @@
 AC_PATH_PROGS(GNUTAR, [gnutar gtar], [], [$PATH:/usr/local/bin])
 AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
 AC_PATH_PROG(BZIP2, [bzip2], [])
+AC_PATH_PROG(LSBOM, [lsbom], [])
+AC_PATH_PROG(MKBOM, [mkbom], [])
 AC_PATH_PROG(PAX, [pax], [])
 AC_PATH_PROG(XAR, [xar], [])
 AC_PATH_PROG(OPEN, [open], [])
@@ -313,7 +329,7 @@
 	trace-sdk,
 	AS_HELP_STRING([--with-trace-sdk=SDK],
 		[SDK for redirection in trace lib (for example MacOSX10.4u.sdk)]),
-	[test -d /Developer/SDKs/$withval && AC_DEFINE_UNQUOTED([TRACE_SDK], "${withval}")], [])
+	[test -d ${DEVELOPER_DIR}/SDKs/$withval && AC_DEFINE_UNQUOTED([TRACE_SDK], "${withval}")], [])
 
 # Allows building of shared libraries
 SC_ENABLE_SHARED

Modified: branches/gsoc09-logging/base/doc/macports.conf.in
===================================================================
--- branches/gsoc09-logging/base/doc/macports.conf.in	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/doc/macports.conf.in	2009-06-12 08:57:53 UTC (rev 52218)
@@ -21,6 +21,9 @@
 # paths are given in the example; it need not be uncommented.  Customizing binpath is intended for advanced users only.
 #binpath		@prefix_expanded@/bin:@prefix_expanded@/sbin:/bin:/sbin:/usr/bin:/usr/sbin
 
+# Directory containing Xcode Tools
+developer_dir       @DEVELOPER_DIR@
+
 # Directory containing Applications from ports.
 applications_dir	@MPAPPLICATIONSDIR@
 

Modified: branches/gsoc09-logging/base/doc/portgroup.7
===================================================================
--- branches/gsoc09-logging/base/doc/portgroup.7	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/doc/portgroup.7	2009-06-12 08:57:53 UTC (rev 52218)
@@ -158,26 +158,6 @@
 .Bd -literal -offset indent -compact
 xcode.destroot.settings SKIP_INSTALL=NO
 .Ed
-.It Ic xcode.universal.settings
-Settings passed to the xcode build tool when the +universal variant is selected. These settings should be in the X=Y form.
-.br
-.Sy Type:
-.Em optional
-.br
-.Sy Default:
-.Bd -literal -offset indent -compact
-ARCHS="${universal_archs}" MACOSX_DEPLOYMENT_TARGET=${universal_target}
-.Ed
-.It Ic xcode.universal.sdk
-SDK to use when the +universal variant is selected. The argument may be an absolute path to an SDK, or the canonical name of an SDK.
-.br
-.Sy Type:
-.Em optional
-.br
-.Sy Default:
-.Bd -literal -offset indent -compact
-${universal_sysroot}
-.Ed
 .El
 .Sh STANDARD PORTFILE VARIABLES AFFECTING XCODE PORTGROUP
 The following standard Portfile variables actually affect
@@ -285,6 +265,7 @@
 .It Ic set_local_library
 Sets GNUSTEP_LOCAL_LIBRARY according to the FilesystemLayout
 .br
+.El
 .Pp
 .Sh GNUSTEP PORTGROUP SUGAR
 Portfiles using gnustep PortGroup do not need to define the following variables:

Modified: branches/gsoc09-logging/base/portmgr/bots/port.rb
===================================================================
--- branches/gsoc09-logging/base/portmgr/bots/port.rb	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/portmgr/bots/port.rb	2009-06-12 08:57:53 UTC (rev 52218)
@@ -146,7 +146,7 @@
 	
 	def portversion(m, params)
 		if !isPseudo(m, params[:portname])
-			doPort(m, "info", "--version", params[:portname])
+			doPort(m, "info", "--version --revision --line --pretty", params[:portname])
 		end
 	end
 	

Modified: branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl
===================================================================
--- branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -289,6 +289,16 @@
     } else {
         set variants ""
     }
+    if {[info exists portinfo(depends_fetch)]} {
+        set depends_fetch $portinfo(depends_fetch)
+    } else {
+        set depends_fetch ""
+    }
+    if {[info exists portinfo(depends_extract)]} {
+        set depends_extract $portinfo(depends_extract)
+    } else {
+        set depends_extract ""
+    }
     if {[info exists portinfo(depends_build)]} {
         set depends_build $portinfo(depends_build)
     } else {
@@ -326,6 +336,16 @@
         set primary 0
     }
 
+    foreach fetch_dep $depends_fetch {
+        set fetch_dep [sql_escape $fetch_dep]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$fetch_dep');"
+    }
+    
+    foreach extract_dep $depends_extract {
+        set extract_dep [sql_escape $extract_dep]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$extract_dep');"
+    }
+
     foreach build_dep $depends_build {
         set build_dep [sql_escape $build_dep]
         puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$build_dep');"

Modified: branches/gsoc09-logging/base/portmgr/packaging/dpkgall.tcl
===================================================================
--- branches/gsoc09-logging/base/portmgr/packaging/dpkgall.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/portmgr/packaging/dpkgall.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -875,6 +875,12 @@
 		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} { 
 			eval "lappend depends $portinfo(depends_build)"
 		}
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} { 
+			eval "lappend depends $portinfo(depends_fetch)"
+		}
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} { 
+			eval "lappend depends $portinfo(depends_extract)"
+		}
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies_recurse $dep $includeBuildDeps]

Modified: branches/gsoc09-logging/base/portmgr/packaging/packageall.tcl
===================================================================
--- branches/gsoc09-logging/base/portmgr/packaging/packageall.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/portmgr/packaging/packageall.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -149,6 +149,13 @@
 		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
 			eval "lappend depends $portinfo(depends_build)"
 		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_fetch)]} { 
+			eval "lappend depends $portinfo(depends_fetch)"
+		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_extract)]} { 
+			eval "lappend depends $portinfo(depends_extract)"
+		}
+		
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies $dep $includeBuildDeps]

Modified: branches/gsoc09-logging/base/portmgr/packaging/rpmall.tcl
===================================================================
--- branches/gsoc09-logging/base/portmgr/packaging/rpmall.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/portmgr/packaging/rpmall.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -154,6 +154,12 @@
 		if {$includeBuildDeps != "" && [info exists portinfo(depends_build)]} { 
 			eval "lappend depends $portinfo(depends_build)"
 		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_fetch)]} { 
+			eval "lappend depends $portinfo(depends_fetch)"
+		}
+		if {$includeBuildDeps != "" && [info exists portinfo(depends_extract)]} { 
+			eval "lappend depends $portinfo(depends_extract)"
+		}
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies $dep $includeBuildDeps]

Modified: branches/gsoc09-logging/base/src/Makefile.in
===================================================================
--- branches/gsoc09-logging/base/src/Makefile.in	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/Makefile.in	2009-06-12 08:57:53 UTC (rev 52218)
@@ -14,6 +14,7 @@
 distclean::
 	rm -f config.h
 	rm -f Makefile
+	rm -f pkg_mkindex.sh
 
 test::
 

Modified: branches/gsoc09-logging/base/src/cregistry/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/cregistry/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/cregistry/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -24,4 +24,4 @@
 
 test:
 
-install:: ${STLIB_NAME}
+install:: all

Modified: branches/gsoc09-logging/base/src/macports1.0/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/macports1.0/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -15,7 +15,7 @@
 distclean:: clean
 	rm -f macports_autoconf.tcl macports_fastload.tcl ${SHLIB_NAME}
 
-install::
+install:: all
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
 
 	$(SILENT) set -x; for file in ${SRCS}; do \

Modified: branches/gsoc09-logging/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/macports.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/macports1.0/macports.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -45,7 +45,7 @@
         porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
         rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
         mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
-        applications_dir frameworks_dir universal_target universal_sysroot universal_archs \
+        applications_dir frameworks_dir developer_dir universal_target universal_sysroot universal_archs \
         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip"
     variable user_options "submitter_name submitter_email submitter_key"
     variable portinterp_options "\
@@ -54,7 +54,7 @@
         portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
         rsync_options rsync_dir startupitem_type place_worksymlink \
         mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
-        applications_dir frameworks_dir universal_target universal_sysroot universal_archs $user_options"
+        applications_dir frameworks_dir developer_dir universal_target universal_sysroot universal_archs $user_options"
 
     # deferred options are only computed when needed.
     # they are not exported to the trace thread.
@@ -250,7 +250,7 @@
 }
 
 # check for a binary in the path
-# returns an error code if it can not be found
+# returns an error code if it cannot be found
 proc macports::binaryInPath {prog} {
     global env
     foreach dir [split $env(PATH) :] {
@@ -658,20 +658,25 @@
     if {![info exists macports::buildmakejobs]} {
         set macports::buildmakejobs 0
     }
+    
+    # Default Xcode Tools path
+    if {![info exists macports::developer_dir]} {
+        set macports::developer_dir "/Developer"
+    }
 
     # Default mp universal options
     if {![info exists macports::universal_target]} {
-        if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
+        if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
             set macports::universal_target "10.5"
         } else {
             set macports::universal_target "10.4"
         }
     }
     if {![info exists macports::universal_sysroot]} {
-        if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
-            set macports::universal_sysroot "/Developer/SDKs/MacOSX10.5.sdk"
+        if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
+            set macports::universal_sysroot "${macports::developer_dir}/SDKs/MacOSX10.5.sdk"
         } else {
-            set macports::universal_sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
+            set macports::universal_sysroot "${macports::developer_dir}/SDKs/MacOSX10.4u.sdk"
         }
     }
     if {![info exists macports::universal_archs]} {
@@ -924,11 +929,11 @@
     if {![file writable $fetchdir]} {
         return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
     }
-    if {[catch {exec curl -L -s -S -o [file join $fetchdir $fetchfile] $url} result]} {
+    if {[catch {curl fetch $url [file join $fetchdir $fetchfile]} result]} {
         return -code error "Port remote fetch failed: $result"
     }
     cd $fetchdir
-    if {[catch {exec tar -zxf $fetchfile} result]} {
+    if {[catch {exec [findBinary tar $macports::autoconf::tar_path] -zxf $fetchfile} result]} {
         return -code error "Port extract failed: $result"
     }
     if {[regexp {(.+).tgz} $fetchfile match portdir] != 1} {
@@ -1110,7 +1115,7 @@
         error "Error evaluating variants"
     }
 
-    ditem_key $mport provides [$workername eval return \$portname]
+    ditem_key $mport provides [$workername eval return \$name]
 
     return $mport
 }
@@ -1284,40 +1289,50 @@
 proc _mportinstalled {mport} {
     # Check for the presence of the port in the registry
     set workername [ditem_key $mport workername]
-    return [$workername eval registry_exists_for_name \${portname}]
+    return [$workername eval registry_exists_for_name \${name}]
 }
 
 # Determine if a port is active (only for image mode)
 proc _mportactive {mport} {
     set workername [ditem_key $mport workername]
-    if {[catch {set reslist [$workername eval registry_active \${portname}]}]} {
+    if {[catch {set reslist [$workername eval registry_active \${name}]}]} {
         return 0
     } else {
         return [expr [llength $reslist] > 0]
     }
 }
 
+# Determine if the named port is active (only for image mode)
+proc _portnameactive {portname} {
+    if {[catch {set reslist [registry::active $portname]}]} {
+        return 0
+    } else {
+        return [expr [llength $reslist] > 0]
+    }
+}
+
 ### _mportispresent is private; may change without notice
 
 # Determine if some depspec is satisfied or if the given port is installed
 # (and active, if we're in image mode).
 # We actually start with the registry (faster?)
 #
-# mport     the port to test (to figure out if it's present)
+# mport     the port declaring the dep (context in which to evaluate $prefix etc)
 # depspec   the dependency test specification (path, bin, lib, etc.)
 proc _mportispresent {mport depspec} {
-    ui_debug "Searching for dependency: [ditem_key $mport provides]"
+    set portname [lindex [split $depspec :] end]
+    ui_debug "Searching for dependency: $portname"
     if {[string equal ${macports::registry.installtype} "image"]} {
-        set res [_mportactive $mport]
+        set res [_portnameactive $portname]
     } else {
-        set res [_mportinstalled $mport]
+        set res [registry::entry_exists_for_name $portname]
     }
     if {$res != 0} {
-        ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
+        ui_debug "Found Dependency: receipt exists for $portname"
         return 1
     } else {
         # The receipt test failed, use one of the depspec regex mechanisms
-        ui_debug "Didn't find receipt, going to depspec regex for: [ditem_key $mport provides]"
+        ui_debug "Didn't find receipt, going to depspec regex for: $portname"
         set type [lindex [split $depspec :] 0]
         switch $type {
             lib { return [_libtest $mport $depspec] }
@@ -1330,6 +1345,30 @@
     }
 }
 
+### _mportconflictsinstalled is private; may change without notice
+
+# Determine if the port, per the conflicts option, has any conflicts with
+# what is installed.
+#
+# mport   the port to check for conflicts
+# Returns a list of which installed ports conflict, or an empty list if none
+proc _mportconflictsinstalled {mport conflictinfo} {
+    set conflictlist {}
+    if {[llength $conflictinfo] > 0} {
+        ui_debug "Checking for conflicts against [_mportkey $mport name]"
+        foreach conflictport ${conflictinfo} {
+            if {[_mportispresent $mport port:${conflictport}]} {
+                lappend conflictlist $conflictport
+            }
+        }
+    } else {
+        ui_debug "[_mportkey $mport name] has no conflicts"
+    }
+
+    return $conflictlist
+}
+
+
 ### _mportexec is private; may change without notice
 
 proc _mportexec {target mport} {
@@ -1369,7 +1408,9 @@
     # Before we build the port, we must build its dependencies.
     # XXX: need a more general way of comparing against targets
     set dlist {}
-    if {$target == "configure" || $target == "build"
+    if {   $target == "fetch" || $target == "checksum"
+        || $target == "extract" || $target == "patch"
+        || $target == "configure" || $target == "build"
         || $target == "test"
         || $target == "destroot" || $target == "install"
         || $target == "archive"
@@ -1624,7 +1665,7 @@
                     # sync just a PortIndex file
                     set indexfile [macports::getindex $source]
                     file mkdir [file dirname $indexfile]
-                    exec curl -L -s -S -o $indexfile $source/PortIndex
+                    curl $source/PortIndex $indexfile
                 }
             }
             default {
@@ -1946,27 +1987,37 @@
 #                  dependencies ports.
 # accDeps -> accumulator for recursive calls
 # return 0 if everything was ok, an non zero integer otherwise.
-proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1} {accDepsFlag 0}} {
+proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1}} {
 
     array set portinfo [mportinfo $mport]
     set depends {}
     set deptypes {}
-    if {$accDepsFlag == 0} {
-        array set accDeps {}
-    } else {
-        upvar accDeps accDeps
-    }
 
     # progress indicator
     if {![macports::ui_isset ports_debug]} {
         ui_info -nonewline "."
         flush stdout
     }
+    
+    if {[info exists portinfo(conflicts)] && ($target == "" || $target == "install")} {
+        set conflictports [_mportconflictsinstalled $mport $portinfo(conflicts)]
+        if {[llength ${conflictports}] != 0} {
+            if {[macports::global_option_isset ports_force]} {
+                ui_warn "Force option set; installing $portinfo(name) despite conflicts with: ${conflictports}"
+            } else {
+                return -code error "Can't install $portinfo(name) because conflicting ports are installed: ${conflictports}"
+            }
+        }
+    }
 
     # Determine deptypes to look for based on target
     switch $target {
+        fetch       -
+        checksum    { set deptypes "depends_fetch" }
+        extract     -
+        patch       { set deptypes "depends_fetch depends_extract" }
         configure   -
-        build       { set deptypes "depends_lib depends_build" }
+        build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
 
         test        -
         destroot    -
@@ -1980,7 +2031,7 @@
         rpm         -
         srpm        -
         dpkg        -
-        ""          { set deptypes "depends_lib depends_build depends_run" }
+        ""          { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run" }
     }
 
     # Gather the dependencies for deptypes
@@ -1992,50 +2043,46 @@
     }
 
     set subPorts {}
+    set options [ditem_key $mport options]
+    set variations [ditem_key $mport variations]
 
     foreach depspec $depends {
-        # grab the portname portion of the depspec
-        set dep_portname [lindex [split $depspec :] end]
-
-        # Find the porturl
-        if {[catch {set res [mportlookup $dep_portname]} error]} {
-            global errorInfo
-            ui_debug "$errorInfo"
-            ui_error "Internal error: port lookup failed: $error"
-            return 1
-        }
-
-        array unset portinfo
-        array set portinfo [lindex $res 1]
-        if {[info exists portinfo(porturl)]} {
-            set porturl $portinfo(porturl)
-        } else {
-            ui_error "Dependency '$dep_portname' not found."
-            return 1
-        }
-
-        set options [ditem_key $mport options]
-        set variations [ditem_key $mport variations]
-
-        # Figure out the subport.
-        set subport [mportopen $porturl $options $variations]
-
         # Is that dependency satisfied or this port installed?
         # If we don't skip or if it is not, add it to the list.
-        if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {
-            # Append the sub-port's provides to the port's requirements list.
-            ditem_append_unique $mport requires "[ditem_key $subport provides]"
+        if {!$skipSatisfied || ![_mportispresent $mport $depspec]} {
+            # grab the portname portion of the depspec
+            set dep_portname [lindex [split $depspec :] end]
 
-            if {$recurseDeps} {
-                # Skip the port if it's already in the accumulated list.
-                if {![info exists accDeps($dep_portname)]} {
-                    # Add it to the list
-                    set accDeps($dep_portname) 1
+            # Find the porturl
+            if {[catch {set res [mportlookup $dep_portname]} error]} {
+                global errorInfo
+                ui_debug "$errorInfo"
+                ui_error "Internal error: port lookup failed: $error"
+                return 1
+            }
 
-                    # We'll recursively iterate on it.
+            array unset portinfo
+            array set portinfo [lindex $res 1]
+            if {![info exists portinfo(porturl)]} {
+                ui_error "Dependency '$dep_portname' not found."
+                return 1
+            }
+
+            # Figure out the subport. Check the open_mports list first, since
+            # we potentially leak mport references if we mportopen each time,
+            # because mportexec only closes each open mport once.
+            set subport [dlist_search $macports::open_mports porturl $portinfo(porturl)]
+            if {$subport == {}} {
+                # We haven't opened this one yet.
+                set subport [mportopen $portinfo(porturl) $options $variations]
+                if {$recurseDeps} {
+                    # Add to the list we need to recurse on.
                     lappend subPorts $subport
                 }
             }
+
+            # Append the sub-port's provides to the port's requirements list.
+            ditem_append_unique $mport requires "[ditem_key $subport provides]"
         }
     }
 
@@ -2043,7 +2090,7 @@
     if {$recurseDeps} {
         foreach subport $subPorts {
             # Sub ports should be installed (all dependencies must be satisfied).
-            set res [mportdepends $subport "" $recurseDeps $skipSatisfied 1]
+            set res [mportdepends $subport "" $recurseDeps $skipSatisfied]
             if {$res != 0} {
                 return $res
             }
@@ -2116,9 +2163,8 @@
             set owner [file attributes ${prefix} -owner]
             set group [file attributes ${prefix} -group]
             set perms [string range [file attributes ${prefix} -permissions] end-3 end]
-            set installing_user [exec /usr/bin/id -un]
-            if {![string equal $installing_user $owner]} {
-                return -code error "User $installing_user does not own ${prefix} - try using sudo"
+            if {![string equal $tcl_platform(user) $owner]} {
+                return -code error "User $tcl_platform(user) does not own ${prefix} - try using sudo"
             }
             ui_debug "Permissions OK"
 
@@ -2156,7 +2202,7 @@
     # set the MacPorts sources to the right owner
     set sources_owner [file attributes [file join $portdbpath sources/] -owner]
     ui_debug "Setting MacPorts sources ownership to $sources_owner"
-    if { [catch { exec chown -R $sources_owner [file join $portdbpath sources/] } result] } {
+    if { [catch { exec [findBinary chown $macports::autoconf::chown_path] -R $sources_owner [file join $portdbpath sources/] } result] } {
         return -code error "Couldn't change permissions of the MacPorts sources at $mp_source_path to $sources_owner: $result"
     }
 
@@ -2220,29 +2266,34 @@
     if { [catch {set ilist [registry::installed $portname ""]} result] } {
         if {$result == "Registry error: $portname not registered as installed." } {
             ui_debug "$portname is *not* installed by MacPorts"
-            # open porthandle
-            set porturl $portinfo(porturl)
-            if {![info exists porturl]} {
-                set porturl file://./
-            }
-            # Merge the global variations into the specified
-            foreach { variation value } $globalvarlist {
-                if { ![info exists variations($variation)] } {
-                    set variations($variation) $value
+
+            # We need to pass _mportispresent a reference to the mport that is
+            # actually declaring the dependency on the one we're checking for.
+            # We got here via _upgrade_dependencies, so we grab it from 2 levels up.
+            upvar 2 workername parentworker
+            if {![_mportispresent $parentworker $dspec ] } {
+                # open porthandle
+                set porturl $portinfo(porturl)
+                if {![info exists porturl]} {
+                    set porturl file://./
                 }
-            }
+                # Merge the global variations into the specified
+                foreach { variation value } $globalvarlist {
+                    if { ![info exists variations($variation)] } {
+                        set variations($variation) $value
+                    }
+                }
 
-            if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
+                if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
                     global errorInfo
                     ui_debug "$errorInfo"
                     ui_error "Unable to open port: $result"
                     return 1
-            }
-            # While we're at it, update the portinfo
-            array unset portinfo
-            array set portinfo [mportinfo $workername]
-
-            if {![_mportispresent $workername $dspec ] } {
+                }
+                # While we're at it, update the portinfo
+                array unset portinfo
+                array set portinfo [mportinfo $workername]
+                
                 # upgrade its dependencies first
                 _upgrade_dependencies portinfo depscache globalvarlist variationslist options
                 # now install it
@@ -2259,8 +2310,8 @@
                     return $result
                 }
                 # we just installed it, so mark it done in the cache
-                # and update ilist
                 set depscache(port:${portname}) 1
+                mportclose $workername
             } else {
                 # dependency is satisfied by something other than the named port
                 ui_debug "$portname not installed, soft dependency satisfied"
@@ -2269,7 +2320,6 @@
             }
             # the rest of the proc doesn't matter for a port that is freshly
             # installed or not installed
-            mportclose $workername
             return 0
         } else {
             ui_error "Checking installed version failed: $result"
@@ -2583,7 +2633,7 @@
     unset -nocomplain options(ports_do_dependents)
 
     # each dep type is upgraded
-    foreach dtype {depends_build depends_lib depends_run} {
+    foreach dtype {depends_fetch depends_extract depends_build depends_lib depends_run} {
         if {[info exists portinfo($dtype)]} {
             foreach i $portinfo($dtype) {
                 set d [lindex [split $i :] end]

Modified: branches/gsoc09-logging/base/src/macports1.0/macports_autoconf.tcl.in
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/macports_autoconf.tcl.in	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/macports1.0/macports_autoconf.tcl.in	2009-06-12 08:57:53 UTC (rev 52218)
@@ -32,6 +32,7 @@
 package provide macports 1.0
 
 namespace eval macports::autoconf {
+    variable chown_path "@CHOWN@"
     variable gzip_path "@GZIP@"
     variable macports_conf_path "@MPCONFIGDIR_EXPANDED@"
     variable macports_version "@MACPORTS_VERSION@"

Modified: branches/gsoc09-logging/base/src/macports1.0/macports_fastload.tcl.in
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/macports_fastload.tcl.in	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/macports1.0/macports_fastload.tcl.in	2009-06-12 08:57:53 UTC (rev 52218)
@@ -73,8 +73,11 @@
 set dir [file join "@TCL_PACKAGE_DIR@" macports1.0]
 catch {source [file join $dir pkgIndex.tcl]}
 
-foreach dir [glob -directory "@prefix_expanded@" -join share macports Tcl *] {
-	catch {source [file join $dir pkgIndex.tcl]}
+set sharetcldir [file join "@prefix_expanded@" share macports Tcl]
+if {[file exists $sharetcldir]} {
+	foreach dir [glob -directory $sharetcldir *] {
+		catch {source [file join $dir pkgIndex.tcl]}
+	}
 }
 
 if { "@SQLITE3_DIR@" != "" } {

Modified: branches/gsoc09-logging/base/src/package1.0/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -13,11 +13,11 @@
 clean::
 	rm -f pkgIndex.tcl
 
-distclean::
+distclean:: clean
 
 test::
 
-install::
+install:: all
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
 	$(SILENT)set -x; for file in ${SRCS}; do \
 		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \

Modified: branches/gsoc09-logging/base/src/package1.0/portarchive.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portarchive.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portarchive.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -67,7 +67,7 @@
 	global UI_PREFIX target_state_fd
 	global variations package.destpath workpath
 	global ports_force ports_source_only ports_binary_only
-	global portname portversion portrevision portvariants
+	global name version revision portvariants
 	global archive.destpath archive.type archive.meta
 	global archive.file archive.path archive.fulldestpath
 
@@ -100,17 +100,17 @@
 	if {[check_statefile target org.macports.archive $target_state_fd]} {
 		return 0
 	} elseif {[check_statefile target org.macports.unarchive $target_state_fd] && ([info exists ports_binary_only] && $ports_binary_only == "yes")} {
-		ui_debug "Skipping archive ($portname) since binary-only is set"
+		ui_debug "Skipping archive ($name) since binary-only is set"
 		set skipped 1
 	} elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
-		ui_debug "Skipping archive ($portname) since source-only is set"
+		ui_debug "Skipping archive ($name) since source-only is set"
 		set skipped 1
 	} else {
 		set unsupported 0
 		set any_missing no
 		foreach archive.type [option portarchivetype] {
 			if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
-				set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
+				set archive.file "${name}-${version}_${revision}${portvariants}.[option os.arch].${archive.type}"
 				set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
 				if {![file exists ${archive.path}]} {
 				    set any_missing yes
@@ -122,14 +122,14 @@
 		}
 		if {!$any_missing} {
 			# might be nice to allow forcing, but let's fix #16061 first
-			ui_debug "Skipping archive ($portname) since archive(s) already exist"
+			ui_debug "Skipping archive ($name) since archive(s) already exist"
 			set skipped 1
 		}
 		if {${archive.type} == "xpkg"} {
 			set archive.meta true
 		}
 		if {[llength [option portarchivetype]] == $unsupported} {
-			ui_debug "Skipping archive ($portname) since specified archive types not supported"
+			ui_debug "Skipping archive ($name) since specified archive types not supported"
 			set skipped 1
 		}
 	}
@@ -143,12 +143,12 @@
 
 proc portarchive::archive_start {args} {
 	global UI_PREFIX
-	global portname portversion portrevision portvariants
+	global name version revision portvariants
 
 	if {[llength [option portarchivetype]] > 1} {
-		ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
+		ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $name $version $revision $portvariants]"
 	} else {
-		ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
+		ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $name $version $revision $portvariants]"
 	}
 
 	return 0
@@ -296,7 +296,7 @@
 proc portarchive::archive_main {args} {
 	global UI_PREFIX variations
 	global workpath destpath portpath ports_force
-	global portname portepoch portversion portrevision portvariants
+	global name epoch version revision portvariants
 	global archive.fulldestpath archive.type archive.file archive.path
 	global archive.meta archive.metaname archive.metapath
 	global os.platform os.arch
@@ -313,7 +313,7 @@
 
 	# Copy state file into destroot for archiving
 	# +STATE contains a copy of the MacPorts state information
-    set statefile [file join $workpath .macports.${portname}.state]
+    set statefile [file join $workpath .macports.${name}.state]
 	file copy -force $statefile [file join $destpath "+STATE"]
 
 	# Copy Portfile into destroot for archiving
@@ -348,18 +348,21 @@
 	# files and checksums
 	set control [list]
 	set fd [open [file join $destpath "+CONTENTS"] w]
-	puts $fd "@name ${portname}-${portversion}_${portrevision}${portvariants}"
-	puts $fd "@portname ${portname}"
-	puts $fd "@portepoch ${portepoch}"
-	puts $fd "@portversion ${portversion}"
-	puts $fd "@portrevision ${portrevision}"
+	puts $fd "@name ${name}-${version}_${revision}${portvariants}"
+	puts $fd "@portname ${name}"
+	puts $fd "@portepoch ${epoch}"
+	puts $fd "@portversion ${version}"
+	puts $fd "@portrevision ${revision}"
 	set vlist [lsort -ascii [array names variations]]
 	foreach v $vlist {
 		if {![string equal $v [option os.platform]] && ![string equal $v [option os.arch]]} {
 			puts $fd "@portvariant +${v}"
 		}
 	}
-	foreach fullpath [exec find $destpath ! -type d] {
+	fs-traverse fullpath $destpath {
+	    if {[file isdirectory $fullpath]} {
+	        continue
+	    }
 		set relpath [strsed $fullpath "s|^$destpath/||"]
 		if {![regexp {^[+]} $relpath]} {
 			puts $fd "$relpath"
@@ -388,10 +391,10 @@
 		# TODO: split contents into <buildinfo> (new) and <package> (current)
 		#       see existing <portpkg> for the matching source package layout
 
-		putel $sd name ${portname}
-		putel $sd epoch ${portepoch}
-		putel $sd version ${portversion}
-		putel $sd revision ${portrevision}
+		putel $sd name ${name}
+		putel $sd epoch ${epoch}
+		putel $sd version ${version}
+		putel $sd revision ${revision}
 		putel $sd major 0
 		putel $sd minor 0
 
@@ -416,7 +419,7 @@
 
             # Emit dependencies provided by this package
             puts $sd "<provides>"
-                set name ${portname}
+                set name ${name}
                 puts $sd "<item>"
                 putel $sd name $name
                 putel $sd major 0
@@ -424,15 +427,17 @@
                 puts $sd "</item>"
             puts $sd "</provides>"
             
-    set res [mport_lookup $portname]
+    set res [mport_lookup $name]
     if {[llength $res] < 2} {
-        ui_error "Dependency $portname not found"
+        ui_error "Dependency $name not found"
     } else {
     array set portinfo [lindex $res 1]
 
             # Emit build, library, and runtime dependencies
             puts $sd "<requires>"
             foreach {key type} {
+                depends_fetch "fetch"
+                depends_extract "extract"
                 depends_build "build"
                 depends_lib "library"
                 depends_run "runtime"
@@ -458,7 +463,7 @@
 	foreach archive.type [option portarchivetype] {
 		if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
 			# Define archive file/path
-			set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
+			set archive.file "${name}-${version}_${revision}${portvariants}.[option os.arch].${archive.type}"
 			set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
 
 			# Setup archive command
@@ -481,7 +486,7 @@
 
 proc portarchive::archive_finish {args} {
 	global UI_PREFIX
-	global portname portversion portrevision portvariants
+	global name version revision portvariants
 	global destpath
 
 	# Cleanup all control files when finished
@@ -492,9 +497,9 @@
 	}
 
 	if {[llength [option portarchivetype]] > 1} {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $portname $portversion $portrevision $portvariants]"
+		ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
 	} else {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $portname $portversion $portrevision $portvariants]"
+		ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
 	}
 	return 0
 }

Modified: branches/gsoc09-logging/base/src/package1.0/portdmg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portdmg.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portdmg.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -44,11 +44,11 @@
 set_ui_prefix
 
 proc portdmg::dmg_main {args} {
-    global portname portversion portrevision package.destpath UI_PREFIX
+    global name version revision package.destpath UI_PREFIX
     
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${portname} ${portversion}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${name} ${version}]"
     
-    return [package_dmg $portname $portversion $portrevision]
+    return [package_dmg $name $version $revision]
 }
 
 proc portdmg::package_dmg {portname portversion portrevision} {
@@ -89,20 +89,23 @@
         set subdev 2
     }
     
-    if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
+    set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
+    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
     }
-    if {[catch {set devicename [exec hdid ${tmp_image} | grep s${subdev} | awk "{ print \$1 }"]} error]} {
+    if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
         return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
     }
-    set mount_point [exec mount | grep "${devicename}"]
+    set attach_output [split $attach_output "\t"]
+    set devicename [string trim [lindex $attach_output 0]]
+    set mount_point [string trim [lindex $attach_output 2]]
     regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
-    system "ditto -rsrcFork ${pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"
-    system "hdiutil detach ${devicename} -quiet"
-    if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
+    system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"
+    system "$hdiutil detach ${devicename} -quiet"
+    if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
         return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
     }
-    if {[system "hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
+    if {[system "$hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to internet-enable: %s"] ${final_image}]
     }
     file delete -force "${tmp_image}"

Modified: branches/gsoc09-logging/base/src/package1.0/portdpkg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portdpkg.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portdpkg.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -50,16 +50,16 @@
 proc portdpkg::main {args} {
 	global UI_PREFIX destpath os.arch os.platform
     
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option portname] [option portversion]]"
+	ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option name] [option version]]"
 
 	# get deplist
-	set deps [make_dependency_list [option portname]]
+	set deps [make_dependency_list [option name]]
 	set deps [lsort -unique $deps]
 	foreach dep $deps {
 		set name [lindex [split $dep /] 0]
 		set vers [lindex [split $dep /] 1]
 		# don't re-package ourself
-		if {$name != [option portname]} {
+		if {$name != [option name]} {
 			lappend dependencies "${name} (>= ${vers})"
 		}
 	}
@@ -93,9 +93,9 @@
 	
 	# Create dpkg version number
 	if {[expr [option epoch] != 0]} {
-		set pkg_version "[option epoch]:[option portversion]"
+		set pkg_version "[option epoch]:[option version]"
 	} else {
-		set pkg_version "[option portversion]"
+		set pkg_version "[option version]"
 	}
 	if {[expr [option revision] != 0]} {
 		append pkg_version "-[option revision]"
@@ -110,7 +110,7 @@
 	} elseif {[exists description]} {
 		set pkg_long_description " [option description]\n"
 	} else {
-		set pkg_long_description " [option portname]\n"
+		set pkg_long_description " [option name]\n"
 	}
 
 	if {[exists homepage]} {
@@ -137,7 +137,7 @@
 		set pkg_arch "${os.platform}-${pkg_arch}"
 	}
 
-	puts $controlfd "Package: [option portname]"
+	puts $controlfd "Package: [option name]"
 	puts $controlfd "Architecture: ${pkg_arch}"
 	puts $controlfd "Version: ${pkg_version}"
 	puts $controlfd "Section: ${pkg_category}"

Modified: branches/gsoc09-logging/base/src/package1.0/portmdmg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portmdmg.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portmdmg.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -44,11 +44,11 @@
 set_ui_prefix
 
 proc portmdmg::mdmg_main {args} {
-    global portname portversion portrevision package.destpath UI_PREFIX
+    global name version revision package.destpath UI_PREFIX
     
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${portname} ${portversion}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${name} ${version}]"
     
-    return [package_mdmg $portname $portversion $portrevision]
+    return [package_mdmg $name $version $revision]
 }
 
 proc portmdmg::package_mdmg {portname portversion portrevision} {
@@ -88,27 +88,30 @@
 	# Apple_partition_scheme (Apple_partition_map is at s1)
         set subdev 2
     }
-    
+
+  set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
   if {false} {
-    if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
+    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
     }
-    if {[catch {set devicename [exec hdid ${tmp_image} | grep s${subdev} | awk "{ print \$1 }"]} error]} {
+    if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
         return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
     }
-    set mount_point [exec mount | grep "${devicename}"]
+    set attach_output [split $attach_output "\t"]
+    set devicename [string trim [lindex $attach_output 0]]
+    set mount_point [string trim [lindex $attach_output 2]]
     regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
-    system "ditto -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
-    system "hdiutil detach ${devicename} -quiet"
+    system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
+    system "$hdiutil detach ${devicename} -quiet"
   } else {
-    if {[system "hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
+    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
     }
   }
-    if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
+    if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
         return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
     }
-    if {[system "hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
+    if {[system "$hdiutil internet-enable -quiet -yes ${final_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to internet-enable: %s"] ${final_image}]
     }
     file delete -force "${tmp_image}"

Modified: branches/gsoc09-logging/base/src/package1.0/portmpkg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portmpkg.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portmpkg.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -47,12 +47,12 @@
 set_ui_prefix
 
 proc portmpkg::mpkg_main {args} {
-    global portname portversion portrevision package.destpath package.flat UI_PREFIX
+    global name version revision package.destpath package.flat UI_PREFIX
 
     # Make sure the destination path exists.
     system "mkdir -p ${package.destpath}"
 
-    return [package_mpkg $portname $portversion $portrevision]
+    return [package_mpkg $name $version $revision]
 }
 
 proc portmpkg::make_dependency_list {portname} {

Modified: branches/gsoc09-logging/base/src/package1.0/portpkg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portpkg.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portpkg.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -55,11 +55,11 @@
 set_ui_prefix
 
 proc portpkg::pkg_main {args} {
-    global portname portversion portrevision package.type package.destpath package.flat UI_PREFIX
+    global name version revision package.type package.destpath package.flat UI_PREFIX
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${portname} ${portversion}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${name} ${version}]"
 
-    return [package_pkg $portname $portversion $portrevision]
+    return [package_pkg $name $version $revision]
 }
 
 proc portpkg::package_pkg {portname portversion portrevision} {
@@ -73,7 +73,7 @@
         return 0
     }
 
-    set packagemaker "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
+    set packagemaker "[option developer_dir]/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
     if ([file exists "$packagemaker"]) {
         set resourcepath ${workpath}/pkg_resources
     } else {
@@ -81,7 +81,8 @@
     }
 
     set language "English"
-    system "mkdir -p -m 0755 ${resourcepath}/$language.lproj"
+    file mkdir "${resourcepath}/${language}.lproj"
+    file attributes "${resourcepath}/${language}.lproj" -permissions 0755
 	
     # long_description, description, or homepage may not exist
     foreach variable {long_description description homepage} {
@@ -135,8 +136,8 @@
         write_PkgInfo ${pkgpath}/Contents/PkgInfo
         write_info_plist ${pkgpath}/Contents/Info.plist $portname $portversion $portrevision
 
-        system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom"
-        system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
+        system "[findBinary mkbom $portutil::autoconf::mkbom_path] ${destpath} ${pkgpath}/Contents/Archive.bom"
+        system "cd ${destpath} && [findBinary pax $portutil::autoconf::pax_path] -x [findBinary cpio $portutil::autoconf::cpio_path] -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
 
         write_description_plist ${resourcepath}/Description.plist $portname $portversion $description
         write_sizes_file ${resourcepath}/Archive.sizes ${portname} ${portversion} ${pkgpath} ${destpath}
@@ -146,9 +147,10 @@
     foreach dir {etc var tmp} {
         if ([file exists "${destpath}/private/$dir"]) {
             # restore any directories that were moved, to avoid confusing the rest of the ports system.
-            system "mv ${destpath}/private/$dir ${destpath}/$dir; rmdir ${destpath}/private 2>/dev/null"
+            file rename ${destpath}/private/$dir ${destpath}/$dir
         }
     }
+    catch {file delete ${destpath}/private}
 
     return 0
 }
@@ -297,7 +299,7 @@
 
 proc portpkg::write_sizes_file {sizesfile portname portversion pkgpath destpath} {
     
-    if {[catch {set numFiles [exec lsbom -s ${pkgpath}/Contents/Archive.bom | wc -l]} result]} {
+    if {[catch {set numFiles [llength [split [exec [findBinary lsbom $portutil::autoconf::lsbom_path] -s ${pkgpath}/Contents/Archive.bom] "\n"]]} result]} {
         return -code error [format [msgcat::mc "Reading package bom failed: %s"] $result]
     }
     if {[catch {set compressedSize [expr [dirSize ${pkgpath}] / 1024]} result]} {

Modified: branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -90,18 +90,18 @@
 
 
 proc portportpkg::create_portpkg {} {
-    global portname portversion prefix UI_PREFIX workpath portpath
+    global name prefix UI_PREFIX workpath portpath
 
 	set xar [xar_path]
 	
     set dirname "portpkg"
     set dirpath "${workpath}/${dirname}"
-    set pkgpath "${workpath}/${portname}.portpkg"
+    set pkgpath "${workpath}/${name}.portpkg"
     set metaname "portpkg_meta.xml"
     set metapath "${workpath}/${metaname}"
     
     # Expose and default some global variables
-    set vars " portname portversion maintainers categories description \
+    set vars " maintainers categories description \
     	long_description master_sites homepage epoch version revision \
     	PortInfo \
     	submitter_name submitter_email submitter_key \
@@ -141,7 +141,7 @@
 		puts $sd "</submitter>"
 		
 		puts $sd "<package>"
-			putel $sd name $portname
+			putel $sd name $name
 			putel $sd homepage $homepage
 			putlist $sd categories category $categories
 			putlist $sd maintainers maintainer $maintainers
@@ -187,7 +187,7 @@
     # 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 -code error [format [msgcat::mc "Failed to create portpkg for port : %s"] $name]
     }
     
     return ${pkgpath}
@@ -195,9 +195,9 @@
 
 
 proc portportpkg::portpkg_main {args} {
-    global portname portversion portverbose prefix UI_PREFIX workpath portpath
+    global name version portverbose prefix UI_PREFIX workpath portpath
     
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating portpkg for %s-%s"] ${portname} ${portversion}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating portpkg for %s-%s"] ${name} ${version}]"
 
     # Make sure we have a work directory
     file mkdir ${workpath}

Modified: branches/gsoc09-logging/base/src/package1.0/portrpm.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portrpm.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portrpm.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -46,11 +46,11 @@
 set_ui_prefix
 
 proc portrpm::rpm_main {args} {
-    global portname portversion portrevision UI_PREFIX
+    global name version revision UI_PREFIX
     
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating RPM package for %s-%s"] ${portname} ${portversion}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating RPM package for %s-%s"] ${name} ${version}]"
     
-    return [rpm_pkg $portname $portversion $portrevision]
+    return [rpm_pkg $name $version $revision]
 }
 
 proc portrpm::rpm_pkg {portname portversion portrevision} {

Modified: branches/gsoc09-logging/base/src/package1.0/portsrpm.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portsrpm.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portsrpm.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -47,11 +47,11 @@
 set_ui_prefix
 
 proc portsrpm::srpm_main {args} {
-    global portname portversion portrevision UI_PREFIX
+    global name version revision UI_PREFIX
     
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating SRPM package for %s-%s"] ${portname} ${portversion}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating SRPM package for %s-%s"] ${name} ${version}]"
     
-    return [srpm_pkg $portname $portversion $portrevision]
+    return [srpm_pkg $name $version $revision]
 }
 
 proc portsrpm::srpm_pkg {portname portversion portrevision} {
@@ -135,10 +135,13 @@
     foreach {name array} $res {
         array set portinfo $array
 	
-        if {[info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
-            # get the union of depends_build and depends_lib
+        if {[info exists portinfo(depends_fetch)] || [info exists portinfo(depends_extract)]
+            || [info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
+            # get the union of depends_fetch, depends_extract, depends_build and depends_lib
             # xxx: only examines the portfile component of the depspec
             set depends {}
+            if {[info exists portinfo(depends_fetch)]} { eval "lappend depends $portinfo(depends_fetch)" }
+            if {[info exists portinfo(depends_extract)]} { eval "lappend depends $portinfo(depends_extract)" }
             if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
             if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
 	    

Modified: branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -63,7 +63,7 @@
 proc portunarchive::unarchive_init {args} {
 	global UI_PREFIX target_state_fd variations workpath
 	global ports_force ports_source_only ports_binary_only
-	global portname portversion portrevision portvariants portpath
+	global name version revision portvariants portpath
 	global unarchive.srcpath unarchive.type unarchive.file unarchive.path unarchive.fullsrcpath
 
 	# Check mode in case archive called directly by user
@@ -95,20 +95,20 @@
 	if {[check_statefile target org.macports.unarchive $target_state_fd]} {
 		return 0
 	} elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
-		ui_debug "Skipping unarchive ($portname) since source-only is set"
+		ui_debug "Skipping unarchive ($name) since source-only is set"
 		set skipped 1
 	} elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
-		ui_debug "Skipping unarchive ($portname) since destroot completed"
+		ui_debug "Skipping unarchive ($name) since destroot completed"
 		set skipped 1
 	} elseif {[info exists ports_force] && $ports_force == "yes"} {
-		ui_debug "Skipping unarchive ($portname) since force is set"
+		ui_debug "Skipping unarchive ($name) since force is set"
 		set skipped 1
 	} else {
 		set found 0
 		set unsupported 0
 		foreach unarchive.type [option portarchivetype] {
 			if {[catch {archiveTypeIsSupported ${unarchive.type}} errmsg] == 0} {
-				set unarchive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${unarchive.type}"
+				set unarchive.file "${name}-${version}_${revision}${portvariants}.[option os.arch].${unarchive.type}"
 				set unarchive.path "[file join ${unarchive.fullsrcpath} ${unarchive.file}]"
 				if {[file exist ${unarchive.path}]} {
 					set found 1
@@ -125,12 +125,12 @@
 			ui_debug "Found [string toupper ${unarchive.type}] archive: ${unarchive.path}"
 		} else {
 			if {[info exists ports_binary_only] && $ports_binary_only == "yes"} {
-				return -code error "Archive for ${portname} ${portversion}_${portrevision}${portvariants} not found, required when binary-only is set!"
+				return -code error "Archive for ${name} ${version}_${revision}${portvariants} not found, required when binary-only is set!"
 			} else {
 				if {[llength [option portarchivetype]] == $unsupported} {
-					ui_debug "Skipping unarchive ($portname) since specified archive types not supported"
+					ui_debug "Skipping unarchive ($name) since specified archive types not supported"
 				} else {
-					ui_debug "Skipping unarchive ($portname) since no archive found"
+					ui_debug "Skipping unarchive ($name) since no archive found"
 				}
 				set skipped 1
 			}
@@ -145,10 +145,10 @@
 }
 
 proc portunarchive::unarchive_start {args} {
-	global UI_PREFIX portname portversion portrevision portvariants
+	global UI_PREFIX name version revision portvariants
 	global unarchive.type
 
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Unpacking ${unarchive.type} archive for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
+	ui_msg "$UI_PREFIX [format [msgcat::mc "Unpacking ${unarchive.type} archive for %s %s_%s%s"] $name $version $revision $portvariants]"
 
 	return 0
 }
@@ -271,7 +271,7 @@
 
 proc portunarchive::unarchive_main {args} {
 	global UI_PREFIX
-	global portname portversion portrevision portvariants
+	global name version revision portvariants
 	global unarchive.dir unarchive.file unarchive.pipe_cmd
 
 	# Setup unarchive command
@@ -294,12 +294,12 @@
 }
 
 proc portunarchive::unarchive_finish {args} {
-	global UI_PREFIX target_state_fd unarchive.file portname workpath destpath
+	global UI_PREFIX target_state_fd unarchive.file name workpath destpath
 
 	# Reset state file with archive version
-    set statefile [file join $workpath .macports.${portname}.state]
+    set statefile [file join $workpath .macports.${name}.state]
 	file copy -force [file join $destpath "+STATE"] $statefile
-	exec touch $statefile
+	file mtime $statefile [clock seconds]
 
 # Hack to temporarily move com.apple.* strings in statefiles extracted from old archives
 # to the org.macports.* namespace. "temporarily" because old archives will still have a

Modified: branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c	2009-06-12 08:57:53 UTC (rev 52218)
@@ -574,7 +574,7 @@
 
 	if(onoblock && ounlock) {
 	  /* should not be specified together */
-	  Tcl_SetResult(interp, "-noblock can not be used with -unlock", TCL_STATIC);
+	  Tcl_SetResult(interp, "-noblock cannot be used with -unlock", TCL_STATIC);
 	  return TCL_ERROR;
 	}
 	  
@@ -1165,6 +1165,7 @@
 	Tcl_CreateObjCommand(interp, "setegid", setegidCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "name_to_uid", name_to_uidCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "uid_to_name", uid_to_nameCmd, NULL, NULL);
+	Tcl_CreateObjCommand(interp, "uname_to_gid", uname_to_gidCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "name_to_gid", name_to_gidCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "gid_to_name", gid_to_nameCmd, NULL, NULL);
 	

Modified: branches/gsoc09-logging/base/src/pextlib1.0/filemap.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/filemap.c	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/pextlib1.0/filemap.c	2009-06-12 08:57:53 UTC (rev 52218)
@@ -92,7 +92,6 @@
 #endif
 
 #include <tcl.h>
-#include <tclDecls.h>
 
 #include "filemap.h"
 #include "strcasecmp.h"
@@ -707,6 +706,8 @@
 					ckfree((char*) theSubnode);
 					*theSubnodeCursor = 0;
 				}
+				
+				theSubnodeCursor++;
 			}
 		}
 		

Modified: branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c	2009-06-12 08:57:53 UTC (rev 52218)
@@ -223,7 +223,6 @@
 			append_allow("/sbin", 0);
 			append_allow("/dev", 0);
 			append_allow(Tcl_GetVar(interp, "macports::prefix", TCL_GLOBAL_ONLY), 2);
-			append_allow("/Applications/MacPorts", 0);
 			/* If there is no SDK we will allow everything in /usr /System/Library etc, else add binaries to allow, and redirect root to SDK. */
 			if(sdk&&*sdk)
 			{
@@ -234,7 +233,6 @@
 				append_allow("/usr/sbin", 0);
 				append_allow("/usr/libexec/gcc", 0);
 				append_allow("/System/Library/Perl", 0);
-				append_allow("/usr/X11R6/bin", 0);
 				append_allow("/", 1);
 				strcpy(t-1, buf);
 				t+=strlen(t)+1;

Modified: branches/gsoc09-logging/base/src/pextlib1.0/tty.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/tty.c	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/pextlib1.0/tty.c	2009-06-12 08:57:53 UTC (rev 52218)
@@ -47,80 +47,82 @@
 
 #include "tty.h"
 
-int IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+int
+IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
-        Tcl_Obj *tcl_result;
-        Tcl_Channel chan;
-        int dir;
-        int fd;
-        int rval;
+    Tcl_Obj *tcl_result;
+    Tcl_Channel chan;
+    int dir;
+    int fd;
+    int rval;
 
-        if (objc != 2) {
-            Tcl_WrongNumArgs(interp, 1, objv, "channel");
-            return TCL_ERROR;
-        }
+    if (objc != 2) {
+        Tcl_WrongNumArgs(interp, 1, objv, "channel");
+        return TCL_ERROR;
+    }
 
-        chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
-        if (chan == NULL) {
-            Tcl_SetResult(interp, "no such channel", TCL_STATIC);
-            return TCL_ERROR;
-        }
+    chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
+    if (chan == NULL) {
+        Tcl_SetResult(interp, "no such channel", TCL_STATIC);
+        return TCL_ERROR;
+    }
 
-        if (Tcl_GetChannelHandle(chan,
-                dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
-                (ClientData*) &fd) == TCL_ERROR) {
-            return TCL_ERROR;
-        }
+    if (Tcl_GetChannelHandle(chan,
+            dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
+            (ClientData*) &fd) == TCL_ERROR) {
+        return TCL_ERROR;
+    }
 
-        rval = isatty(fd);
+    rval = isatty(fd);
 
-        tcl_result = Tcl_NewIntObj(rval);
-        Tcl_SetObjResult(interp, tcl_result);
+    tcl_result = Tcl_NewIntObj(rval);
+    Tcl_SetObjResult(interp, tcl_result);
 
-        return TCL_OK;
+    return TCL_OK;
 }
 
-int TermGetSizeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+int
+TermGetSizeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
-        Tcl_Obj *tcl_result;
-        Tcl_Channel chan;
-        int dir;
-        int fd;
-        Tcl_Obj *robjv[2];
-        struct winsize ws = {0, 0, 0, 0};
+    Tcl_Obj *tcl_result;
+    Tcl_Channel chan;
+    int dir;
+    int fd;
+    Tcl_Obj *robjv[2];
+    struct winsize ws = {0, 0, 0, 0};
 
-        if (objc != 2) {
-                Tcl_WrongNumArgs(interp, 1, objv, "channel");
-                return TCL_ERROR;
-        }
+    if (objc != 2) {
+        Tcl_WrongNumArgs(interp, 1, objv, "channel");
+        return TCL_ERROR;
+    }
 
-        chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
-        if (chan == NULL) {
-            Tcl_SetResult(interp, "no such channel", TCL_STATIC);
-            return TCL_ERROR;
-        }
+    chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
+    if (chan == NULL) {
+        Tcl_SetResult(interp, "no such channel", TCL_STATIC);
+        return TCL_ERROR;
+    }
 
-        if (Tcl_GetChannelHandle(chan,
-                dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
-                (ClientData*) &fd) == TCL_ERROR) {
-            return TCL_ERROR;
-        }
+    if (Tcl_GetChannelHandle(chan,
+            dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
+            (ClientData*) &fd) == TCL_ERROR) {
+        return TCL_ERROR;
+    }
 
-        if (!isatty(fd)) {
-            Tcl_SetResult(interp, "channel is not connected to a tty", TCL_STATIC);
-            return TCL_ERROR;
-        }
+    if (!isatty(fd)) {
+        Tcl_SetResult(interp, "channel is not connected to a tty", TCL_STATIC);
+        return TCL_ERROR;
+    }
 
-        if (ioctl(fd, TIOCGWINSZ, &ws) == -1) {
-            Tcl_SetResult(interp, "ioctl failed", TCL_STATIC);
-            return TCL_ERROR;
-        }
+    if (ioctl(fd, TIOCGWINSZ, &ws) == -1) {
+        Tcl_SetResult(interp, "ioctl failed", TCL_STATIC);
+        return TCL_ERROR;
+    }
 
-        robjv[0] = Tcl_NewIntObj(ws.ws_row);
-        robjv[1] = Tcl_NewIntObj(ws.ws_col);
+    robjv[0] = Tcl_NewIntObj(ws.ws_row);
+    robjv[1] = Tcl_NewIntObj(ws.ws_col);
 
-        tcl_result = Tcl_NewListObj(2, robjv);
-        Tcl_SetObjResult(interp, tcl_result);
+    tcl_result = Tcl_NewListObj(2, robjv);
+    Tcl_SetObjResult(interp, tcl_result);
 
-        return TCL_OK;
+    return TCL_OK;
 }

Modified: branches/gsoc09-logging/base/src/pextlib1.0/uid.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/uid.c	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/pextlib1.0/uid.c	2009-06-12 08:57:53 UTC (rev 52218)
@@ -274,7 +274,43 @@
 }
 
 /*
+	uname_to_gid
+	
+	synopsis: uname_to_gid name
+	this function takes a *user* name
+*/
+int uname_to_gidCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+{
+	struct passwd *pwent;
+	char* name = NULL;
+	
+	/* Check the arg count */
+	if (objc != 2) {
+		Tcl_WrongNumArgs(interp, 1, objv, "name");
+		return TCL_ERROR;
+	}
+	
+	/* Get the  name */
+	name = Tcl_GetString(objv[1]);
+	if (name == NULL || !*name)
+		return TCL_ERROR;
+	
+	/* Map the name --> user gid */
+	pwent = getpwnam(name);
+
+	if (pwent == NULL)
+		Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
+	else
+		Tcl_SetObjResult(interp, Tcl_NewIntObj(pwent->pw_gid)); 
+
+	return TCL_OK;
+}
+
+/*
     name_to_gid
+
+	synopsis: name_to_gid name
+    this function takes a *group* name
 */
 int name_to_gidCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {

Modified: branches/gsoc09-logging/base/src/pextlib1.0/uid.h
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/uid.h	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/pextlib1.0/uid.h	2009-06-12 08:57:53 UTC (rev 52218)
@@ -45,6 +45,7 @@
 int setegidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
 int name_to_uidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
 int uid_to_nameCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+int uname_to_gidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
 int name_to_gidCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
 int gid_to_nameCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
 

Modified: branches/gsoc09-logging/base/src/port/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/port/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -8,6 +8,8 @@
 
 include ../../Mk/macports.autoconf.mk
 
+.PHONY: mkdirs
+
 all: ${SCRIPTS}
 
 portmirror: portmirror.tcl ../../Mk/macports.autoconf.mk
@@ -29,7 +31,7 @@
 
 distclean: clean
 
-install: port portindex portmirror mkdirs
+install: all mkdirs
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/bin
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/var/macports
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 555 port portindex portmirror ${INSTALLDIR}/bin/

Modified: branches/gsoc09-logging/base/src/port/port-help.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port/port-help.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port/port-help.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -139,7 +139,7 @@
 to be included in the resulting report. Multiple fields may be specified, in
 which case all will be included.  If no fields are specified, a useful default
 set will be used.  The other options which do not correspond to fields are:
-   --depends   An abbreviation for all three depends_* fields
+   --depends   An abbreviation for all depends_* fields
    --index     Do not read the Portfile, instead rely solely on the index
                information. Note this option will prevent the information
                reported from reflecting the effects of any variants specified.

Modified: branches/gsoc09-logging/base/src/port/port.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port/port.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port/port.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -94,9 +94,9 @@
 
 Additional pseudo-portnames start with...
 variants:, variant:, description:, depends:, depends_lib:, depends_run:,
-depends_build:, portdir:, homepage:, epoch:, platforms:, platform:, name:,
-long_description:, maintainers:, maintainer:, categories:, category:, version:,
-and revision:.
+depends_build:, depends_fetch:, depends_extract:, portdir:, homepage:, epoch:,
+platforms:, platform:, name:, long_description:, maintainers:, maintainer:,
+categories:, category:, version:, and revision:.
 These each select a set of ports based on a regex search of metadata
 about the ports. In all such cases, a standard regex pattern following
 the colon will be used to select the set of ports to which the
@@ -934,6 +934,8 @@
         ^depends_lib:       -
         ^depends_build:     -
         ^depends_run:       -
+        ^depends_extract:   -
+        ^depends_fetch:     -
         ^revision:          { # Handle special port selectors
             advance
 
@@ -947,7 +949,7 @@
             set el 1
         }
 
-        ^depends:           { # A port selector shorthand for depends_lib, depends_build or depends_run
+        ^depends:           { # A port selector shorthand for depends_{lib,build,run,fetch,extract}
             advance
 
             # Break up the token, because older Tcl switch doesn't support -matchvar
@@ -956,6 +958,8 @@
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_lib"]
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_build"]
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_run"]
+            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_extract"]
+            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_fetch"]
 
             set el 1
         }
@@ -1507,18 +1511,23 @@
         # allow us to, say, split off the prefix on libs)
         array set list_map "
             categories      1
+            depends_fetch   1
+            depends_extract 1
             depends_build   1
             depends_lib     1
             depends_run     1
             maintainers     1
             platforms       1
             variants        1
+            conflicts       1
         "
 
         # Label map for pretty printing
         array set pretty_label {
             heading     ""
             variants    Variants
+            depends_fetch "Fetch Dependencies"
+            depends_extract "Extract Dependencies"
             depends_build "Build Dependencies"
             depends_run "Runtime Dependencies"
             depends_lib "Library Dependencies"
@@ -1529,12 +1538,15 @@
             platforms   Platforms
             maintainers Maintainers
             license     License
+            conflicts   "Conflicts with"
         }
 
         # Wrap-length map for pretty printing
         array set pretty_wrap {
             heading 0
             variants 22
+            depends_fetch 22
+            depends_extract 22
             depends_build 22
             depends_run 22
             depends_lib 22
@@ -1543,12 +1555,15 @@
             homepage 22
             platforms 22
             license 22
+            conflicts 22
             maintainers 22
         }
 
         # Interpret a convenient field abbreviation
         if {[info exists options(ports_info_depends)] && $options(ports_info_depends) == "yes"} {
             array unset options ports_info_depends
+            set options(ports_info_depends_fetch) yes
+            set options(ports_info_depends_extract) yes
             set options(ports_info_depends_build) yes
             set options(ports_info_depends_lib) yes
             set options(ports_info_depends_run) yes
@@ -1595,8 +1610,10 @@
             set opts_todo {ports_info_heading ports_info_variants 
                 ports_info_skip_line
                 ports_info_long_description ports_info_homepage 
-                ports_info_skip_line ports_info_depends_build
+                ports_info_skip_line ports_info_depends_fetch
+                ports_info_depends_extract ports_info_depends_build
                 ports_info_depends_lib ports_info_depends_run
+                ports_info_conflicts
                 ports_info_platforms ports_info_license
                 ports_info_maintainers
             }
@@ -1876,10 +1893,14 @@
         return 1
     }
     foreachport $portlist {
-        if { [catch {portimage::activate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
-            global errorInfo
-            ui_debug "$errorInfo"
-            break_softcontinue "port activate failed: $result" 1 status
+        if {![macports::global_option_isset ports_dryrun]} {
+            if { [catch {portimage::activate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
+                global errorInfo
+                ui_debug "$errorInfo"
+                break_softcontinue "port activate failed: $result" 1 status
+            }
+        } else {
+            ui_msg "Skipping activate $portname (dry run)"
         }
     }
     
@@ -1893,10 +1914,14 @@
         return 1
     }
     foreachport $portlist {
-        if { [catch {portimage::deactivate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
-            global errorInfo
-            ui_debug "$errorInfo"
-            break_softcontinue "port deactivate failed: $result" 1 status
+        if {![macports::global_option_isset ports_dryrun]} {
+            if { [catch {portimage::deactivate $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
+                global errorInfo
+                ui_debug "$errorInfo"
+                break_softcontinue "port deactivate failed: $result" 1 status
+            }
+        } else {
+            ui_msg "Skipping deactivate $portname (dry run)"
         }
     }
     
@@ -2146,16 +2171,6 @@
         if { [catch {portuninstall::uninstall $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
             global errorInfo
             ui_debug "$errorInfo"
-
-            # start gsoc08-privileges
-            if { [string first "permission denied" $result] != -1 } {
-                set result "port requires root privileges for this action and needs you to execute 'sudo port uninstall $portname' to continue."
-                #ui_msg [exec sudo port uninstall $portname]
-                # The above line is what should be here to let the user simply enter his/her password to uninstall as root.
-                # However, for some as yet unknown reason, executing it here will not work.
-            }
-            # end gsoc08-privileges
-
             break_softcontinue "port uninstall failed: $result" 1 status
         }
     }
@@ -2513,6 +2528,8 @@
 
     if {[info exists options(ports_search_depends)] && $options(ports_search_depends) == "yes"} {
         array unset options ports_search_depends
+        set options(ports_search_depends_fetch) yes
+        set options(ports_search_depends_extract) yes
         set options(ports_search_depends_build) yes
         set options(ports_search_depends_lib) yes
         set options(ports_search_depends_run) yes
@@ -2926,25 +2943,6 @@
 
         mportclose $workername
         
-        # start gsoc08-privileges
-        if { [geteuid] != 0 && $result == 2} {
-            # mportexec will return an error result code 2 if eval_targets fails due to insufficient privileges.
-
-            set portbinary "${macports::prefix}/bin/port"
-
-            ui_info "Attempting port action with 'sudo port': 'sudo $portbinary $target $portname'."
-            set result 0
-            if {[catch {set sudomsgs [exec sudo $portbinary $target $portname]} sudomsgs]} {
-                global errorInfo
-                ui_debug "$errorInfo"
-                break_softcontinue "Unable to execute port: $errorInfo" 1 status
-            }
-
-            ui_msg $sudomsgs
-            ui_debug "'sudo $portbinary $target $portname' has completed."
-        }
-        # end gsoc08-privileges
-        
         # Process any error that wasn't thrown and handled already
         if {$result} {
             break_softcontinue "Status $result encountered during processing." 1 status
@@ -3139,12 +3137,14 @@
 array set cmd_opts_array {
     edit        {{editor 1}}
     ed          {{editor 1}}
-    info        {category categories depends_build depends_lib depends_run
+    info        {category categories depends_fetch depends_extract
+                 depends_build depends_lib depends_run
                  depends description epoch fullname heading homepage index license
                  line long_description
                  maintainer maintainers name platform platforms portdir pretty
                  revision variant variants version}
-    search      {case-sensitive category categories depends_build depends_lib depends_run
+    search      {case-sensitive category categories depends_fetch
+                 depends_extract depends_build depends_lib depends_run
                  depends description epoch exact glob homepage line
                  long_description maintainer maintainers name platform
                  platforms portdir regex revision variant variants version}

Modified: branches/gsoc09-logging/base/src/port/portindex.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port/portindex.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port/portindex.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -68,7 +68,7 @@
             }
         }
 
-        set keepkeys {categories depends_build depends_lib depends_run description epoch homepage long_description maintainers name platforms revision variants version portdir}
+        set keepkeys {categories depends_fetch depends_extract depends_build depends_lib depends_run description epoch homepage long_description maintainers name platforms revision variants version portdir}
         foreach availkey [array names portinfo] {
             if {[lsearch -exact ${keepkeys} $availkey] == -1} {
                 unset portinfo($availkey)

Modified: branches/gsoc09-logging/base/src/port1.0/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -21,10 +21,10 @@
 clean::
 	rm -f pkgIndex.tcl
 
-distclean::
+distclean:: clean
 	rm -f port_autoconf.tcl
 
-install::
+install:: all
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
 	$(SILENT)set -x; for file in ${SRCS}; do \
 		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \

Modified: branches/gsoc09-logging/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/port_autoconf.tcl.in	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/port_autoconf.tcl.in	2009-06-12 08:57:53 UTC (rev 52218)
@@ -33,14 +33,28 @@
 namespace eval portutil::autoconf {
 	variable bzip2_path "@BZIP2@"
 	variable cp_path "@CP@"
+	variable cpio_path "@CPIO@"
+	variable diff_path "@DIFF@"
+	variable ditto_path "@DITTO@"
+	variable dscl_path "@DSCL@"
+	variable file_path "@FILE@"
 	variable cvs_path "@CVS@"
 	variable svn_path "@SVN@"
 	variable git_path "@GIT@"
+	variable hg_path "@HG@"
 	variable gzip_path "@GZIP@"
+	variable lipo_path "@LIPO@"
+	variable nice_path "@NICE@"
+	variable patch_path "@PATCH@"
 	variable rmdir_path "@RMDIR@"
 	variable rsync_path "@RSYNC@"
 	variable unzip_path "@UNZIP@"
 	variable zip_path "@ZIP@"
+	variable lsbom_path "@LSBOM@"
+	variable make_path "@MAKE@"
+	variable gnumake_path "@GNUMAKE@"
+	variable bsdmake_path "@BSDMAKE@"
+	variable mkbom_path "@MKBOM@"
 	variable mtree_path "@MTREE@"
 	variable pax_path "@PAX@"
 	variable xar_path "@XAR@"

Modified: branches/gsoc09-logging/base/src/port1.0/portactivate.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portactivate.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portactivate.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -52,8 +52,8 @@
 set_ui_prefix
 
 proc portactivate::activate_main {args} {
-    global env portname portversion portrevision portvariants user_options portnotes
-    registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
+    global env name version revision portvariants user_options portnotes
+    registry_activate $name ${version}_${revision}${portvariants} [array get user_options]
 
     # Display notes at the end of the activation phase.
     if {[info exists portnotes] && $portnotes ne {}} {

Modified: branches/gsoc09-logging/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portbuild.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portbuild.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -62,38 +62,35 @@
 
 proc portbuild::build_getmaketype {args} {
     if {![exists build.type]} {
-        return make
+        return [findBinary make $portutil::autoconf::make_path]
     }
     switch -exact -- [option build.type] {
         bsd {
             if {[option os.platform] == "darwin"} {
-                return bsdmake
+                return [findBinary bsdmake $portutil::autoconf::bsdmake_path]
             } elseif {[option os.platform] == "freebsd"} {
-                return make
+                return [binaryInPath make]
             } else {
-                return pmake
+                return [binaryInPath pmake]
             }
         }
         gnu {
             if {[option os.platform] == "darwin"} {
-                return gnumake
+                return [findBinary gnumake $portutil::autoconf::gnumake_path]
             } elseif {[option os.platform] == "linux"} {
-                return make
+                return [binaryInPath make]
             } else {
-                return gmake
+                return [binaryInPath gmake]
             }
         }
         pbx {
-            set pbxbuild "pbxbuild"
-            set xcodebuild "xcodebuild"
-
             if {[option os.platform] != "darwin"} {
                 return -code error "[format [msgcat::mc "This port requires 'pbxbuild/xcodebuild', which is not available on %s."] [option os.platform]]"
             }
 
-            if {[catch {set xcodebuild [binaryInPath $xcodebuild]}] == 0} {
+            if {[catch {set xcodebuild [binaryInPath xcodebuild]}] == 0} {
                 return $xcodebuild
-            } elseif {[catch {set pbxbuild [binaryInPath $pbxbuild]}] == 0} {
+            } elseif {[catch {set pbxbuild [binaryInPath pbxbuild]}] == 0} {
                 return $pbxbuild
             } else {
                 return -code error "Neither pbxbuild nor xcodebuild were found on this system!"
@@ -101,7 +98,7 @@
         }
         default {
             ui_warn "[format [msgcat::mc "Unknown build.type %s, using 'gnumake'"] [option build.type]]"
-            return gnumake
+            return [findBinary gnumake $portutil::autoconf::gnumake_path]
         }
     }
 }
@@ -114,7 +111,7 @@
     if {![string is integer -strict $nice] || $nice <= 0} {
         return ""
     }
-    return "nice -n $nice "
+    return "[findBinary nice $portutil::autoconf::nice_path] -n $nice "
 }
 
 proc portbuild::build_getmakejobs {args} {
@@ -131,7 +128,11 @@
     set jobs [option build.jobs]
     # if set to '0', use the number of cores for the number of jobs
     if {$jobs == 0} {
-        set jobs [exec "/usr/sbin/sysctl" "-n" "hw.ncpu"]
+        if {[catch {set jobs [exec "/usr/sbin/sysctl" "-n" "hw.availcpu"]}]} {
+            set jobs 2
+            ui_warn "failed to determine the number of available CPUs (probably not supported on this platform)"
+            ui_warn "defaulting to $jobs jobs, consider setting buildmakejobs to a nonzero value in macports.conf"
+        }
     }
     if {![string is integer -strict $jobs] || $jobs <= 1} {
         return ""
@@ -140,17 +141,9 @@
 }
 
 proc portbuild::build_start {args} {
-    global UI_PREFIX build.asroot
+    global UI_PREFIX
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s"] [option portname]]"
-
-    # start gsoc08-privileges
-    if { [tbool build.asroot] } {
-    # if port is marked as needing root
-        elevateToRoot "build"
-    }
-    # end gsoc08-privileges
-
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s"] [option name]]"
 }
 
 proc portbuild::build_main {args} {

Modified: branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -179,7 +179,7 @@
 proc portchecksum::checksum_start {args} {
     global UI_PREFIX
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying checksum(s) for %s"] [option portname]]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying checksum(s) for %s"] [option name]]"
 }
 
 # checksum_main

Modified: branches/gsoc09-logging/base/src/port1.0/portclean.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portclean.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portclean.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -52,7 +52,7 @@
 proc portclean::clean_start {args} {
     global UI_PREFIX
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option portname]]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option name]]"
 }
 
 proc portclean::clean_main {args} {
@@ -62,25 +62,24 @@
 
     if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
         [info exists ports_clean_dist] && $ports_clean_dist == "yes"} {
-        ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option portname]]"
+        ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option name]]"
         clean_dist
     }
     if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
         [info exists ports_clean_archive] && $ports_clean_archive == "yes"} {
-        ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option portname]]"
+        ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option name]]"
         clean_archive
     }
     if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
         [info exists ports_clean_work] && $ports_clean_work == "yes" || \
-        (!([info exists ports_clean_dist] && $ports_clean_dist == "yes") && \
-         !([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
-         ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option portname]]"
+        (!([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
+         ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option name]]"
          clean_work
     }
 
     # start gsoc-08 privileges
     if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
-        ui_info "$UI_PREFIX [format [msgcat::mc "Removing alt source directory for %s"] [option portname]]"
+        ui_info "$UI_PREFIX [format [msgcat::mc "Removing alt source directory for %s"] [option name]]"
         clean_altsource
     }
     # end gsoc-08 privileges
@@ -111,7 +110,7 @@
 # This is crude, but works.
 #
 proc portclean::clean_dist {args} {
-    global ports_force portname distpath dist_subdir distfiles
+    global ports_force name distpath dist_subdir distfiles
 
     # remove known distfiles for sure (if they exist)
     set count 0
@@ -139,7 +138,7 @@
     # next remove dist_subdir if only needed for this port,
     # or if user forces us to
     set dirlist [list]
-    if {($dist_subdir != $portname)} {
+    if {($dist_subdir != $name)} {
         if {[info exists dist_subdir]} {
             set distfullpath [file join $distpath $dist_subdir]
             if {!([info exists ports_force] && $ports_force == "yes")
@@ -148,13 +147,13 @@
                 ui_warn [format [msgcat::mc "Distfiles directory '%s' may contain distfiles needed for other ports, use the -f flag to force removal" ] [file join $distpath $dist_subdir]]
             } else {
                 lappend dirlist $dist_subdir
-                lappend dirlist $portname
+                lappend dirlist $name
             }
         } else {
-            lappend dirlist $portname
+            lappend dirlist $name
         }
     } else {
-        lappend dirlist $portname
+        lappend dirlist $name
     }
     # loop through directories
     set count 0
@@ -200,7 +199,7 @@
 }
 
 proc portclean::clean_archive {args} {
-    global workpath portarchivepath portname portversion ports_version_glob
+    global workpath portarchivepath name version ports_version_glob
 
     # Define archive destination directory and target filename
     if {$portarchivepath ne $workpath && $portarchivepath ne ""} {
@@ -210,7 +209,7 @@
     if {[info exists ports_version_glob]} {
         # Match all possible archive variatns that match the version
         # glob specified by the user for this OS.
-        set fileglob "$portname-[option ports_version_glob]*.[option os.arch].*"
+        set fileglob "$name-[option ports_version_glob]*.[option os.arch].*"
     } else {
         # Match all possible archive variants for the current version on
         # this OS. If you want to delete previous versions, use the
@@ -219,7 +218,7 @@
         # We do this because if we don't, then ports that match the
         # first part of the name (e.g. trying to remove foo-*, it will
         # pick up anything foo-bar-* as well, which is undesirable).
-        set fileglob "$portname-$portversion*.[option os.arch].*"
+        set fileglob "$name-$version*.[option os.arch].*"
     }
 
     # Remove the archive files
@@ -229,7 +228,7 @@
             set file [file tail $path]
             # Make sure file is truly a port archive file, and not
             # and accidental match with some other file that might exist.
-            if {[regexp "^$portname-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
+            if {[regexp "^$name-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
                 if {[file isfile $path]} {
                     ui_debug "Removing archive: $path"
                     if {[catch {delete $path} result]} {

Modified: branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -65,18 +65,12 @@
 proc portconfigure::set_configure_type {option action args} {
     if {[string equal ${action} "set"] && [tbool args]} {
         switch $option {
-            use_autoreconf {
-                depends_build-append bin:autoreconf:autoconf
-            }
-            use_automake {
-                depends_build-append bin:automake:automake
-            }
-            use_autoconf {
-                depends_build-append bin:autoconf:autoconf
-            }
             use_xmkmf {
-                depends_build-append path:bin/xmkmf:imake
+                depends_build-append port:imake
             }
+            default {
+                depends_build-append port:autoconf port:automake port:libtool
+            }
         }
     }
 }
@@ -134,18 +128,11 @@
 default configure.pkg_config        {}
 default configure.pkg_config_path   {}
 
-# backwards compatibility for hardcoded ports
-if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
-    set sysroot "/Developer/SDKs/MacOSX10.5.sdk"
-} else {
-    set sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
-}
-
 options configure.universal_target configure.universal_sysroot configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
 default configure.universal_target      {${universal_target}}
 default configure.universal_sysroot     {${universal_sysroot}}
 default configure.universal_archs       {${universal_archs}}
-default configure.universal_args        {[portconfigure::configure_get_universal_args]}
+default configure.universal_args        {--disable-dependency-tracking}
 default configure.universal_cflags      {[portconfigure::configure_get_universal_cflags]}
 default configure.universal_cppflags    {[portconfigure::configure_get_universal_cppflags]}
 default configure.universal_cxxflags    {[portconfigure::configure_get_universal_cflags]}
@@ -172,7 +159,7 @@
     global UI_PREFIX
     global configure.compiler
     
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option portname]]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option name]]"
 
     set name ""
     switch -exact ${configure.compiler} {
@@ -195,21 +182,8 @@
         default { return -code error "Invalid value for configure.compiler" }
     }
     ui_debug "Using compiler '$name'"
-    
-    # start gsoc08-privileges
-    if { [tbool configure.asroot] } {
-        # if port is marked as needing root
-        elevateToRoot "configure"
-    }
-    # end gsoc08-privileges
 }
 
-# internal function to determine the universal args for configure.cmd
-proc portconfigure::configure_get_universal_args {args} {
-    set params "--disable-dependency-tracking"
-    return $params
-}
-
 # internal function to determine the "-arch xy" flags for the compiler
 proc portconfigure::configure_get_universal_archflags {args} {
     global configure.universal_archs
@@ -270,7 +244,7 @@
 
 # internal function to find correct compilers
 proc portconfigure::configure_get_compiler {type} {
-    global configure.compiler prefix
+    global configure.compiler prefix developer_dir
     set ret ""
     switch -exact ${configure.compiler} {
         gcc {
@@ -306,16 +280,16 @@
         }
         llvm-gcc-4.2 {
             switch -exact ${type} {
-                cc   { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
-                objc { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
-                cxx  { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 }
-                cpp  { set ret /Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 }
+                cc   { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
+                objc { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
+                cxx  { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 }
+                cpp  { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 }
             }
         }
         clang {
             switch -exact ${type} {
-                cc   { set ret /usr/bin/clang }
-                objc { set ret /usr/bin/clang }
+                cc   { set ret ${developer_dir}/usr/bin/clang }
+                objc { set ret ${developer_dir}/usr/bin/clang }
             }
         }
         apple-gcc-3.3 {

Modified: branches/gsoc09-logging/base/src/port1.0/portdepends.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdepends.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portdepends.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -37,10 +37,12 @@
 }
 
 # define options
-options depends_build depends_run depends_lib depends
+options depends_fetch depends_extract depends_build depends_run depends_lib depends
 # Export options via PortInfo
-options_export depends_build depends_lib depends_run
+options_export depends_fetch depends_extract depends_build depends_lib depends_run
 
+option_proc depends_fetch portdepends::validate_depends_options
+option_proc depends_extract portdepends::validate_depends_options
 option_proc depends_build portdepends::validate_depends_options
 option_proc depends_run portdepends::validate_depends_options
 option_proc depends_lib portdepends::validate_depends_options

Modified: branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -68,7 +68,7 @@
 default destroot.keepdirs ""
 default destroot.violate_mtree no
 
-default startupitem.name        {${portname}}
+default startupitem.name        {${name}}
 default startupitem.uniquename  {org.macports.${startupitem.name}}
 default startupitem.plist       {${startupitem.uniquename}.plist}
 default startupitem.location    LaunchDaemons
@@ -87,12 +87,12 @@
 set_ui_prefix
 
 proc portdestroot::destroot_start {args} {
-    global UI_PREFIX prefix portname porturl destroot os.platform destroot.clean portsharepath
+    global UI_PREFIX prefix name porturl destroot os.platform destroot.clean portsharepath
     global destroot.umask destroot.asroot macportsuser euid egid usealtworkpath altprefix
     global applications_dir frameworks_dir
     variable oldmask
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${portname}]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${name}]"
 
     # start gsoc08-privileges
     if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
@@ -106,9 +106,7 @@
     }
 
     if { [tbool destroot.asroot] && [getuid] != 0 } {
-        global errorisprivileges
-        set errorisprivileges yes
-        return -code error "You can not run this port without elevated privileges. You need to re-run with 'sudo port'.";
+        return -code error "You cannot run this port without root privileges. You need to re-run with 'sudo port'.";
     }
 
     if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
@@ -122,7 +120,7 @@
     # end gsoc08-privileges
 
     set oldmask [umask ${destroot.umask}]
-    set mtree ${portutil::autoconf::mtree_path}
+    set mtree [findBinary mtree ${portutil::autoconf::mtree_path}]
 
     if { ${destroot.clean} == "yes" } {
         delete "${destroot}"
@@ -144,7 +142,8 @@
 }
 
 proc portdestroot::destroot_finish {args} {
-    global UI_PREFIX destroot prefix portname startupitem.create destroot.violate_mtree
+    global UI_PREFIX destroot prefix name startupitem.create destroot.violate_mtree
+    global applications_dir frameworks_dir developer_dir destroot.keepdirs
     global os.platform os.version
     variable oldmask
 
@@ -162,114 +161,107 @@
     }
 
     # Prune empty directories in ${destroot}
-    set exclude_dirs [list]
-    set exclude_phrase ""
-    foreach path [option destroot.keepdirs] {
+    foreach path ${destroot.keepdirs} {
         if {![file isdirectory ${path}]} {
             xinstall -m 0755 -d ${path}
         }
-        if {![file exists ${path}/.turd_${portname}]} {
-            xinstall -c -m 0644 /dev/null ${path}/.turd_${portname}
+        if {![file exists ${path}/.turd_${name}]} {
+            xinstall -c -m 0644 /dev/null ${path}/.turd_${name}
         }
-        lappend exclude_dirs "-path \"${path}\""
     }
-    if { [llength ${exclude_dirs}] > 0 } {
-        set exclude_phrase "! \\( [join ${exclude_dirs} " -or "] \\)"
+    fs-traverse -depth dir ${destroot} {
+        if {[file isdirectory $dir]} {
+            catch {file delete $dir}
+        }
     }
-    catch {system "find \"${destroot}\" -depth -type d ${exclude_phrase} -exec rmdir -- \{\} \\; 2>/dev/null"}
 
     # Compress all manpages with gzip (instead)
-    # but NOT on Jaguar (Darwin 6.x)
-    if {![regexp {darwin6} "${os.platform}${os.version}"]} {
-        set manpath "${destroot}${prefix}/share/man"
-        set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
-        set gunzip "$gzip -d"
-        set bunzip2 "[findBinary bzip2 ${portutil::autoconf::bzip2_path}] -d"
-        if {[file isdirectory ${manpath}] && [file type ${manpath}] == "directory"} {
-            ui_info "$UI_PREFIX [format [msgcat::mc "Compressing man pages for %s"] ${portname}]"
-            set found 0
-            set manlinks [list]
-            foreach mandir [readdir "${manpath}"] {
-                if {![regexp {^(cat|man)(.)$} ${mandir} match ignore manindex]} { continue }
-                set mandirpath [file join ${manpath} ${mandir}]
-                if {[file isdirectory ${mandirpath}] && [file type ${mandirpath}] == "directory"} {
-                    ui_debug "Scanning ${mandir}"
-                    foreach manfile [readdir ${mandirpath}] {
-                        set manfilepath [file join ${mandirpath} ${manfile}]
-                        if {[file isfile ${manfilepath}] && [file type ${manfilepath}] == "file"} {
-                            if {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]gz\$" ${manfile} gzfile manfile]} {
-                                set found 1
-                                system "cd ${manpath} && \
-                                $gunzip -f [file join ${mandir} ${gzfile}] && \
-                                $gzip -9vf [file join ${mandir} ${manfile}]"
-                            } elseif {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]bz2\$" ${manfile} bz2file manfile]} {
-                                set found 1
-                                system "cd ${manpath} && \
-                                $bunzip2 -f [file join ${mandir} ${bz2file}] && \
-                                $gzip -9vf [file join ${mandir} ${manfile}]"
-                            } elseif {[regexp "\[.\]${manindex}\[a-z\]*\$" ${manfile}]} {
-                                set found 1
-                                system "cd ${manpath} && \
-                                $gzip -9vf [file join ${mandir} ${manfile}]"
+    set manpath "${destroot}${prefix}/share/man"
+    set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
+    set gunzip "$gzip -d"
+    set bunzip2 "[findBinary bzip2 ${portutil::autoconf::bzip2_path}] -d"
+    if {[file isdirectory ${manpath}] && [file type ${manpath}] == "directory"} {
+        ui_info "$UI_PREFIX [format [msgcat::mc "Compressing man pages for %s"] ${name}]"
+        set found 0
+        set manlinks [list]
+        foreach mandir [readdir "${manpath}"] {
+            if {![regexp {^(cat|man)(.)$} ${mandir} match ignore manindex]} { continue }
+            set mandirpath [file join ${manpath} ${mandir}]
+            if {[file isdirectory ${mandirpath}] && [file type ${mandirpath}] == "directory"} {
+                ui_debug "Scanning ${mandir}"
+                foreach manfile [readdir ${mandirpath}] {
+                    set manfilepath [file join ${mandirpath} ${manfile}]
+                    if {[file isfile ${manfilepath}] && [file type ${manfilepath}] == "file"} {
+                        if {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]gz\$" ${manfile} gzfile manfile]} {
+                            set found 1
+                            system "cd ${manpath} && \
+                            $gunzip -f [file join ${mandir} ${gzfile}] && \
+                            $gzip -9vf [file join ${mandir} ${manfile}]"
+                        } elseif {[regexp "^(.*\[.\]${manindex}\[a-z\]*)\[.\]bz2\$" ${manfile} bz2file manfile]} {
+                            set found 1
+                            system "cd ${manpath} && \
+                            $bunzip2 -f [file join ${mandir} ${bz2file}] && \
+                            $gzip -9vf [file join ${mandir} ${manfile}]"
+                        } elseif {[regexp "\[.\]${manindex}\[a-z\]*\$" ${manfile}]} {
+                            set found 1
+                            system "cd ${manpath} && \
+                            $gzip -9vf [file join ${mandir} ${manfile}]"
+                        }
+                        set gzmanfile ${manfile}.gz
+                        set gzmanfilepath [file join ${mandirpath} ${gzmanfile}]
+                        if {[file exists ${gzmanfilepath}]} {
+                            set desired 00444
+                            set current [file attributes ${gzmanfilepath} -permissions]
+                            if {$current != $desired} {
+                                ui_info "[file join ${mandir} ${gzmanfile}]: changing permissions from $current to $desired"
+                                file attributes ${gzmanfilepath} -permissions $desired
                             }
-                            set gzmanfile ${manfile}.gz
-                            set gzmanfilepath [file join ${mandirpath} ${gzmanfile}]
-                            if {[file exists ${gzmanfilepath}]} {
-                                set desired 00444
-                                set current [file attributes ${gzmanfilepath} -permissions]
-                                if {$current != $desired} {
-                                    ui_info "[file join ${mandir} ${gzmanfile}]: changing permissions from $current to $desired"
-                                    file attributes ${gzmanfilepath} -permissions $desired
-                                }
-                            }
-                        } elseif {[file type ${manfilepath}] == "link"} {
-                            lappend manlinks [file join ${mandir} ${manfile}]
                         }
+                    } elseif {[file type ${manfilepath}] == "link"} {
+                        lappend manlinks [file join ${mandir} ${manfile}]
                     }
                 }
             }
-            if {$found == 1} {
-                # check man page links and rename/repoint them if necessary
-                foreach manlink $manlinks {
-                    set manlinkpath [file join $manpath $manlink]
-                    # if link destination is not gzipped, check it
-                    set manlinksrc [file readlink $manlinkpath]
-                    # if link destination is an absolute path, convert it to a
-                    # relative path
-                    if {[file pathtype $manlinksrc] eq "absolute"} {
-                        set manlinksrc [file tail $manlinksrc]
+        }
+        if {$found == 1} {
+            # check man page links and rename/repoint them if necessary
+            foreach manlink $manlinks {
+                set manlinkpath [file join $manpath $manlink]
+                # if link destination is not gzipped, check it
+                set manlinksrc [file readlink $manlinkpath]
+                # if link destination is an absolute path, convert it to a
+                # relative path
+                if {[file pathtype $manlinksrc] eq "absolute"} {
+                    set manlinksrc [file tail $manlinksrc]
+                }
+                if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
+                    set mandir [file dirname $manlink]
+                    set mandirpath [file join $manpath $mandir]
+                    set pwd [pwd]
+                    if {[catch {_cd $mandirpath} err]} {
+                        puts $err
+                        return
                     }
-                    if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
-                        set mandir [file dirname $manlink]
-                        set mandirpath [file join $manpath $mandir]
-                        set pwd [pwd]
-                        if {[catch {_cd $mandirpath} err]} {
-                            puts $err
-                            return
+                    # if gzipped destination exists, fix link
+                    if {[file isfile ${manlinksrc}.gz]} {
+                        # if actual link name does not end with gz, rename it
+                        if {![regexp "\[.\]gz\$" ${manlink}]} {
+                            ui_debug "renaming link: $manlink to ${manlink}.gz"
+                            file rename $manlinkpath ${manlinkpath}.gz
+                            set manlink ${manlink}.gz
+                            set manlinkpath [file join $manpath $manlink]
                         }
-                        # if gzipped destination exists, fix link
-                        if {[file isfile ${manlinksrc}.gz]} {
-                            # if actual link name does not end with gz, rename it
-                            if {![regexp "\[.\]gz\$" ${manlink}]} {
-                                ui_debug "renaming link: $manlink to ${manlink}.gz"
-                                file rename $manlinkpath ${manlinkpath}.gz
-                                set manlink ${manlink}.gz
-                                set manlinkpath [file join $manpath $manlink]
-                            }
-                            # repoint the link
-                            ui_debug "repointing link: $manlink from $manlinksrc to ${manlinksrc}.gz"
-                            file delete $manlinkpath
-                            ln -s "${manlinksrc}.gz" "${manlinkpath}"
-                        }
-                        _cd $pwd
+                        # repoint the link
+                        ui_debug "repointing link: $manlink from $manlinksrc to ${manlinksrc}.gz"
+                        file delete $manlinkpath
+                        ln -s "${manlinksrc}.gz" "${manlinkpath}"
                     }
+                    _cd $pwd
                 }
-            } else {
-                ui_debug "No man pages found to compress."
             }
+        } else {
+            ui_debug "No man pages found to compress."
         }
-    } else {
-        ui_debug "No man page compression on ${os.platform}${os.version}."
     }
 
     # test for violations of mtree
@@ -307,36 +299,46 @@
                     # we've found a subpath of our prefix
                     lpush pathsToCheck $dfile
                 } else {
-                    # these files are outside of the prefix
-                    switch $dfile {
-                        /Applications -
-                        /Developer -
-                        /Library { ui_debug "port installs files in $dfile" }
-                        default {
-                            ui_warn "violation by $dfile"
-                            set mtree_violation "yes"
+                    set dir_allowed no
+                    # these files are (at least potentially) outside of the prefix
+                    foreach dir "$applications_dir $frameworks_dir /Library/LaunchAgents /Library/LaunchDaemons /Library/StartupItems" {
+                        if {[string equal -length [expr [string length $dfile] + 1] $dfile/ $dir]} {
+                            # it's a prefix of one of the allowed paths
+                            set dir_allowed yes
+                            break
                         }
                     }
+                    if {$dir_allowed} {
+                        lpush pathsToCheck $dfile
+                    } else {
+                        # not a prefix of an allowed path, so it's either the path itself or a violation
+                        switch $dfile \
+                            $applications_dir - \
+                            $frameworks_dir - \
+                            /Library/LaunchAgents - \
+                            /Library/LaunchDaemons - \
+                            /Library/StartupItems { ui_debug "port installs files in $dfile" } \
+                            default {
+                                ui_warn "violation by $dfile"
+                                set mtree_violation "yes"
+                            }
+                    }
                 }
             }
         }
 
         # abort here only so all violations can be observed
         if { ${mtree_violation} != "no" } {
-            ui_warn "[format [msgcat::mc "%s violates the layout of the ports-filesystems!"] [option portname]]"
+            ui_warn "[format [msgcat::mc "%s violates the layout of the ports-filesystems!"] [option name]]"
             ui_warn "Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!"
             # error "mtree violation!"
         }
     } else {
-        ui_warn "[format [msgcat::mc "%s requests to install files outside the common directory structure!"] [option portname]]"
+        ui_msg "[format [msgcat::mc "Note: %s installs files outside the common directory structure."] [option name]]"
     }
 
     # Restore umask
     umask $oldmask
 
-    # start gsoc08-privileges
-    chownAsRoot $destroot
-    # end gsoc08-privileges
-
     return 0
 }

Modified: branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -54,7 +54,7 @@
 proc portdistcheck::distcheck_main {args} {
     global distcheck.check
     global fetch.type
-    global portname portpath
+    global name portpath
 
     set port_moddate [file mtime ${portpath}/Portfile]
 
@@ -82,16 +82,16 @@
                     ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
                     set file_url [portfetch::assemble_url $site $distfile]
                     if {[catch {set urlnewer [curl isnewer $file_url $port_moddate]} error]} {
-                        ui_warn "couldn't fetch $file_url for $portname ($error)"
+                        ui_warn "couldn't fetch $file_url for $name ($error)"
                     } else {
                         if {$urlnewer} {
-                            ui_warn "port $portname: $file_url is newer than portfile"
+                            ui_warn "port $name: $file_url is newer than portfile"
                         }
                         incr count
                     }
                 }
                 if {$count == 0} {
-                    ui_error "no mirror had $distfile for $portname"
+                    ui_error "no mirror had $distfile for $name"
                 }
             } elseif {${distcheck.check} == "filesize"} {
                 set count 0
@@ -99,18 +99,18 @@
                     ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
                     set file_url [portfetch::assemble_url $site $distfile]
                     if {[catch {set urlsize [curl getsize $file_url]} error]} {
-                        ui_warn "couldn't fetch $file_url for $portname ($error)"
+                        ui_warn "couldn't fetch $file_url for $name ($error)"
                     } else {
                         incr count
                         if {$urlsize > 0} {
-                            ui_info "port $portname: $distfile $urlsize bytes"
+                            ui_info "port $name: $distfile $urlsize bytes"
                             incr totalsize $urlsize
                             break
                         }
                     }
                 }
                 if {$count == 0} {
-                    ui_error "no mirror had $distfile for $portname"
+                    ui_error "no mirror had $distfile for $name"
                 }
             } else {
                 ui_error "unknown distcheck.check ${distcheck.check}"
@@ -132,7 +132,7 @@
                 set size [expr $totalsize / (1024.0*1024.0*1024.0)]
                 set humansize [format "%.1fG" $size]
             }
-            ui_msg "$portname: $humansize"
+            ui_msg "$name: $humansize"
         }
     }
 }

Modified: branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -48,8 +48,8 @@
 set_ui_prefix
 
 proc portdistfiles::distfiles_start {args} {
-    global UI_PREFIX portname
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Distfiles for %s"] ${portname}]"
+    global UI_PREFIX name
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Distfiles for %s"] ${name}]"
 }
 
 proc portdistfiles::distfiles_main {args} {

Modified: branches/gsoc09-logging/base/src/port1.0/portextract.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portextract.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portextract.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -98,7 +98,7 @@
         option extract.post_args ""
     } elseif {[tbool use_dmg]} {
         global worksrcdir
-        set dmg_tmp_dir [exec mktemp -d -q "/tmp/mports.XXXXXXXX"]
+        set dmg_tmp_dir [mkdtemp "/tmp/mports.XXXXXXXX"]
         set dmg_mount ${dmg_tmp_dir}/${worksrcdir}
         file mkdir ${dmg_mount}
         option extract.cmd [findBinary hdiutil ${portutil::autoconf::hdiutil_path}]
@@ -110,7 +110,7 @@
 proc portextract::extract_start {args} {
     global UI_PREFIX
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option portname]]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option name]]"
 }
 
 proc portextract::extract_main {args} {

Modified: branches/gsoc09-logging/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portfetch.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portfetch.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -55,11 +55,11 @@
 # define options: distname master_sites
 options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 use_lzma use_7z use_dmg dist_subdir \
     fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
-    master_sites.mirror_subdir patch_sites.mirror_subdir portname \
+    master_sites.mirror_subdir patch_sites.mirror_subdir \
     cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
-    svn.url svn.tag svn.revision svn.method \
-    git.url git.branch \
-    hg.url hg.tag
+    svn.url svn.revision svn.method \
+    git.cmd git.url git.branch \
+    hg.cmd hg.url hg.tag
 
 # XXX we use the command framework to buy us some useful features,
 # but this is not a user-modifiable command
@@ -70,7 +70,7 @@
 default extract.suffix .tar.gz
 default fetch.type standard
 
-default cvs.cmd {$portutil::autoconf::cvs_path}
+default cvs.cmd {[findBinary cvs $portutil::autoconf::cvs_path]}
 default cvs.password ""
 default cvs.dir {${workpath}}
 default cvs.method {export}
@@ -82,25 +82,26 @@
 default cvs.args ""
 default cvs.post_args {"${cvs.module}"}
 
-default svn.cmd {$portutil::autoconf::svn_path}
+default svn.cmd {[findBinary svn $portutil::autoconf::svn_path]}
 default svn.dir {${workpath}}
 default svn.method {export}
-default svn.tag ""
 default svn.revision ""
 default svn.env {}
 default svn.pre_args {"--non-interactive"}
 default svn.args ""
 default svn.post_args {"${svn.url}"}
 
+default git.cmd {[findBinary git $portutil::autoconf::git_path]}
 default git.dir {${workpath}}
 default git.branch {}
 
+default hg.cmd {[findBinary hg $portutil::autoconf::hg_path]}
 default hg.dir {${workpath}}
 default hg.tag {tip}
 
 # Set distfiles
 default distfiles {[portfetch::suffix $distname]}
-default dist_subdir {${portname}}
+default dist_subdir {${name}}
 
 # user name & password
 default fetch.user ""
@@ -129,7 +130,6 @@
 
 option_proc fetch.type portfetch::set_fetch_type
 
-# We should probably add something like a depends_fetch; see #15161
 proc portfetch::set_extract_type {option action args} {
     global extract.suffix
     if {[string equal ${action} "set"] && [tbool args]} {
@@ -139,15 +139,15 @@
             }
             use_lzma {
                 set extract.suffix .tar.lzma
-                depends_build-append bin:lzma:lzmautils
+                depends_extract-append bin:lzma:lzmautils
             }
             use_zip {
                 set extract.suffix .zip
-                depends_build-append bin:unzip:unzip
+                depends_extract-append bin:unzip:unzip
             }
             use_7z {
                 set extract.suffix .7z
-                depends_build-append bin:7za:p7zip
+                depends_extract-append bin:7za:p7zip
             }
             use_dmg {
                 set extract.suffix .dmg
@@ -160,16 +160,16 @@
     if {[string equal ${action} "set"]} {
         switch $args {
             cvs {
-                depends_build-append bin:cvs:cvs
+                depends_fetch-append bin:cvs:cvs
             }
             svn {
-                depends_build-append bin:svn:subversion
+                depends_fetch-append bin:svn:subversion
             }
             git {
-                depends_build-append bin:git:git-core
+                depends_fetch-append bin:git:git-core
             }
             hg {
-                depends_build-append bin:hg:mercurial
+                depends_fetch-append bin:hg:mercurial
             }
         }
     }
@@ -207,7 +207,7 @@
 # For a given mirror site type, e.g. "gnu" or "x11", check to see if there's a
 # pre-registered set of sites, and if so, return them.
 proc portfetch::mirror_sites {mirrors tag subdir} {
-    global UI_PREFIX portname porturl mirror_sites.listfile mirror_sites.listpath dist_subdir
+    global UI_PREFIX name porturl mirror_sites.listfile mirror_sites.listpath dist_subdir
     global global_mirror_site fallback_mirror_site
 
     set mirrorfile [getportresourcepath $porturl [file join ${mirror_sites.listpath} ${mirror_sites.listfile}]]
@@ -242,7 +242,7 @@
     if {$mirror_tag == "mirror"} {
         set thesubdir ${dist_subdir}
     } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
-        set thesubdir ${portname}
+        set thesubdir ${name}
     } else {
         set thesubdir ${subdir}
     }
@@ -485,7 +485,7 @@
         set savecmd ${cvs.cmd}
         set saveargs ${cvs.args}
         set savepost_args ${cvs.post_args}
-        set cvs.cmd "echo ${cvs.password} | $portutil::autoconf::cvs_path"
+        set cvs.cmd "echo ${cvs.password} | ${cvs.cmd}"
         set cvs.args login
         set cvs.post_args ""
         if {[catch {command_exec cvs -notty "" "2>&1"} result]} {
@@ -510,24 +510,8 @@
 
 # Perform an svn fetch
 proc portfetch::svnfetch {args} {
-    global workpath prefix_frozen
-    global svn.env svn.cmd svn.args svn.post_args svn.revision svn.url svn.method
+    global svn.args svn.revision svn.method
 
-    # Look for the svn command, either in the path or in the prefix
-    set goodcmd 0
-    foreach svncmd "${svn.cmd} ${prefix_frozen}/bin/svn svn" {
-        if { [file executable ${svncmd}] } {
-            set svn.cmd $svncmd
-            set goodcmd 1
-            break;
-        }
-    }
-    if { !$goodcmd } {
-        ui_error "The subversion tool (svn) is required to fetch ${svn.url}."
-        ui_error "Please install the subversion port before proceeding."
-        return -code error [msgcat::mc "Subversion check out failed"]
-    }
-
     set svn.args "${svn.method} ${svn.args}"
     if {[string length ${svn.revision}]} {
         set svn.args "${svn.args} -r ${svn.revision}"
@@ -546,23 +530,9 @@
 
 # Perform a git fetch
 proc portfetch::gitfetch {args} {
-    global worksrcpath prefix_frozen
-    global git.url git.branch git.sha1
+    global worksrcpath
+    global git.url git.branch git.sha1 git.cmd
 
-    # Look for the git command
-    set git.cmd {}
-    foreach gitcmd "$portutil::autoconf::git_path $prefix_frozen/bin/git git" {
-        if {[file executable $gitcmd]} {
-            set git.cmd $gitcmd
-            break
-        }
-    }
-    if {${git.cmd} == {}} {
-        ui_error "git is required to fetch ${git.url}"
-        ui_error "Please install the git-core port before proceeding."
-        return -code error [msgcat::mc "Git command not found"]
-    }
-
     set options "-q"
     if {[string length ${git.branch}] == 0} {
         # if we're just using HEAD, we can make a shallow repo
@@ -593,22 +563,8 @@
 # Perform a mercurial fetch.
 proc portfetch::hgfetch {args} {
     global worksrcpath prefix_frozen
-    global hg.url hg.tag
+    global hg.url hg.tag hg.cmd
 
-    # Look for the hg command.
-    set hg.cmd {}
-    foreach hgcmd "$prefix_frozen/bin/hg hg" {
-        if {[file executable $hgcmd]} {
-            set hg.cmd $hgcmd
-            break
-        }
-    }
-    if {${hg.cmd} == {}} {
-        ui_error "hg is required to fetch ${hg.url}"
-        ui_error "Please install the mercurial port before proceeding."
-        return -code error [msgcat::mc "Mercurial command not found"]
-    }
-
     set cmdstring "${hg.cmd} clone --rev ${hg.tag} ${hg.url} ${worksrcpath} 2>&1"
     ui_debug "Executing: $cmdstring"
     if {[catch {system $cmdstring} result]} {
@@ -633,9 +589,17 @@
 
     if {![file isdirectory $distpath]} {
         if {[catch {file mkdir $distpath} result]} {
-            return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
+            elevateToRoot "fetch"
+            set elevated yes
+            if {[catch {file mkdir $distpath} result]} {
+                return -code error [format [msgcat::mc "Unable to create distribution files path: %s"] $result]
+            }
         }
     }
+    chownAsRoot $distpath
+    if {[info exists elevated] && $elevated == yes} {
+        dropPrivileges
+    }
 
     set fetch_options {}
     if {[string length ${fetch.user}] || [string length ${fetch.password}]} {
@@ -756,9 +720,9 @@
 }
 
 proc portfetch::fetch_start {args} {
-    global UI_PREFIX portname
+    global UI_PREFIX name
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching %s"] $portname]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Fetching %s"] $name]"
 }
 
 # Main fetch routine

Modified: branches/gsoc09-logging/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portinstall.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portinstall.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -55,15 +55,12 @@
 set_ui_prefix
 
 proc portinstall::install_start {args} {
-    global UI_PREFIX portname portversion portrevision variations portvariants
-    global install.asroot prefix
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
+    global UI_PREFIX name version revision variations portvariants
+    global prefix
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $name $version $revision $portvariants]"
     
     # start gsoc08-privileges
-    if { [tbool install.asroot] } {
-        # if port is marked as needing root
-        elevateToRoot "install"
-    } elseif { ![file writable $prefix] } {
+    if { ![file writable $prefix] } {
         # if install location is not writable, need root privileges to install
         elevateToRoot "install"
     }
@@ -79,18 +76,10 @@
     }
     
     # if the file is a symlink, do not try to set file attributes
-    # if the destination file is an existing directory,
-    # do not overwrite its file attributes
-    if {[file type $src_element] != "link" || [file isdirectory $dst_element]} {
-        set attributes [file attributes $src_element]
-        for {set i 0} {$i < [llength $attributes]} {incr i} {
-            set opt [lindex $attributes $i]
-            incr i
-            set arg [lindex $attributes $i]
-            file attributes $dst_element $opt $arg
-            # set mtime on installed element
-            exec touch -r $src_element $dst_element
-        }
+    if {[file type $src_element] != "link"} {
+        eval file attributes {$dst_element} [file attributes $src_element]
+        # set mtime on installed element
+        file mtime $dst_element [file mtime $src_element]
     }
 }
 
@@ -139,10 +128,10 @@
 }
 
 proc portinstall::install_main {args} {
-    global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
+    global name version portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot revision maintainers ports_force portvariants targets depends_lib PortInfo epoch license
     
     # Begin the registry entry
-    set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
+    set regref [registry_new $name $version $revision $portvariants $epoch]
     
     # Install the files
     directory_dig ${destroot} ${destroot} ${regref}
@@ -166,16 +155,16 @@
     }
     if {[info exists depends_run]} {
         registry_prop_store $regref depends_run $depends_run
-        registry_register_deps $depends_run $portname
+        registry_register_deps $depends_run $name
     }
     if {[info exists depends_lib]} {
         registry_prop_store $regref depends_lib $depends_lib
-        registry_register_deps $depends_lib $portname
+        registry_register_deps $depends_lib $name
     }
     if {[info exists installPlist]} {
         registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
         if { [registry_prop_retr $regref installtype] != "image" } {
-            registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $portname
+            registry_bulk_register_files [registry_fileinfo_for_index $installPlist] $name
         }
     }
     if {[info exists package-install]} {

Modified: branches/gsoc09-logging/base/src/port1.0/portlint.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portlint.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portlint.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -89,12 +89,12 @@
 
 
 proc portlint::lint_start {args} {
-    global UI_PREFIX portname
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying Portfile for %s"] ${portname}]"
+    global UI_PREFIX name
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Verifying Portfile for %s"] ${name}]"
 }
 
 proc portlint::lint_main {args} {
-    global UI_PREFIX portname portpath porturl ports_lint_nitpick
+    global UI_PREFIX name portpath porturl ports_lint_nitpick
     set portfile ${portpath}/Portfile
     set portdirs [split ${portpath} /]
     set last [llength $portdirs]
@@ -261,12 +261,12 @@
     ###################################################################
 
     global os.platform os.arch os.version
-    global portversion portrevision portepoch
+    global version revision epoch
     # hoping for "noarch" :
     set portarch ${os.arch}
     global description long_description platforms categories all_variants
     global maintainers homepage master_sites checksums patchfiles
-    global depends_lib depends_build depends_run distfiles fetch.type
+    global depends_fetch depends_extract depends_lib depends_build depends_run distfiles fetch.type
     
     global lint_portsystem lint_platforms
     global lint_required lint_optional
@@ -294,26 +294,19 @@
     }
 
     foreach req_var $lint_required {
-        if {$req_var == "name"} {
-            set var "portname"
-        } elseif {$req_var == "version"} {
-            set var "portversion"
-        } else {
-            set var $req_var
-        }
 
-        if {$var == "master_sites"} {
+        if {$req_var == "master_sites"} {
             if {${fetch.type} != "standard"} {
-                ui_info "OK: $var not required for fetch.type ${fetch.type}"
+                ui_info "OK: $req_var not required for fetch.type ${fetch.type}"
                 continue
             }
             if {[llength ${distfiles}] == 0} {
-                ui_info "OK: $var not required when there are no distfiles"
+                ui_info "OK: $req_var not required when there are no distfiles"
                 continue
             }
         }
 
-        if {![info exists $var]} {
+        if {![info exists $req_var]} {
             ui_error "Missing required variable: $req_var"
             incr errors
         } else {
@@ -322,14 +315,7 @@
     }
 
     foreach opt_var $lint_optional {
-        if {$opt_var == "epoch"} {
-            set var "portepoch"
-        } elseif {$opt_var == "revision"} {
-            set var "portrevision"
-        } else {
-            set var $opt_var
-        }
-        if {[info exists $var]} {
+        if {[info exists $opt_var]} {
             # TODO: check whether it was seen (or default)
             ui_info "OK: Found optional variable: $opt_var"
         }
@@ -356,12 +342,12 @@
         }
     }
 
-    if {![string is integer -strict $portepoch]} {
-        ui_error "Port epoch is not numeric:  $portepoch"
+    if {![string is integer -strict $epoch]} {
+        ui_error "Port epoch is not numeric:  $epoch"
         incr errors
     }
-    if {![string is integer -strict $portrevision]} {
-        ui_error "Port revision is not numeric: $portrevision"
+    if {![string is integer -strict $revision]} {
+        ui_error "Port revision is not numeric: $revision"
         incr errors
     }
 
@@ -426,6 +412,8 @@
     }
 
     set all_depends {}
+    if {[info exists depends_fetch]} { eval "lappend all_depends $depends_fetch" }
+    if {[info exists depends_extract]} { eval "lappend all_depends $depends_extract" }
     if {[info exists depends_lib]} { eval "lappend all_depends $depends_lib" }
     if {[info exists depends_build]} { eval "lappend all_depends $depends_build" }
     if {[info exists depends_run]} { eval "lappend all_depends $depends_run" }
@@ -472,8 +460,8 @@
     } else {
         ui_info "OK: Portfile parent directory matches primary category"
     }
-    if {$portdir != $portname} {
-        ui_error "Portfile directory $portdir does not match port name $portname"
+    if {$portdir != $name} {
+        ui_error "Portfile directory $portdir does not match port name $name"
         incr errors
     } else {
         ui_info "OK: Portfile directory matches port name"
@@ -488,12 +476,29 @@
         }
     }
 
+    # Check for use of deprecated options
+    set deprecated_options_name [get_deprecated_options]
+    global $deprecated_options_name
+    foreach option [array names $deprecated_options_name] {
+        set newoption [lindex [set ${deprecated_options_name}($option)] 0]
+        set refcount  [lindex [set ${deprecated_options_name}($option)] 1]
+
+        if {$refcount > 0} {
+            if {$newoption != ""} {
+                ui_warn "Using deprecated option '$option', superseded by '$newoption'"
+            } else {
+                ui_warn "Using deprecated option '$option'"
+            }
+            incr warnings
+        }
+    }
+
     ### TODO: more checks to Tcl variables/sections
 
-    ui_debug "Name: $portname"
-    ui_debug "Epoch: $portepoch"
-    ui_debug "Version: $portversion"
-    ui_debug "Revision: $portrevision"
+    ui_debug "Name: $name"
+    ui_debug "Epoch: $epoch"
+    ui_debug "Version: $version"
+    ui_debug "Revision: $revision"
     ui_debug "Arch: $portarch"
     ###################################################################
 

Modified: branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -46,21 +46,25 @@
 }
 
 # define options
-options livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
+options livecheck.url livecheck.type livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
 
 # defaults
 default livecheck.url {$homepage}
 default livecheck.check default
+default livecheck.type default
 default livecheck.md5 ""
 default livecheck.regex ""
 default livecheck.name default
 default livecheck.distname default
 default livecheck.version {$version}
 
+# Deprecation
+option_deprecate livecheck.check livecheck.type
+
 proc portlivecheck::livecheck_main {args} {
-    global livecheck.url livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
+    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert
-    global homepage portname portpath workpath
+    global homepage portpath workpath
     global master_sites name distfiles
 
     set updated 0
@@ -98,7 +102,7 @@
     # "freshmeat|gnu|...").
     set available_types [regsub -all {\.tcl} [join $available_types |] {}]
 
-    if {${livecheck.check} eq "default"} {
+    if {${livecheck.type} eq "default"} {
         # Determine the default type from the mirror.
         if {$has_master_sites} {
             foreach {master_site} ${master_sites} {
@@ -106,24 +110,25 @@
                     if {${subdir} ne "" && ${livecheck.name} eq "default"} {
                         set livecheck.name ${subdir}
                     }
-                    set livecheck.check ${site}
+                    set livecheck.type ${site}
 
                     break
                 }
             }
         }
         # If the default type cannot be determined from the mirror, use the
-        # fallback type (which is a symlink to one of the available types).
-        if {${livecheck.check} eq "default"} {
-            set livecheck.check "fallback"
+        # fallback.
+        if {${livecheck.type} eq "default"} {
+            set livecheck.type "fallback"
         }
-        # If livecheck.name is still "default", set it to $name.
-        if {${livecheck.name} eq "default"} {
-            set livecheck.name $name
-        }
-
-        # Load the defaults from _resources/port1.0/livecheck/${livecheck.check}.tcl.
-        set defaults_file "$types_dir/${livecheck.check}.tcl"
+    }
+    # If livecheck.name is still "default", set it to $name.
+    if {${livecheck.name} eq "default"} {
+        set livecheck.name $name
+    }
+    if {[lsearch -exact [split $available_types "|"] ${livecheck.type}] != -1} {
+        # Load the defaults from _resources/port1.0/livecheck/${livecheck.type}.tcl.
+        set defaults_file "$types_dir/${livecheck.type}.tcl"
         ui_debug "Loading the defaults from '$defaults_file'"
         if {[catch {source $defaults_file} result]} {
             return -code 1 "The defaults could not be loaded from '$defaults_file'."
@@ -133,13 +138,13 @@
     # de-escape livecheck.url
     set livecheck.url [join ${livecheck.url}]
 
-    switch ${livecheck.check} {
+    switch ${livecheck.type} {
         "regex" -
         "regexm" {
             # single and multiline regex
             ui_debug "Fetching ${livecheck.url}"
             if {[catch {eval curl fetch $fetch_options {${livecheck.url}} $tempfile} error]} {
-                ui_error "cannot check if $portname was updated ($error)"
+                ui_error "cannot check if $name was updated ($error)"
                 set updated -1
             } else {
                 # let's extract the version from the file.
@@ -147,7 +152,7 @@
                 set updated -1
                 set the_re [join ${livecheck.regex}]
                 ui_debug "The regex is \"$the_re\""
-                if {${livecheck.check} == "regexm"} {
+                if {${livecheck.type} == "regexm"} {
                     set data [read $chan]
                     if {[regexp $the_re $data matched updated_version]} {
                         if {$updated_version != ${livecheck.version}} {
@@ -181,14 +186,14 @@
                 }
                 close $chan
                 if {$updated < 0} {
-                    ui_error "cannot check if $portname was updated (regex didn't match)"
+                    ui_error "cannot check if $name was updated (regex didn't match)"
                 }
             }
         }
         "md5" {
             ui_debug "Fetching ${livecheck.url}"
             if {[catch {eval curl fetch $fetch_options {${livecheck.url}} $tempfile} error]} {
-                ui_error "cannot check if $portname was updated ($error)"
+                ui_error "cannot check if $name was updated ($error)"
                 set updated -1
             } else {
                 # let's compute the md5 sum.
@@ -202,7 +207,7 @@
         "moddate" {
             set port_moddate [file mtime ${portpath}/Portfile]
             if {[catch {set updated [curl isnewer ${livecheck.url} $port_moddate]} error]} {
-                ui_error "cannot check if $portname was updated ($error)"
+                ui_error "cannot check if $name was updated ($error)"
                 set updated -1
             } else {
                 if {!$updated} {
@@ -213,17 +218,17 @@
         "none" {
         }
         default {
-            ui_error "unknown livecheck.check ${livecheck.check}"
+            ui_error "unknown livecheck.type ${livecheck.type}"
         }
     }
 
     file delete -force $tempfile
 
-    if {${livecheck.check} != "none"} {
+    if {${livecheck.type} != "none"} {
         if {$updated > 0} {
-            ui_msg "$portname seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
+            ui_msg "$name seems to have been updated (port version: ${livecheck.version}, new version: $updated_version)"
         } elseif {$updated == 0} {
-            ui_info "$portname seems to be up to date"
+            ui_info "$name seems to be up to date"
         }
     }
 }

Modified: branches/gsoc09-logging/base/src/port1.0/portmain.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portmain.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portmain.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -45,12 +45,12 @@
 
 # define options
 options prefix macportsuser name version revision epoch categories maintainers
-options long_description description homepage license
+options long_description description homepage license provides conflicts
 options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target
 options universal_variant os.universal_supported
 
 # Export options via PortInfo
-options_export name version revision epoch categories maintainers platforms description long_description homepage license
+options_export name version revision epoch categories maintainers platforms description long_description homepage license provides conflicts
 
 # Assign option procedure to default_variants
 option_proc default_variants handle_default_variants
@@ -61,6 +61,7 @@
 default prefix /opt/local
 default applications_dir /Applications/MacPorts
 default frameworks_dir {${prefix}/Library/Frameworks}
+default developer_dir {/Developer}
 default destdir destroot
 default destpath {${workpath}/${destdir}}
 # destroot is provided as a clearer name for the "destpath" variable
@@ -69,7 +70,7 @@
 default revision 0
 default epoch 0
 default license unknown
-default distname {${portname}-${portversion}}
+default distname {${name}-${version}}
 default worksrcdir {$distname}
 default filespath {[file join $portpath $filesdir]}
 default worksrcpath {[file join $workpath $worksrcdir]}
@@ -79,12 +80,6 @@
 default install.user {${portutil::autoconf::install_user}}
 default install.group {${portutil::autoconf::install_group}}
 
-# Compatibility namespace
-default portname {$name}
-default portversion {$version}
-default portrevision {$revision}
-default portepoch {$epoch}
-
 # Platform Settings
 set os_arch $tcl_platform(machine)
 if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
@@ -134,6 +129,10 @@
     }
 }
 
+# Record initial euid/egid
+set euid [geteuid]
+set egid [getegid]
+
 proc portmain::main {args} {
     return 0
 }

Modified: branches/gsoc09-logging/base/src/port1.0/portmirror.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portmirror.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portmirror.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -52,7 +52,7 @@
 # It also records the path in a database.
 
 proc portmirror::mirror_main {args} {
-    global fetch.type portname mirror_filemap ports_mirror_new portdbpath
+    global fetch.type name mirror_filemap ports_mirror_new portdbpath
 
     set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
     if {![info exists mirror_filemap]

Modified: branches/gsoc09-logging/base/src/port1.0/portpatch.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portpatch.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portpatch.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -49,7 +49,7 @@
 # Set up defaults
 default patch.asroot no
 default patch.dir {${worksrcpath}}
-default patch.cmd patch
+default patch.cmd {[findBinary patch $portutil::autoconf::patch_path]}
 default patch.pre_args -p0
 
 proc portpatch::patch_main {args} {
@@ -57,45 +57,35 @@
 
     # First make sure that patchfiles exists and isn't stubbed out.
     if {![exists patchfiles]} {
-    return 0
+        return 0
     }
 
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option portname]]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option name]]"
 
-    # start gsoc08-privileges
-    if { [tbool patch.asroot] } {
-    # if port is marked as needing root
-        elevateToRoot "patch"
-    }
-    # end gsoc08-privileges
-
     foreach patch [option patchfiles] {
-    set patch_file [getdistname $patch]
-    if {[file exists [option filespath]/$patch_file]} {
-        lappend patchlist [option filespath]/$patch_file
-    } elseif {[file exists [option distpath]/$patch_file]} {
-        lappend patchlist [option distpath]/$patch_file
-    } else {
-        return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
+        set patch_file [getdistname $patch]
+        if {[file exists [option filespath]/$patch_file]} {
+            lappend patchlist [option filespath]/$patch_file
+        } elseif {[file exists [option distpath]/$patch_file]} {
+            lappend patchlist [option distpath]/$patch_file
+        } else {
+            return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
+        }
     }
-    }
     if {![info exists patchlist]} {
-    return -code error [msgcat::mc "Patch files missing"]
+        return -code error [msgcat::mc "Patch files missing"]
     }
     _cd [option worksrcpath]
+    set gzcat "[findBinary gzip $portutil::autoconf::gzip_path] -dc"
+    set bzcat "[findBinary bzip2 $portutil::autoconf::bzip2_path] -dc"
     foreach patch $patchlist {
-    ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
-    if {[option os.platform] == "linux"} {
-        set gzcat "zcat"
-    } else {
-        set gzcat "gzcat"
+        ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
+        switch -- [file extension $patch] {
+            .Z -
+            .gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
+            .bz2 {command_exec patch "$bzcat \"$patch\" | (" ")"}
+            default {command_exec patch "" "< '$patch'"}
+        }
     }
-    switch -glob -- [file tail $patch] {
-        *.Z -
-        *.gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
-        *.bz2 {command_exec patch "bzcat \"$patch\" | (" ")"}
-        default {command_exec patch "" "< '$patch'"}
-    }
-    }
     return 0
 }

Modified: branches/gsoc09-logging/base/src/port1.0/portstartupitem.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portstartupitem.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portstartupitem.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -74,7 +74,7 @@
 set_ui_prefix
 
 proc portstartupitem::startupitem_create_rcng {args} {
-    global prefix destroot portname os.platform
+    global prefix destroot name os.platform
     global startupitem.name startupitem.requires
     global startupitem.start startupitem.stop startupitem.restart
     global startupitem.type
@@ -120,7 +120,7 @@
 }
 
 proc portstartupitem::startupitem_create_darwin_systemstarter {args} {
-    global UI_PREFIX prefix destroot destroot.keepdirs  portname os.platform
+    global UI_PREFIX prefix destroot destroot.keepdirs name os.platform
     global startupitem.name startupitem.requires startupitem.init
     global startupitem.start startupitem.stop startupitem.restart startupitem.executable
     global startupitem.pidfile startupitem.logfile startupitem.logevents
@@ -177,10 +177,10 @@
         # An executable is specified, and there is no init, start, stop, or restart
     } else {
         if { ![llength ${startupitem.start} ] } {
-            set startupitem.start [list "sh ${scriptdir}/${portname}.sh start"]
+            set startupitem.start [list "sh ${scriptdir}/${name}.sh start"]
         }
         if { ![llength ${startupitem.stop} ] } {
-            set startupitem.stop [list "sh ${scriptdir}/${portname}.sh stop"]
+            set startupitem.stop [list "sh ${scriptdir}/${name}.sh stop"]
         }
     }
     if { ![llength ${startupitem.requires} ] } {
@@ -377,7 +377,7 @@
     # Emit some information for the user
     ui_msg "###########################################################"
     ui_msg "# A startup item has been generated that will aid in"
-    ui_msg "# starting ${portname} with SystemStarter. It is disabled"
+    ui_msg "# starting ${name} with SystemStarter. It is disabled"
     ui_msg "# by default. Add the following line to /etc/hostconfig"
     ui_msg "# or ${prefix}/etc/rc.conf to start it at startup:"
     ui_msg "#"
@@ -386,7 +386,7 @@
 }
 
 proc portstartupitem::startupitem_create_darwin_launchd {args} {
-    global UI_PREFIX prefix destroot destroot.keepdirs portname os.platform
+    global UI_PREFIX prefix destroot destroot.keepdirs name os.platform
     global startupitem.name startupitem.uniquename startupitem.plist startupitem.location
     global startupitem.init startupitem.start startupitem.stop startupitem.restart startupitem.executable
     global startupitem.pidfile startupitem.logfile startupitem.logevents startupitem.netchange
@@ -425,10 +425,10 @@
         set wrapper         "${itemdir}/${wrappername}"
 
         if { ![llength ${startupitem.start}] } {
-            set startupitem.start [list "sh ${scriptdir}/${portname}.sh start"]
+            set startupitem.start [list "sh ${scriptdir}/${name}.sh start"]
         }
         if { ![llength ${startupitem.stop}] } {
-            set startupitem.stop [list "sh ${scriptdir}/${portname}.sh stop"]
+            set startupitem.stop [list "sh ${scriptdir}/${name}.sh stop"]
         }
         if { ![llength ${startupitem.restart}] } {
             set startupitem.restart [list Stop Start]
@@ -603,7 +603,7 @@
     # Emit some information for the user
     ui_msg "###########################################################"
     ui_msg "# A startup item has been generated that will aid in"
-    ui_msg "# starting ${portname} with launchd. It is disabled"
+    ui_msg "# starting ${name} with launchd. It is disabled"
     ui_msg "# by default. Execute the following command to start it,"
     ui_msg "# and to cause it to launch at startup:"
     ui_msg "#"

Modified: branches/gsoc09-logging/base/src/port1.0/portsubmit.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portsubmit.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portsubmit.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -55,7 +55,7 @@
 
 
 proc portsubmit::submit_main {args} {
-    global mp_remote_submit_url portname portversion portverbose prefix UI_PREFIX workpath portpath
+    global mp_remote_submit_url name version portverbose prefix UI_PREFIX workpath portpath
 
     set submiturl $mp_remote_submit_url
 
@@ -68,7 +68,7 @@
     file mkdir ${workpath}
 
     # Create portpkg.xar in the work directory
-    set pkgpath "${workpath}/${portname}.portpkg"
+    set pkgpath "${workpath}/${name}.portpkg"
 
     # TODO: If a private key was provided, create a signed digest of the submission
 
@@ -83,13 +83,13 @@
     set cmd [join $args]
 
     if {[tbool portverbose]} {
-        ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
+        ui_msg "Submitting portpkg $pkgpath for $name to $submiturl"
     }
 
     # Invoke curl to do the submit
     ui_debug $cmd
     if {[system $cmd] != ""} {
-        return -code error [format [msgcat::mc "Failure during submit of port %s"] $portname]
+        return -code error [format [msgcat::mc "Failure during submit of port %s"] $name]
     }
 
     # Parse the result
@@ -108,7 +108,7 @@
     }
     if {[info exists result(STATUS)]} {
         if { $result(STATUS) == 0 } {
-            ui_msg "Submitted portpkg for $portname"
+            ui_msg "Submitted portpkg for $name"
             if {[info exists result(DOWNLOAD_URL)]} {
                 ui_msg "    download URL => $result(DOWNLOAD_URL)"
             }
@@ -116,10 +116,10 @@
                 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]
+            return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $name]
         }
     } else {
-        return -code error [format [msgcat::mc "Status not received during submit of port %s"] $portname]
+        return -code error [format [msgcat::mc "Status not received during submit of port %s"] $name]
     }
 
     return
@@ -136,7 +136,7 @@
     }
 
     if {[system $cmd] != ""} {
-    return -code error [format [msgcat::mc "Failed to archive port : %s"] $portname]
+    return -code error [format [msgcat::mc "Failed to archive port : %s"] $name]
     }
 
     set portsource ""
@@ -152,13 +152,13 @@
         close $fd
     }
     if {$portsource == ""} {
-        ui_msg "$UI_PREFIX Submitting $portname-$portversion"
+        ui_msg "$UI_PREFIX Submitting $name-$version"
         puts -nonewline "URL: "
         flush stdout
         gets stdin portsource
     }
 
-    ui_msg "$UI_PREFIX Submitting $portname-$portversion to $portsource"
+    ui_msg "$UI_PREFIX Submitting $name-$version to $portsource"
 
     puts -nonewline "Username: "
     flush stdout
@@ -170,7 +170,7 @@
     puts ""
     exec stty echo
 
-    set vars {portname portversion maintainers categories description \
+    set vars {name version maintainers categories description \
         long_description master_sites}
     eval "global $vars"
     foreach var $vars {
@@ -181,8 +181,8 @@
     append cmd "--silent "
     append cmd "--url [regsub -- {^mports} $portsource {http}]/cgi-bin/portsubmit.cgi "
     append cmd "--output ${workpath}/.portsubmit.out "
-    append cmd "-F name=${portname} "
-    append cmd "-F version=${portversion} "
+    append cmd "-F name=${name} "
+    append cmd "-F version=${version} "
     append cmd "-F base_rev=${base_rev} "
     append cmd "-F md5=[md5 file ${workpath}/Portfile.tar.gz] "
     append cmd "-F attachment=@${workpath}/Portfile.tar.gz "
@@ -196,7 +196,7 @@
 
     ui_debug $cmd
     if {[system $cmd] != ""} {
-    return -code error [format [msgcat::mc "Failed to submit port : %s"] $portname]
+    return -code error [format [msgcat::mc "Failed to submit port : %s"] $name]
     }
 
     #
@@ -217,12 +217,12 @@
     if {[info exists result(OK)]} {
         set fd [open ".mports_source" w]
         puts $fd "source: $portsource"
-        puts $fd "port: $portname"
-        puts $fd "version: $portversion"
+        puts $fd "port: $name"
+        puts $fd "version: $version"
         puts $fd "revision: $result(revision)"
         close $fd
 
-        ui_msg "$portname-$portversion submitted successfully."
+        ui_msg "$name-$version submitted successfully."
         ui_msg "New revision: $result(revision)"
     } elseif {[info exists result(ERROR)]} {
         return -code error $result(ERROR)
@@ -232,14 +232,14 @@
         set tmpdir [mktemp "/tmp/mports.XXXXXXXX"]
         file mkdir $tmpdir/new
         file mkdir $tmpdir/old
-        set worker [mport_open $portsource/files/$portname/$portversion/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
+        set worker [mport_open $portsource/files/$name/$version/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new]]
         if {$base_rev != ""} {
-            set worker2 [mport_open $portsource/files/$portname/$portversion/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
-            catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$portname-$portversion/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
+            set worker2 [mport_open $portsource/files/$name/$version/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old]]
+            catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$name-$version/Portfile $tmpdir/new/$name-$version/Portfile > $tmpdir/Portfile"}
             file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
             mport_close $worker2
         } else {
-            catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$portname-$portversion/Portfile > $tmpdir/Portfile"}
+            catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$name-$version/Portfile > $tmpdir/Portfile"}
             file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
         }
         mport_close $worker
@@ -247,13 +247,13 @@
 
         set fd [open [file join "$portpath" ".mports_source"] w]
         puts $fd "source: $portsource"
-        puts $fd "port: $portname"
-        puts $fd "version: $portversion"
+        puts $fd "port: $name"
+        puts $fd "version: $version"
         puts $fd "revision: $result(revision)"
         close $fd
 
         ui_error "A newer revision of this port has already been submitted."
-        ui_error "Portfile: $portname-$portversion"
+        ui_error "Portfile: $name-$version"
         ui_error "Base revision: $base_rev"
         ui_error "Current revision: $result(revision)"
         ui_error "Please edit the Portfile to resolve any conflicts and resubmit."

Modified: branches/gsoc09-logging/base/src/port1.0/porttest.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/porttest.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/porttest.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -26,16 +26,16 @@
 set_ui_prefix
 
 proc porttest::test_start {args} {
-    global UI_PREFIX portname
-    ui_msg "$UI_PREFIX [format [msgcat::mc "Testing %s"] ${portname}]"
+    global UI_PREFIX name
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Testing %s"] ${name}]"
 }
 
 proc porttest::test_main {args} {
-    global portname test.run
+    global name test.run
     if {[tbool test.run]} {
         command_exec test
     } else {
-    return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $portname]
+    return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $name]
     }
     return 0
 }

Modified: branches/gsoc09-logging/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portutil.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/port1.0/portutil.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -54,32 +54,33 @@
 # option
 # This is an accessor for Portfile options.  Targets may use
 # this in the same style as the standard Tcl "set" procedure.
-#   name  - the name of the option to read or write
+#   option  - the name of the option to read or write
+#       not called 'name' because this would fail if its value was 'name'...
 #   value - an optional value to assign to the option
 
-proc option {name args} {
+proc option {option args} {
     # XXX: right now we just transparently use globals
     # eventually this will need to bridge the options between
     # the Portfile's interpreter and the target's interpreters.
-    global $name
+    global $option
     if {[llength $args] > 0} {
-        ui_debug "setting option $name to $args"
-        set $name [lindex $args 0]
+        ui_debug "setting option $option to $args"
+        set $option [lindex $args 0]
     }
-    return [set $name]
+    return [set $option]
 }
 
 # exists
 # This is an accessor for Portfile options.  Targets may use
 # this procedure to test for the existence of a Portfile option.
-#   name - the name of the option to test for existence
+#   option - the name of the option to test for existence
 
-proc exists {name} {
+proc exists {option} {
     # XXX: right now we just transparently use globals
     # eventually this will need to bridge the options between
     # the Portfile's interpreter and the target's interpreters.
-    global $name
-    return [info exists $name]
+    global $option
+    return [info exists $option]
 }
 
 ##
@@ -196,17 +197,20 @@
 # @param option deprecated option
 # @param action read/set
 # @param value ignored
-proc warn_deprecated_option {option action {value ""}} {
-    global portname $option deprecated_options
-    set newoption $deprecated_options($option)
+proc handle_deprecated_option {option action {value ""}} {
+    global name $option deprecated_options
+    set newoption [lindex $deprecated_options($option) 0]
+    set refcount  [lindex $deprecated_options($option) 1]
     global $newoption
 
     if {$newoption == ""} {
-        ui_warn "Port $portname using deprecated option \"$option\"."
+        ui_warn "Port $name using deprecated option \"$option\"."
         return
     }
 
-    ui_warn "Port $portname using deprecated option \"$option\", superseded by \"$newoption\"."
+    # Increment reference counter
+    lset deprecated_options($option) 1 [expr $refcount + 1]
+
     if {$action != "read"} {
         $newoption [set $option]
     } else {
@@ -215,16 +219,26 @@
 }
 
 ##
-# Causes a warning to be printed when an option is set or accessed
+# Get the name of the array containing the deprecated options
+# Thin layer avoiding to share global variables without notice
+proc get_deprecated_options {} {
+    return "deprecated_options"
+}
+
+##
+# Mark an option as deprecate
+# If it is set or accessed, it will be mapped it to the new option
 #
 # @param option name of the option
 # @param newoption name of a superseding option
 proc option_deprecate {option {newoption ""} } {
     global deprecated_options
     # If a new option is specified, default the option to $newoption
-    set deprecated_options($option) $newoption
-    # Register a proc for printing a warning
-    option_proc $option warn_deprecated_option
+    set deprecated_options($option) [list $newoption 0]
+    # Create a normal option for compatibility
+    options $option
+    # Register a proc for handling the deprecation
+    option_proc $option handle_deprecated_option
 }
 
 ##
@@ -815,7 +829,6 @@
 # reinplace
 # Provides "sed in place" functionality
 proc reinplace {args}  {
-    global euid macportsuser
 
     set extended 0
     while 1 {
@@ -1159,7 +1172,7 @@
         foreach arch $universal_archlist {
             append lipoSources "-arch ${arch} ${workpath}/${arch}/${file} "
         }
-        system "lipo ${lipoSources}-create -output ${file}"
+        system "[findBinary lipo $portutil::autoconf::lipo_path] ${lipoSources}-create -output ${file}"
     }
 }
 
@@ -1194,7 +1207,8 @@
 set ports_dry_last_skipped ""
 
 proc target_run {ditem} {
-    global target_state_fd portname workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped errorisprivileges
+    global target_state_fd workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped
+    set portname [option name]
     set result 0
     set skipped 0
     set procedure [ditem_key $ditem procedure]
@@ -1204,18 +1218,21 @@
     }
 
     if {$procedure != ""} {
-        set name [ditem_key $ditem name]
+        set targetname [ditem_key $ditem name]
+        if { [tbool ${targetname}.asroot] } {
+            elevateToRoot $targetname
+        }
 
         if {[ditem_contains $ditem init]} {
-            set result [catch {[ditem_key $ditem init] $name} errstr]
+            set result [catch {[ditem_key $ditem init] $targetname} errstr]
         }
 
         if {$result == 0} {
             # Skip the step if required and explain why through ui_debug.
             # check if the step was already done (as mentioned in the state file)
             if {[ditem_key $ditem state] != "no"
-                    && [check_statefile target $name $target_state_fd]} {
-                ui_debug "Skipping completed $name ($portname)"
+                    && [check_statefile target $targetname $target_state_fd]} {
+                ui_debug "Skipping completed $targetname ($portname)"
                 set skipped 1
             }
 
@@ -1223,10 +1240,10 @@
             if {[info exists ports_dryrun] && $ports_dryrun == "yes"} {
                 # only one message per portname
                 if {$portname != $ports_dry_last_skipped} {
-                    ui_msg "For $portname: skipping $name (dry run)"
+                    ui_msg "For $portname: skipping $targetname (dry run)"
                     set ports_dry_last_skipped $portname
                 } else {
-                    ui_info "    .. and skipping $name"
+                    ui_info "    .. and skipping $targetname"
                 }
                 set skipped 1
             }
@@ -1237,7 +1254,7 @@
 
                 # Execute pre-run procedure
                 if {[ditem_contains $ditem prerun]} {
-                    set result [catch {[ditem_key $ditem prerun] $name} errstr]
+                    set result [catch {[ditem_key $ditem prerun] $targetname} errstr]
                 }
 
                 #start tracelib
@@ -1257,81 +1274,75 @@
                     }
 
                     # collect deps
+                    set depends {}
+                    set deptypes {}
 
-                    # Don't check dependencies for extract (they're not honored
-                    # anyway). This avoids warnings about bzip2.
-                    if {$target != "extract"} {
-                        set depends {}
-                        set deptypes {}
+                    # Determine deptypes to look for based on target
+                    switch $target {
+                        fetch       -
+                        checksum    { set deptypes "depends_fetch" }
+                        extract     -
+                        patch       { set deptypes "depends_fetch depends_extract" }
+                        configure   -
+                        build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
 
-                        # Determine deptypes to look for based on target
-                        switch $target {
-                            configure   -
-                            build       { set deptypes "depends_lib depends_build" }
+                        test        -
+                        destroot    -
+                        install     -
+                        archive     -
+                        dmg         -
+                        pkg         -
+                        portpkg     -
+                        mpkg        -
+                        rpm         -
+                        srpm        -
+                        dpkg        -
+                        mdmg        -
+                        activate    -
+                        ""          { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run" }
+                    }
 
-                            test        -
-                            destroot    -
-                            install     -
-                            archive     -
-                            dmg         -
-                            pkg         -
-                            portpkg     -
-                            mpkg        -
-                            rpm         -
-                            srpm        -
-                            dpkg        -
-                            mdmg        -
-                            activate    -
-                            ""          { set deptypes "depends_lib depends_build depends_run" }
+                    # Gather the dependencies for deptypes
+                    foreach deptype $deptypes {
+                        # Add to the list of dependencies if the option exists and isn't empty.
+                        if {[info exists PortInfo($deptype)] && $PortInfo($deptype) != ""} {
+                            set depends [concat $depends $PortInfo($deptype)]
                         }
+                    }
 
-                        # Gather the dependencies for deptypes
-                        foreach deptype $deptypes {
-                            # Add to the list of dependencies if the option exists and isn't empty.
-                            if {[info exists PortInfo($deptype)] && $PortInfo($deptype) != ""} {
-                                set depends [concat $depends $PortInfo($deptype)]
-                            }
-                        }
+                    # Dependencies are in the form verb:[param:]port
+                    set depsPorts {}
+                    foreach depspec $depends {
+                        # grab the portname portion of the depspec
+                        set dep_portname [lindex [split $depspec :] end]
+                        lappend depsPorts $dep_portname
+                    }
 
-                        # Dependencies are in the form verb:[param:]port
-                        set depsPorts {}
-                        foreach depspec $depends {
-                            # grab the portname portion of the depspec
-                            set dep_portname [lindex [split $depspec :] end]
-                            lappend depsPorts $dep_portname
-                        }
-
-                        # always allow gzip in destroot as it is used to compress man pages
-                        if {$target == "destroot"} {
-                            lappend depsPorts "gzip"
-                        }
-
-                        set portlist $depsPorts
-                        foreach depName $depsPorts {
-                            set portlist [recursive_collect_deps $depName $deptypes $portlist]
-                        }
-
-                        if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
+                    set portlist $depsPorts
+                    foreach depName $depsPorts {
+                        set portlist [recursive_collect_deps $depName $deptypes $portlist]
                     }
+
+                    if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
                 }
 
                 if {$result == 0} {
                     foreach pre [ditem_key $ditem pre] {
                         ui_debug "Executing $pre"
-                        set result [catch {$pre $name} errstr]
+                        set result [catch {$pre $targetname} errstr]
                         if {$result != 0} { break }
                     }
                 }
 
                 if {$result == 0} {
-                ui_debug "Executing $name ($portname)"
-                set result [catch {$procedure $name} errstr]
+                ui_debug "Executing $targetname ($portname)"
+                set result [catch {$procedure $targetname} errstr]
                 }
 
                 if {$result == 0} {
                     foreach post [ditem_key $ditem post] {
                         ui_debug "Executing $post"
-                        set result [catch {$post $name} errstr]
+                        set result [catch {$post $targetname} errstr]
                         if {$result != 0} { break }
                     }
                 }
@@ -1339,7 +1350,7 @@
                 if {[ditem_contains $ditem postrun] && $result == 0} {
                     set postrun [ditem_key $ditem postrun]
                     ui_debug "Executing $postrun"
-                    set result [catch {$postrun $name} errstr]
+                    set result [catch {$postrun $targetname} errstr]
                 }
 
                 # Check dependencies & file creations outside workpath.
@@ -1364,21 +1375,17 @@
             if {$skipped == 0
           && [ditem_key $ditem runtype] != "always"
           && [ditem_key $ditem state] != "no"} {
-            write_statefile target $name $target_state_fd
+            write_statefile target $targetname $target_state_fd
             }
         } else {
-            if {$errorisprivileges != "yes"} {
-                global errorInfo
-                ui_error "Target $name returned: $errstr"
-                ui_debug "Backtrace: $errorInfo"
-            } else {
-                ui_msg "Target $name returned: $errstr"
-            }
+            global errorInfo
+            ui_error "Target $targetname returned: $errstr"
+            ui_debug "Backtrace: $errorInfo"
             set result 1
         }
 
     } else {
-        ui_info "Warning: $name does not have a registered procedure"
+        ui_info "Warning: $targetname does not have a registered procedure"
         set result 1
     }
 
@@ -1423,27 +1430,26 @@
 
 
 proc eval_targets {target} {
-    global targets target_state_fd portname portversion portrevision portvariants ports_dryrun user_options errorisprivileges
+    global targets target_state_fd name version revision portvariants ports_dryrun user_options
     set dlist $targets
-    set errorisprivileges "no"
 
     # the statefile will likely be autocleaned away after install,
     # so special-case ignore already-completed install and activate
-    if {[registry_exists $portname $portversion $portrevision $portvariants]} {
+    if {[registry_exists $name $version $revision $portvariants]} {
         if {$target == "install"} {
-            ui_debug "Skipping $target ($portname) since this port is already installed"
+            ui_debug "Skipping $target ($name) since this port is already installed"
             return 0
         } elseif {$target == "activate"} {
-            set regref [registry_open $portname $portversion $portrevision $portvariants]
+            set regref [registry_open $name $version $revision $portvariants]
             if {[registry_prop_retr $regref active] != 0} {
                 # Something to close the registry entry may be called here, if it existed.
-                ui_debug "Skipping $target ($portname @${portversion}_${portrevision}${portvariants}) since this port is already active"
+                ui_debug "Skipping $target ($name @${version}_${revision}${portvariants}) since this port is already active"
             } else {
                 # do the activate here since target_run doesn't know how to selectively ignore the preceding steps
                 if {[info exists ports_dryrun] && $ports_dryrun == "yes"} {
-                    ui_msg "For $portname: skipping $target (dry run)"
+                    ui_msg "For $name: skipping $target (dry run)"
                 } else {
-                    registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
+                    registry_activate $name ${version}_${revision}${portvariants} [array get user_options]
                 }
             }
             return 0
@@ -1467,7 +1473,7 @@
 
     if {[llength $dlist] > 0} {
         # somebody broke!
-        set errstring "Warning: the following items did not execute (for $portname):"
+        set errstring "Warning: the following items did not execute (for $name):"
         foreach ditem $dlist {
             append errstring " [ditem_key $ditem name]"
         }
@@ -1477,26 +1483,16 @@
         set result 0
     }
 
-    # start gsoc08-privileges
-    if { $result == 1 && $errorisprivileges == "yes" } {
-        set result 2
-    }
-    # end gsoc08-privileges
-
     return $result
 }
 
 # open_statefile
 # open file to store name of completed targets
 proc open_statefile {args} {
-    global workpath worksymlink place_worksymlink portname portpath ports_ignore_older
+    global workpath worksymlink place_worksymlink name portpath ports_ignore_older
     global altprefix usealtworkpath env applications_dir portbuildpath distpath
 
     # start gsoc08-privileges
-
-    # de-escalate privileges - only run if MacPorts was started with sudo
-    dropPrivileges
-
     if { ![file exists $workpath] } {
         if {[catch {set result [file mkdir $workpath]} result]} {
             global errorInfo
@@ -1513,7 +1509,7 @@
 
         if { $userid !=0 } {
             ui_msg "MacPorts running without privileges.\
-                    You may be prompted for your sudo password in order to complete certain actions (eg install)."
+                    You may be unable to complete certain actions (eg install)."
         }
 
         # set global variable indicating to other functions to use ~/.macports as well
@@ -1570,8 +1566,9 @@
     if {![file isdirectory $workpath]} {
         file mkdir $workpath
     }
+
     # flock Portfile
-    set statefile [file join $workpath .macports.${portname}.state]
+    set statefile [file join $workpath .macports.${name}.state]
     if {[file exists $statefile]} {
         if {![file writable $statefile]} {
             return -code error "$statefile is not writable - check permission on port directory"
@@ -1583,20 +1580,23 @@
             file mkdir [file join $workpath]
         }
     }
+    chownAsRoot $workpath
 
     # Create a symlink to the workpath for port authors
     if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
         ui_debug "Attempting ln -sf $workpath $worksymlink"
         ln -sf $workpath $worksymlink
     }
+    # de-escalate privileges - only run if MacPorts was started with sudo
+    dropPrivileges
 
     set fd [open $statefile a+]
     if {[catch {flock $fd -exclusive -noblock} result]} {
         if {"$result" == "EAGAIN"} {
             ui_msg "Waiting for lock on $statefile"
-    } elseif {"$result" == "EOPNOTSUPP"} {
-        # Locking not supported, just return
-        return $fd
+        } elseif {"$result" == "EOPNOTSUPP"} {
+            # Locking not supported, just return
+            return $fd
         } else {
             return -code error "$result obtaining lock on $statefile"
         }
@@ -1868,7 +1868,7 @@
     } elseif {[exists use_xmkmf] && [option use_xmkmf]} {
         ui_debug "using xmkmf, so not adding the default universal variant"
         return no
-    } elseif {[exists use_configure] && ![option use_configure] && ![exists xcode.universal.settings]} {
+    } elseif {[exists use_configure] && ![option use_configure] && ![exists xcode.project]} {
         # Allow +universal if port uses xcode portgroup.
         ui_debug "not using configure, so not adding the default universal variant"
         return no
@@ -2068,12 +2068,13 @@
     }
 
     if {${os.platform} eq "darwin"} {
-        exec dscl . -create /Users/${name} Password ${passwd}
-        exec dscl . -create /Users/${name} UniqueID ${uid}
-        exec dscl . -create /Users/${name} PrimaryGroupID ${gid}
-        exec dscl . -create /Users/${name} RealName ${realname}
-        exec dscl . -create /Users/${name} NFSHomeDirectory ${home}
-        exec dscl . -create /Users/${name} UserShell ${shell}
+        set dscl [findBinary dscl $portutil::autoconf::dscl_path]
+        exec $dscl . -create /Users/${name} Password ${passwd}
+        exec $dscl . -create /Users/${name} UniqueID ${uid}
+        exec $dscl . -create /Users/${name} PrimaryGroupID ${gid}
+        exec $dscl . -create /Users/${name} RealName ${realname}
+        exec $dscl . -create /Users/${name} NFSHomeDirectory ${home}
+        exec $dscl . -create /Users/${name} UserShell ${shell}
     } else {
         # XXX adduser is only available for darwin, add more support here
         ui_warn "WARNING: adduser is not implemented on ${os.platform}."
@@ -2099,11 +2100,12 @@
     }
 
     if {${os.platform} eq "darwin"} {
-        exec dscl . -create /Groups/${name} Password ${passwd}
-        exec dscl . -create /Groups/${name} RealName ${realname}
-        exec dscl . -create /Groups/${name} PrimaryGroupID ${gid}
+        set dscl [findBinary dscl $portutil::autoconf::dscl_path]
+        exec $dscl . -create /Groups/${name} Password ${passwd}
+        exec $dscl . -create /Groups/${name} RealName ${realname}
+        exec $dscl . -create /Groups/${name} PrimaryGroupID ${gid}
         if {${users} ne ""} {
-            exec dscl . -create /Groups/${name} GroupMembership ${users}
+            exec $dscl . -create /Groups/${name} GroupMembership ${users}
         }
     } else {
         # XXX addgroup is only available for darwin, add more support here
@@ -2130,7 +2132,7 @@
 }
 
 # check for a binary in the path
-# returns an error code if it can not be found
+# returns an error code if it cannot be found
 proc binaryInPath {binary} {
     global env
     foreach dir [split $env(PATH) :] {
@@ -2261,7 +2263,7 @@
         set exec-lipo [concat ${exec-lipo} [list "-arch" "${arch}" "${base}/${arch}${file}"]]
     }
     set exec-lipo [concat ${exec-lipo}]
-    system "/usr/bin/lipo ${exec-lipo} -create -output ${target}${file}"
+    system "[findBinary lipo $portutil::autoconf::lipo_path] ${exec-lipo} -create -output ${target}${file}"
 }
 
 # private function
@@ -2285,7 +2287,7 @@
     ui_debug "ba: '${basearch}' ('${archs}')"
     foreach arch [lrange ${archs} 1 end] {
         # checking for differences; TODO: error more gracefully on non-equal files
-        exec "/usr/bin/diff" "-q" "${base}/${basearch}${file}" "${base}/${arch}${file}"
+        exec [findBinary diff $portutil::autoconf::diff_path] "-q" "${base}/${basearch}${file}" "${base}/${arch}${file}"
     }
     ui_debug "ba: '${basearch}'"
     file copy "${base}/${basearch}${file}" "${target}${file}"
@@ -2314,7 +2316,7 @@
         set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]]
         if {${fpath} != ""} {
             # determine the type (dir/file/link)
-            set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"]
+            set filetype [exec [findBinary file $portutil::autoconf::file_path] "-b" "${basepath}${fpath}"]
             switch -regexp ${filetype} {
                 directory {
                     # just create directories
@@ -2396,7 +2398,7 @@
 #
 # @param action the action for which privileges are being elevated
 proc elevateToRoot {action} {
-    global euid egid macportsuser errorisprivileges
+    global euid egid macportsuser
 
     if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
     # if started with sudo but have dropped the privileges
@@ -2407,8 +2409,7 @@
     }
 
     if { [getuid] != 0 } {
-        set errorisprivileges yes
-        return -code error "port requires root privileges for this action and needs you to type your password for sudo.";
+        return -code error "MacPorts requires root privileges for this action";
     }
 }
 
@@ -2419,21 +2420,15 @@
     global euid egid macportsuser workpath
     if { [geteuid] == 0 } {
         if { [catch {
-                set euid [geteuid]
-                set egid [getegid]
                 ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
 
                 #seteuid [name_to_uid [file attributes $workpath -owner]]
                 #setegid [name_to_gid [file attributes $workpath -group]]
 
-                setegid [name_to_gid "$macportsuser"]
+                setegid [uname_to_gid "$macportsuser"]
                 seteuid [name_to_uid "$macportsuser"]
                 ui_debug "egid changed to: [getegid]"
                 ui_debug "euid changed to: [geteuid]"
-
-                if {![file writable $workpath]} {
-                    ui_debug "Privileges successfully de-escalated. Unable to write to default workpath."
-                }
             }]
         } {
             ui_debug "$::errorInfo"

Modified: branches/gsoc09-logging/base/src/registry1.0/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/registry1.0/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/registry1.0/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -15,7 +15,7 @@
 distclean:: clean
 	rm -f registry_autoconf.tcl
 
-install::
+install:: all
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
 	$(SILENT)set -x; for file in ${SRCS}; do \
 		$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \

Modified: branches/gsoc09-logging/base/src/registry1.0/portimage.tcl
===================================================================
--- branches/gsoc09-logging/base/src/registry1.0/portimage.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/registry1.0/portimage.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -124,13 +124,13 @@
 	
 	set imagefiles [_check_contents $name $contents $imagedir]
 	
+	registry::open_file_map
 	_activate_contents $name $imagefiles $imagedir
 
 	registry::property_store $ref active 1
 
 	registry::write_entry $ref
 
-	registry::open_file_map
 	foreach file $imagefiles {
 		registry::register_file $file $name
 	}
@@ -280,18 +280,10 @@
 		# Don't do anything if the directory already exists.
 		if { ![file isdirectory $dstfile] } {
 			file mkdir $dstfile
-	
 			# fix attributes on the directory.
-			set attributes [file attributes $srcfile]
-			for {set i 0} {$i < [llength $attributes]} {incr i} {
-				set opt [lindex $attributes $i]
-				incr i
-				set arg [lindex $attributes $i]
-				file attributes $dstfile $opt $arg
-			}
-	
+			eval file attributes {$dstfile} [file attributes $srcfile]
 			# set mtime on installed element
-			exec touch -r $srcfile $dstfile
+			file mtime $dstfile [file mtime $srcfile]
 		}
 	} elseif { [file type $srcfile] == "link" } {
 		file copy -force $srcfile $dstfile
@@ -330,7 +322,6 @@
 	# Last, if the file exists, and belongs to another port, and force is set
 	#  we remove the file from the file_map, take ownership of it, and 
 	#  clobber it
-	registry::open_file_map
 	foreach file $imagefiles {
 		set srcfile ${imagedir}${file}
 
@@ -382,7 +373,6 @@
 		lappend files $file
 	}
 	registry::write_file_map
-	registry::close_file_map
 
 	# Sort the list in forward order, removing duplicates.
 	# Since the list is sorted in forward order, we're sure that directories

Modified: branches/gsoc09-logging/base/src/registry1.0/portuninstall.tcl
===================================================================
--- branches/gsoc09-logging/base/src/registry1.0/portuninstall.tcl	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/registry1.0/portuninstall.tcl	2009-06-12 08:57:53 UTC (rev 52218)
@@ -124,10 +124,18 @@
 
 	set installtype [registry::property_retrieve $ref installtype]
 	if { $installtype == "image" && [registry::property_retrieve $ref active] == 1} {
-		#return -code error [msgcat::mc "Registry Error: ${portname} ${version}_${revision}${variants} is active."]
-		portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
+		if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} {
+			ui_msg "For $portname @${version}_${revision}${variants}: skipping deactivate (dry run)"
+		} else {
+			portimage::deactivate $portname ${version}_${revision}${variants} $optionslist
+		}
 	}
 
+	if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} {
+		ui_msg "For $portname @${version}_${revision}${variants}: skipping uninstall (dry run)"
+		return 0
+	}
+	
 	ui_msg "$UI_PREFIX [format [msgcat::mc "Uninstalling %s @%s_%s%s"] $portname $version $revision $variants]"
 
 	# Look to see if the port has registered an uninstall procedure

Modified: branches/gsoc09-logging/base/src/registry2.0/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/registry2.0/Makefile	2009-06-12 08:53:54 UTC (rev 52217)
+++ branches/gsoc09-logging/base/src/registry2.0/Makefile	2009-06-12 08:57:53 UTC (rev 52218)
@@ -19,7 +19,7 @@
 	${TCLSH} tests/entry.tcl ${SHLIB_NAME}
 	${TCLSH} tests/depends.tcl ${SHLIB_NAME}
 
-install::
+install:: all
 	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
 	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
 	$(SILENT) set -x; for file in ${SRCS}; do \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090612/79d0b655/attachment-0001.html>


More information about the macports-changes mailing list