[52671] branches/gsoc09-gui/base

juanger at macports.org juanger at macports.org
Sat Jun 20 17:25:46 PDT 2009


Revision: 52671
          http://trac.macports.org/changeset/52671
Author:   juanger at macports.org
Date:     2009-06-20 17:25:45 -0700 (Sat, 20 Jun 2009)
Log Message:
-----------
Merging trunk's changes

Modified Paths:
--------------
    branches/gsoc09-gui/base/aclocal.m4
    branches/gsoc09-gui/base/configure
    branches/gsoc09-gui/base/configure.ac
    branches/gsoc09-gui/base/doc/macports.conf.5
    branches/gsoc09-gui/base/doc/macports.conf.in
    branches/gsoc09-gui/base/src/macports1.0/macports.tcl
    branches/gsoc09-gui/base/src/pextlib1.0/tracelib.c
    branches/gsoc09-gui/base/src/port/port.tcl
    branches/gsoc09-gui/base/src/port1.0/portbuild.tcl
    branches/gsoc09-gui/base/src/port1.0/portconfigure.tcl
    branches/gsoc09-gui/base/src/port1.0/portfetch.tcl
    branches/gsoc09-gui/base/src/port1.0/portlint.tcl
    branches/gsoc09-gui/base/src/port1.0/portlivecheck.tcl
    branches/gsoc09-gui/base/src/port1.0/portmain.tcl
    branches/gsoc09-gui/base/src/port1.0/porttrace.tcl
    branches/gsoc09-gui/base/src/port1.0/portutil.tcl
    branches/gsoc09-gui/base/src/registry1.0/portuninstall.tcl

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


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

Modified: branches/gsoc09-gui/base/aclocal.m4
===================================================================
--- branches/gsoc09-gui/base/aclocal.m4	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/aclocal.m4	2009-06-21 00:25:45 UTC (rev 52671)
@@ -489,40 +489,22 @@
 # MP_UNIVERSAL_OPTIONS
 #---------------------------------------
 AC_DEFUN([MP_UNIVERSAL_OPTIONS],[
+  AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
 
-    AC_ARG_WITH(universal-target,[AS_HELP_STRING([--with-universal-target=MDT],[Universal MACOSX_DEPLOYMENT_TARGET version])], UNIVERSAL_TARGET=${withval})
-    AC_ARG_WITH(universal-sysroot,[AS_HELP_STRING([--with-universal-sysroot=SDK],[Universal SDK sysroot (with complete path)])], UNIVERSAL_SYSROOT=${withval})
-    AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
+  if test "x$UNIVERSAL_ARCHS" = "x"; then
+    case "$MACOSX_VERSION" in
+      10.[[0-5]]*)
+        UNIVERSAL_ARCHS="i386 ppc"
+        ;;
+      *)
+        UNIVERSAL_ARCHS="x86_64 i386"
+        ;;
+    esac
+  fi
 
-	MACOSX_MAJOR_VERSION=`$SW_VERS -productVersion | cut -f-2 -d.`
-
-	if test "x$UNIVERSAL_TARGET" = "x"; then
-	    UNIVERSAL_TARGET=${MACOSX_MAJOR_VERSION}
-	fi
-
-	if test "x$UNIVERSAL_SYSROOT" = "x"; then
-	    if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
-		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
-	    else
-		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
-	    fi
-	fi
-
-	if test "x$UNIVERSAL_ARCHS" = "x"; then
-	    UNIVERSAL_ARCHS="ppc i386"
-	fi
-    
-    AC_MSG_CHECKING([for Universal MDT version])
-    AC_MSG_RESULT([$UNIVERSAL_TARGET])
-    AC_SUBST(UNIVERSAL_TARGET)
-
-    AC_MSG_CHECKING([for Universal SDK sysroot])
-    AC_MSG_RESULT([$UNIVERSAL_SYSROOT])
-    AC_SUBST(UNIVERSAL_SYSROOT)
-
-    AC_MSG_CHECKING([for Universal CPU architectures])
-    AC_MSG_RESULT([$UNIVERSAL_ARCHS])
-    AC_SUBST(UNIVERSAL_ARCHS)
+  AC_MSG_CHECKING([for Universal CPU architectures])
+  AC_MSG_RESULT([$UNIVERSAL_ARCHS])
+  AC_SUBST(UNIVERSAL_ARCHS)
 ])
 
 # MP_LIB_MD5

Modified: branches/gsoc09-gui/base/configure
===================================================================
--- branches/gsoc09-gui/base/configure	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/configure	2009-06-21 00:25:45 UTC (rev 52671)
@@ -676,8 +676,6 @@
 READLINK_IS_NOT_P1003_1A
 CPP
 UNIVERSAL_ARCHS
-UNIVERSAL_SYSROOT
-UNIVERSAL_TARGET
 MPFRAMEWORKSDIR
 MPAPPLICATIONSDIR
 DSTMODE
@@ -831,8 +829,6 @@
 with_shared_directory
 with_applications_dir
 with_frameworks_dir
-with_universal_target
-with_universal_sysroot
 with_universal_archs
 enable_readline
 with_tcl
@@ -863,6 +859,7 @@
 TAR
 MAKE
 GNUTAR
+BSDMAKE
 GNUMAKE
 BZIP2
 XAR
@@ -1522,10 +1519,6 @@
   --with-shared-directory Use 0775 permissions for installed directories
   --with-applications-dir Applications installation directory.
   --with-frameworks-dir   Frameworks installation directory.
-  --with-universal-target=MDT
-                          Universal MACOSX_DEPLOYMENT_TARGET version
-  --with-universal-sysroot=SDK
-                          Universal SDK sysroot (with complete path)
   --with-universal-archs="CPU"
                           Universal CPU architectures (space separated)
   --with-tcl              directory containing tcl configuration (tclConfig.sh)
@@ -1557,6 +1550,7 @@
   TAR         path to tar command
   MAKE        path to make command
   GNUTAR      path to gnutar command
+  BSDMAKE     path to bsdmake/pmake command
   GNUMAKE     path to gnumake command
   BZIP2       path to bzip2 command
   XAR         path to xar command
@@ -4606,8 +4600,10 @@
 fi
 
 
-# Extract the first word of "bsdmake", so it can be a program name with args.
-set dummy bsdmake; ac_word=$2
+for ac_prog in bsdmake pmake
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; 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
@@ -4646,6 +4642,9 @@
 fi
 
 
+  test -n "$BSDMAKE" && break
+done
+
 # 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
@@ -5191,6 +5190,7 @@
 
 
 
+
 	# Extract the first word of "sed", so it can be a program name with args.
 set dummy sed; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8076,58 +8076,26 @@
 # Check for universal options
 
 
-
-# Check whether --with-universal-target was given.
-if test "${with_universal_target+set}" = set; then
-  withval=$with_universal_target; UNIVERSAL_TARGET=${withval}
-fi
-
-
-# Check whether --with-universal-sysroot was given.
-if test "${with_universal_sysroot+set}" = set; then
-  withval=$with_universal_sysroot; UNIVERSAL_SYSROOT=${withval}
-fi
-
-
 # Check whether --with-universal-archs was given.
 if test "${with_universal_archs+set}" = set; then
   withval=$with_universal_archs; UNIVERSAL_ARCHS=${withval}
 fi
 
 
-	MACOSX_MAJOR_VERSION=`$SW_VERS -productVersion | cut -f-2 -d.`
+  if test "x$UNIVERSAL_ARCHS" = "x"; then
+    case "$MACOSX_VERSION" in
+      10.[0-5]*)
+        UNIVERSAL_ARCHS="i386 ppc"
+        ;;
+      *)
+        UNIVERSAL_ARCHS="x86_64 i386"
+        ;;
+    esac
+  fi
 
-	if test "x$UNIVERSAL_TARGET" = "x"; then
-	    UNIVERSAL_TARGET=${MACOSX_MAJOR_VERSION}
-	fi
-
-	if test "x$UNIVERSAL_SYSROOT" = "x"; then
-	    if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
-		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
-	    else
-		UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
-	    fi
-	fi
-
-	if test "x$UNIVERSAL_ARCHS" = "x"; then
-	    UNIVERSAL_ARCHS="ppc i386"
-	fi
-
-    { $as_echo "$as_me:$LINENO: checking for Universal MDT version" >&5
-$as_echo_n "checking for Universal MDT version... " >&6; }
-    { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_TARGET" >&5
-$as_echo "$UNIVERSAL_TARGET" >&6; }
-
-
-    { $as_echo "$as_me:$LINENO: checking for Universal SDK sysroot" >&5
-$as_echo_n "checking for Universal SDK sysroot... " >&6; }
-    { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_SYSROOT" >&5
-$as_echo "$UNIVERSAL_SYSROOT" >&6; }
-
-
-    { $as_echo "$as_me:$LINENO: checking for Universal CPU architectures" >&5
+  { $as_echo "$as_me:$LINENO: checking for Universal CPU architectures" >&5
 $as_echo_n "checking for Universal CPU architectures... " >&6; }
-    { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_ARCHS" >&5
+  { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_ARCHS" >&5
 $as_echo "$UNIVERSAL_ARCHS" >&6; }
 
 

Modified: branches/gsoc09-gui/base/configure.ac
===================================================================
--- branches/gsoc09-gui/base/configure.ac	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/configure.ac	2009-06-21 00:25:45 UTC (rev 52671)
@@ -108,7 +108,7 @@
 AC_PATH_PROG(TAR, [tar])
 AC_PATH_PROG(UNZIP, [unzip])
 AC_PATH_PROG(ZIP, [zip])
-AC_PATH_PROG(BSDMAKE, [bsdmake])
+AC_PATH_PROGS(BSDMAKE, [bsdmake pmake], [])
 AC_PATH_PROG(MAKE, [make])
 AC_PATH_PROG(HDIUTIL, [hdiutil], [])
 AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
@@ -132,6 +132,7 @@
 AC_ARG_VAR(TAR, [path to tar command])
 AC_ARG_VAR(MAKE, [path to make command])
 AC_ARG_VAR(GNUTAR, [path to gnutar command])
+AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
 AC_ARG_VAR(GNUMAKE, [path to gnumake command])
 AC_ARG_VAR(BZIP2, [path to bzip2 command])
 AC_ARG_VAR(XAR, [path to xar command])

Modified: branches/gsoc09-gui/base/doc/macports.conf.5
===================================================================
--- branches/gsoc09-gui/base/doc/macports.conf.5	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/doc/macports.conf.5	2009-06-21 00:25:45 UTC (rev 52671)
@@ -161,16 +161,6 @@
 .br
 .Ic Default:
 yes
-.It Va universal_target
-The MACOSX_DEPLOYMENT_TARGET to use for +universal variant
-.br
-.Ic Example:
-10.4
-.It Va universal_sysroot
-The SDK "sysroot" full path to use for +universal variant
-.br
-.Ic Example:
-/Developer/SDKs/MacOSX10.4u.sdk
 .It Va universal_archs
 The machine architectures to use for +universal variant
 (multiple architecture entries should be space separated)
@@ -178,7 +168,10 @@
 Regular architectures include: ppc, i386, ppc64, x86_64
 .br
 .Ic Default:
-ppc i386
+x86_64 i386
+.br
+.Ic Default (10.5 and earlier):
+i386 ppc
 .It Va startupitem_type
 Set the default type of startupitems to be generated, overridable by Portfiles that explicitly state a
 startupitem.type key. If set to "default", then a type will be selected that's appropriate to the OS.

Modified: branches/gsoc09-gui/base/doc/macports.conf.in
===================================================================
--- branches/gsoc09-gui/base/doc/macports.conf.in	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/doc/macports.conf.in	2009-06-21 00:25:45 UTC (rev 52671)
@@ -89,12 +89,6 @@
 
 # Options for Universal Binaries (+universal variant)
 
-# MACOSX_DEPLOYMENT_TARGET
-universal_target	@UNIVERSAL_TARGET@
-
-# the SDK "sysroot" to use 
-universal_sysroot	@UNIVERSAL_SYSROOT@
-
 # machine architectures
 universal_archs		@UNIVERSAL_ARCHS@
 

Modified: branches/gsoc09-gui/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc09-gui/base/src/macports1.0/macports.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/macports1.0/macports.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -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 developer_dir universal_target universal_sysroot universal_archs \
+        applications_dir frameworks_dir developer_dir 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 developer_dir universal_target universal_sysroot universal_archs $user_options"
+        applications_dir frameworks_dir developer_dir universal_archs $user_options"
 
     # deferred options are only computed when needed.
     # they are not exported to the trace thread.
@@ -319,7 +319,7 @@
         upvar $up_variations variations
     }
 
-    global auto_path env
+    global auto_path env tcl_platform
     global macports::autoconf::macports_conf_path
     global macports::macports_user_dir
     global macports::bootstrap_options
@@ -350,8 +350,6 @@
     global macports::configurepipe
     global macports::buildnicevalue
     global macports::buildmakejobs
-    global macports::universal_target
-    global macports::universal_sysroot
     global macports::universal_archs
 
     # Set the system encoding to utf-8
@@ -651,23 +649,13 @@
     }
 
     # Default mp universal options
-    if {![info exists macports::universal_target]} {
-        if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
-            set macports::universal_target "10.5"
+    if {![info exists macports::universal_archs]} {
+        if {[lindex [split $tcl_platform(osVersion) .] 0] >= 10} {
+            set macports::universal_archs {x86_64 i386}
         } else {
-            set macports::universal_target "10.4"
+            set macports::universal_archs {i386 ppc}
         }
     }
-    if {![info exists macports::universal_sysroot]} {
-        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 "${macports::developer_dir}/SDKs/MacOSX10.4u.sdk"
-        }
-    }
-    if {![info exists macports::universal_archs]} {
-        set macports::universal_archs {ppc i386}
-    }
 
     # ENV cleanup.
     set keepenvkeys {
@@ -1974,16 +1962,11 @@
 #                  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]} {
@@ -2035,53 +2018,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]
+        # 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 $mport $depspec]} {
+            # 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
-        }
+            # 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 {
-            if {$skipSatisfied && [registry::entry_exists_for_name $dep_portname]} {
-                ui_warn "Dependency '$dep_portname' is installed but not present in the index"
-            } else {
+            array unset portinfo
+            array set portinfo [lindex $res 1]
+            if {![info exists portinfo(porturl)]} {
                 ui_error "Dependency '$dep_portname' not found."
                 return 1
             }
-        }
 
-        # 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 $mport $depspec]} {
-            set options [ditem_key $mport options]
-            set variations [ditem_key $mport variations]
-            # Figure out the subport.
-            set subport [mportopen $porturl $options $variations]
-            
-            # Append the sub-port's provides to the port's requirements list.
-            ditem_append_unique $mport requires "[ditem_key $subport provides]"
-
-            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
-
-                    # We'll recursively iterate on it.
+            # 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]"
         }
     }
 
@@ -2089,7 +2065,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
             }

Modified: branches/gsoc09-gui/base/src/pextlib1.0/tracelib.c
===================================================================
--- branches/gsoc09-gui/base/src/pextlib1.0/tracelib.c	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/pextlib1.0/tracelib.c	2009-06-21 00:25:45 UTC (rev 52671)
@@ -82,6 +82,10 @@
 	}
 	
 	name=strdup(Tcl_GetString(objv[2]));
+	if (!name) {
+	    Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
+	    return TCL_ERROR;
+	}
 	
 	return TCL_OK;
 }
@@ -107,8 +111,12 @@
 	
 	len=strlen(Tcl_GetString(objv[2]))+2;
 	sandbox=(char*)malloc(len);
+	if (!sandbox) {
+	    Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
+	    return TCL_ERROR;
+	}
 	memset(sandbox, 0, len);
-	strcpy(sandbox, Tcl_GetString(objv[2]));
+	strlcpy(sandbox, Tcl_GetString(objv[2]), len);
 	for(t=sandbox;(t=strchr(t+1, ':'));)
 	{
 		/* : -> \0 */
@@ -210,10 +218,23 @@
 	{
 		char * t, * _;
 		
-		filemap=(char*)malloc(1024);
+		size_t remaining = 1024;
+		filemap=(char*)malloc(remaining);
+		if (!filemap) {
+		    ui_warn("send_file_map: memory allocation failed");
+	        return;
+		}
 		t=filemap;
 		
-		#define append_allow(path, resolution) do{strcpy(t, path); t+=strlen(t)+1; *t++=resolution; *t++=0;}while(0);
+		#define append_allow(path, resolution) do { strlcpy(t, path, remaining); \
+		                                            if (remaining < (strlen(t)+3)) \
+		                                                remaining=0; \
+		                                            else \
+		                                                remaining-=strlen(t)+3; \
+		                                            t+=strlen(t)+1; \
+		                                            *t++=resolution; \
+		                                            *t++=0; \
+		                                          } while(0);
 		if(enable_fence)
 		{
 			for(_=sandbox; *_; _+=strlen(_)+1)
@@ -226,22 +247,25 @@
 			/* 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)
 			{
-				char buf[260]="/Developer/SDKs/";
-				strcat(buf, sdk);
+				char buf[260];
+				buf[0] = '\0';
+				strlcat(buf, Tcl_GetVar(interp, "macports::developer_dir", TCL_GLOBAL_ONLY), 260);
+				strlcat(buf, "/SDKs/", 260);
+				strlcat(buf, sdk, 260);
 			
 				append_allow("/usr/bin", 0);
 				append_allow("/usr/sbin", 0);
 				append_allow("/usr/libexec/gcc", 0);
 				append_allow("/System/Library/Perl", 0);
 				append_allow("/", 1);
-				strcpy(t-1, buf);
+				strlcpy(t-1, buf, remaining);
 				t+=strlen(t)+1;
 			}else
 			{
 				append_allow("/usr", 0);
 				append_allow("/System/Library", 0);
 				append_allow("/Library", 0);
-				append_allow("/Developer", 0);
+				append_allow(Tcl_GetVar(interp, "macports::developer_dir", TCL_GLOBAL_ONLY), 0);
 			}
 		}else
 			append_allow("/", 0);
@@ -267,42 +291,40 @@
 {
 	char * port=0;
 	size_t len=1;
-	char resolution; 
+	char resolution='!';
+		
+	Tcl_SetVar(interp, "path", path, 0);
+	Tcl_Eval(interp, "registry::file_registered $path");
+	port=strdup(Tcl_GetStringResult(interp));
+	if (!port) {
+		ui_warn("dep_check: memory allocation failed");
+	    return;
+	}
+	Tcl_UnsetVar(interp, "path", 0);
 	
-	/* If there aren't deps then allow anything. (Useful for extract) */
-	if(!depends)
-		resolution='+';
-	else
+	if(*port!='0'||port[1])
 	{
-		resolution='!';
-		
-		Tcl_SetVar(interp, "path", path, 0);
-		Tcl_Eval(interp, "registry::file_registered $path");
-		port=strdup(Tcl_GetStringResult(interp));
-		Tcl_UnsetVar(interp, "path", 0);
+		char * t;
 	
-		if(*port!='0'||port[1])
+		t=depends;
+		for(;*t;t+=strlen(t)+1)
 		{
-			char * t;
-		
-			t=depends;
-			for(;*t;t+=strlen(t)+1)
+			if(!strcmp(t, port))
 			{
-				if(!strcmp(t, port))
-				{
-					resolution='+';
-					break;
-				}
+				resolution='+';
+				break;
 			}
-		}else if(*port=='0'&&!port[1])
-			strcpy(port, "*unknown*");
+		}
 	}
 	
-	if(resolution!='+')
-		ui_info("trace: access denied to %s (%s)", path, port);
+	if(resolution!='+') {
+	    if(*port=='0'&&!port[1])
+		    ui_info("trace: access denied to %s (*unknown*)", path);
+		else
+		    ui_info("trace: access denied to %s (%s)", path, port);
+    }
 
-	if(port)
-		free(port);
+	free(port);
 	
 	if(send(sock, &len, sizeof(len), 0)==-1)
 		ui_warn("tracelib send failed");
@@ -374,7 +396,7 @@
 
 	
 	sun.sun_family=AF_UNIX;
-	strcpy(sun.sun_path, name);
+	strlcpy(sun.sun_path, name, sizeof(sun.sun_path));
 	if(bind(sock, (struct sockaddr*)&sun, sizeof(sun))==-1)
 	{
 		Tcl_SetResult(interp, "Cannot bind socket", TCL_STATIC);
@@ -518,8 +540,12 @@
 	d=Tcl_GetString(objv[2]);
 	l=strlen(d);
 	depends=malloc(l+2);
+	if (!depends) {
+	    Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
+	    return TCL_ERROR;
+	}
 	depends[l+1]=0;
-	strcpy(depends, d);
+	strlcpy(depends, d, l+2);
 	for(t=depends;*t;++t)
 		if(*t==' ')
 			*t++=0;

Modified: branches/gsoc09-gui/base/src/port/port.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port/port.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port/port.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -1833,10 +1833,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)"
         }
     }
     
@@ -1850,10 +1854,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)"
         }
     }
     

Modified: branches/gsoc09-gui/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portbuild.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portbuild.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -53,7 +53,7 @@
 default build.dir {${workpath}/${worksrcdir}}
 default build.cmd {[portbuild::build_getmaketype]}
 default build.nice {${buildnicevalue}}
-default build.jobs {${buildmakejobs}}
+default build.jobs {[portbuild::build_getjobs]}
 default build.pre_args {${build.target}}
 default build.target "all"
 default use_parallel_build yes
@@ -69,18 +69,18 @@
             if {[option os.platform] == "darwin"} {
                 return [findBinary bsdmake $portutil::autoconf::bsdmake_path]
             } elseif {[option os.platform] == "freebsd"} {
-                return [binaryInPath make]
+                return [findBinary make $portutil::autoconf::make_path]
             } else {
-                return [binaryInPath pmake]
+                return [findBinary pmake $portutil::autoconf::bsdmake_path]
             }
         }
         gnu {
             if {[option os.platform] == "darwin"} {
                 return [findBinary gnumake $portutil::autoconf::gnumake_path]
             } elseif {[option os.platform] == "linux"} {
-                return [binaryInPath make]
+                return [findBinary make $portutil::autoconf::make_path]
             } else {
-                return [binaryInPath gmake]
+                return [findBinary gmake $portutil::autoconf::gnumake_path]
             }
         }
         pbx {
@@ -114,18 +114,9 @@
     return "[findBinary nice $portutil::autoconf::nice_path] -n $nice "
 }
 
-proc portbuild::build_getmakejobs {args} {
-    # check if port allows a parallel build
-    global use_parallel_build
-    if {![tbool use_parallel_build]} {
-        ui_debug "port disallows a parallel build"
-        return ""
-    }
-
-    if {![exists build.jobs] || !([string match "*make*" [option build.cmd]] || [string match "*scons*" [option build.cmd]])} {
-        return ""
-    }
-    set jobs [option build.jobs]
+proc portbuild::build_getjobs {args} {
+    global buildmakejobs
+    set jobs $buildmakejobs
     # if set to '0', use the number of cores for the number of jobs
     if {$jobs == 0} {
         if {[catch {set jobs [exec "/usr/sbin/sysctl" "-n" "hw.availcpu"]}]} {
@@ -135,9 +126,23 @@
         }
     }
     if {![string is integer -strict $jobs] || $jobs <= 1} {
+        set jobs 1
+    }
+    return $jobs
+}
+
+proc portbuild::build_getjobsarg {args} {
+    # check if port allows a parallel build
+    global use_parallel_build
+    if {![tbool use_parallel_build]} {
+        ui_debug "port disallows a parallel build"
         return ""
     }
-    return " -j$jobs"
+
+    if {![exists build.jobs] || !([string match "*make*" [option build.cmd]] || [string match "*scons*" [option build.cmd]])} {
+        return ""
+    }
+    return " -j[option build.jobs]"
 }
 
 proc portbuild::build_start {args} {
@@ -150,7 +155,7 @@
     global build.cmd
 
     set nice_prefix [build_getnicevalue]
-    set jobs_suffix [build_getmakejobs]
+    set jobs_suffix [build_getjobsarg]
 
     set realcmd ${build.cmd}
     set build.cmd "$nice_prefix${build.cmd}$jobs_suffix"

Modified: branches/gsoc09-gui/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portconfigure.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portconfigure.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -46,7 +46,7 @@
 commands configure autoreconf automake autoconf xmkmf
 # defaults
 default configure.env       ""
-default configure.pre_args  {--prefix=${prefix}}
+default configure.pre_args  {[portconfigure::configure_get_pre_args]}
 default configure.cmd       ./configure
 default configure.dir       {${worksrcpath}}
 default autoreconf.dir      {${worksrcpath}}
@@ -88,10 +88,10 @@
 default configure.optflags  {-O2}
 # compiler flags section
 default configure.cflags    {[portconfigure::configure_get_cflags]}
-default configure.cppflags  {"-I${prefix}/include"}
+default configure.cppflags  {[portconfigure::configure_get_cppflags]}
 default configure.cxxflags  {[portconfigure::configure_get_cflags]}
 default configure.objcflags {[portconfigure::configure_get_cflags]}
-default configure.ldflags   {"-L${prefix}/lib"}
+default configure.ldflags   {[portconfigure::configure_get_ldflags]}
 default configure.libs      {}
 default configure.fflags    {[portconfigure::configure_get_cflags]}
 default configure.f90flags  {[portconfigure::configure_get_cflags]}
@@ -102,6 +102,7 @@
 proc portconfigure::configure_get_cflags {args} {
     global configure.optflags
     global configure.m32 configure.m64 configure.march configure.mtune
+    global configure.universal_cflags
     set flags "${configure.optflags}"
     if {[tbool configure.m64]} {
         set flags "-m64 ${flags}"
@@ -114,9 +115,30 @@
     if {[info exists configure.mtune] && ${configure.mtune} != {}} {
         set flags "${flags} -mtune=${configure.mtune}"
     }
+    if {[variant_isset universal] && ${configure.universal_cflags} != ""} {
+        set flags "${flags} ${configure.universal_cflags}"
+    }
     return $flags
 }
 
+proc portconfigure::configure_get_cppflags {args} {
+    global prefix configure.universal_cppflags
+    set flags "-I${prefix}/include"
+    if {[variant_isset universal] && ${configure.universal_cppflags} != ""} {
+        set flags "${flags} ${configure.universal_cppflags}"
+    }
+    return $flags
+}
+
+proc portconfigure::configure_get_ldflags {args} {
+    global prefix configure.universal_ldflags
+    set flags "-L${prefix}/lib"
+    if {[variant_isset universal] && ${configure.universal_ldflags} != ""} {
+        set flags "${flags} ${configure.universal_ldflags}"
+    }
+    return $flags
+}
+
 # tools section
 options configure.perl configure.python configure.ruby configure.install configure.awk configure.bison configure.pkg_config configure.pkg_config_path
 default configure.perl              {}
@@ -128,9 +150,7 @@
 default configure.pkg_config        {}
 default configure.pkg_config_path   {}
 
-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}}
+options configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
 default configure.universal_archs       {${universal_archs}}
 default configure.universal_args        {--disable-dependency-tracking}
 default configure.universal_cflags      {[portconfigure::configure_get_universal_cflags]}
@@ -184,46 +204,58 @@
     ui_debug "Using compiler '$name'"
 }
 
+proc portconfigure::configure_get_pre_args {args} {
+    global prefix configure.universal_args
+    set result "--prefix=${prefix}"
+    if {[variant_isset universal] && ${configure.universal_args} != ""} {
+        set result "$result ${configure.universal_args}"
+    }
+    return $result
+}
+
 # internal function to determine the "-arch xy" flags for the compiler
 proc portconfigure::configure_get_universal_archflags {args} {
     global configure.universal_archs
     set flags ""
     foreach arch ${configure.universal_archs} {
-        set flags "$flags -arch $arch"
+        if {$flags == ""} {
+            set flags "-arch $arch"
+        } else {
+            set flags "$flags -arch $arch"
+        }
     }
     return $flags
 }
 
 # internal function to determine the CPPFLAGS for the compiler
 proc portconfigure::configure_get_universal_cppflags {args} {
-    global configure.universal_sysroot
+    global os.arch os.major developer_dir
     set flags ""
     # include sysroot in CPPFLAGS too (twice), for the benefit of autoconf
-    if {[info exists configure.universal_sysroot]} {
-        set flags "-isysroot ${configure.universal_sysroot}"
+    if {${os.arch} == "powerpc" && ${os.major} == "8"} {
+        set flags "-isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk"
     }
     return $flags
 }
 
 # internal function to determine the CFLAGS for the compiler
 proc portconfigure::configure_get_universal_cflags {args} {
-    global configure.universal_sysroot configure.universal_target
+    global os.arch os.major developer_dir
     set flags [configure_get_universal_archflags]
     # these flags should be valid for C/C++ and similar compiler frontends
-    if {[info exists configure.universal_sysroot]} {
-        set flags "-isysroot ${configure.universal_sysroot} ${flags}"
+    if {${os.arch} == "powerpc" && ${os.major} == "8"} {
+        set flags "-isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk ${flags}"
     }
     return $flags
 }
 
 # internal function to determine the LDFLAGS for the compiler
 proc portconfigure::configure_get_universal_ldflags {args} {
-    global configure.universal_sysroot configure.universal_target
-    global os.arch
+    global os.arch os.major developer_dir
     set flags [configure_get_universal_archflags]
     # works around linking without using the CFLAGS, outside of automake
-    if {${os.arch} == "powerpc"} {
-        set flags "-Wl,-syslibroot,${configure.universal_sysroot} ${flags}"
+    if {${os.arch} == "powerpc" && ${os.major} == "8"} {
+        set flags "-Wl,-syslibroot,${developer_dir}/SDKs/MacOSX10.4u.sdk ${flags}"
     }
     return $flags
 }
@@ -283,7 +315,6 @@
                 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 {

Modified: branches/gsoc09-gui/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portfetch.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portfetch.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -225,38 +225,39 @@
     set ret [list]
     foreach element $portfetch::mirror_sites::sites($mirrors) {
 
-    # here we have the chance to take a look at tags, that possibly
-    # have been assigned in mirror_sites.tcl
-    set splitlist [split $element :]
-    # every element is a URL, so we'll always have multiple elements. no need to check
-    set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
-    set mirror_tag "[lindex $splitlist 2]"
+        # here we have the chance to take a look at tags, that possibly
+        # have been assigned in mirror_sites.tcl
+        set splitlist [split $element :]
+        # every element is a URL, so we'll always have multiple elements. no need to check
+        set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
+        set mirror_tag "[lindex $splitlist 2]"
 
-    set name_re {\$(?:name\y|\{name\})}
-    # if the URL has $name embedded, kill any mirror_tag that may have been added
-    # since a mirror_tag and $name are incompatible
-    if {[regexp $name_re $element]} {
-        set mirror_tag ""
-    }
+        set name_re {\$(?:name\y|\{name\})}
+        # if the URL has $name embedded, kill any mirror_tag that may have been added
+        # since a mirror_tag and $name are incompatible
+        if {[regexp $name_re $element]} {
+            set mirror_tag ""
+        }
 
-    if {$mirror_tag == "mirror"} {
-        set thesubdir ${dist_subdir}
-    } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
-        set thesubdir ${name}
-    } else {
-        set thesubdir ${subdir}
-    }
+        if {$mirror_tag == "mirror"} {
+            set thesubdir ${dist_subdir}
+        } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
+            set thesubdir ${name}
+        } else {
+            set thesubdir ${subdir}
+        }
 
-    # parse an embedded $name. if present, remove the subdir
-    if {[regsub $name_re $element $thesubdir element] > 0} {
-        set thesubdir ""
-    }
+        # parse an embedded $name. if present, remove the subdir
+        if {[regsub $name_re $element $thesubdir element] > 0} {
+            set thesubdir ""
+        }
 
-    if {"$tag" != ""} {
-        eval append element "${thesubdir}:${tag}"
-    } else {
-        eval append element "${thesubdir}"
-    }
+        if {"$tag" != ""} {
+            eval append element "${thesubdir}:${tag}"
+        } else {
+            eval append element "${thesubdir}"
+        }
+
         eval lappend ret $element
     }
 
@@ -333,9 +334,9 @@
 }
 
 # Checks patch files and their tags to assemble url lists for later fetching
-proc portfetch::checkpatchfiles {args} {
+proc portfetch::checkpatchfiles {urls} {
     global patchfiles all_dist_files patch_sites filespath
-    variable fetch_urls
+    upvar $urls fetch_urls
 
     if {[info exists patchfiles]} {
         foreach file $patchfiles {
@@ -356,9 +357,9 @@
 }
 
 # Checks dist files and their tags to assemble url lists for later fetching
-proc portfetch::checkdistfiles {args} {
+proc portfetch::checkdistfiles {urls} {
     global distfiles all_dist_files master_sites filespath
-    variable fetch_urls
+    upvar $urls fetch_urls
 
     if {[info exists distfiles]} {
         foreach file $distfiles {
@@ -377,9 +378,9 @@
 }
 
 # sorts fetch_urls in order of ping time
-proc portfetch::sortsites {args} {
+proc portfetch::sortsites {urls} {
     global fallback_mirror_site
-    variable fetch_urls
+    upvar $urls fetch_urls
 
     set fallback_mirror_list [mirror_sites $fallback_mirror_site {} {}]
 
@@ -453,12 +454,12 @@
 
 # Perform the full checksites/checkpatchfiles/checkdistfiles sequence.
 # This method is used by distcheck target.
-proc portfetch::checkfiles {args} {
-    variable fetch_urls
+proc portfetch::checkfiles {urls} {
+    upvar $urls fetch_urls
 
     checksites
-    checkpatchfiles
-    checkdistfiles
+    checkpatchfiles fetch_urls
+    checkdistfiles fetch_urls
 }
 
 
@@ -627,7 +628,7 @@
                 return -code error [format [msgcat::mc "%s must be writable"] $distpath]
             }
             if {!$sorted} {
-                sortsites
+                sortsites fetch_urls
                 set sorted yes
             }
             variable portfetch::$url_var
@@ -702,6 +703,7 @@
 proc portfetch::fetch_init {args} {
     global distfiles distname distpath all_dist_files dist_subdir fetch.type fetch_init_done
     global altprefix usealtworkpath
+    variable fetch_urls
 
     if {[info exists distpath] && [info exists dist_subdir] && ![info exists fetch_init_done]} {
 
@@ -716,7 +718,7 @@
         set distpath ${distpath}/${dist_subdir}
         set fetch_init_done yes
     }
-    portfetch::checkfiles
+    portfetch::checkfiles fetch_urls
 }
 
 proc portfetch::fetch_start {args} {

Modified: branches/gsoc09-gui/base/src/port1.0/portlint.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portlint.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portlint.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -239,6 +239,14 @@
                 lappend local_variants $variantname
             }
         }
+        
+        if {[string match "platform\[ \t\]*" $line]} {
+            regexp {platform\s+(?:\w+\s+(?:\w+\s+)?)?(\w+)} $line -> platform_arch
+            if {$platform_arch == "ppc"} {
+                ui_error "Arch 'ppc' in platform variant on line $lineno should be 'powerpc'"
+                incr errors
+            }
+        }
 
         if {[regexp {(^|\s)configure\s+\{\s*\}} $line]} {
             ui_warn "Line $lineno should say \"use_configure no\" instead of declaring an empty configure phase"

Modified: branches/gsoc09-gui/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portlivecheck.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portlivecheck.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -122,10 +122,6 @@
             set livecheck.type "fallback"
         }
     }
-    # 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"

Modified: branches/gsoc09-gui/base/src/port1.0/portmain.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portmain.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portmain.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -122,11 +122,6 @@
     # the universal variant itself is now created in
     # add_default_universal_variant, which is called from mportopen
     option os.universal_supported yes
-
-    if {[info exists variations(universal)] && $variations(universal) == "+"} {
-        # cannot go into the variant, due to the amount of ports overriding it
-        eval macosx_deployment_target ${universal_target}
-    }
 }
 
 # Record initial euid/egid

Modified: branches/gsoc09-gui/base/src/port1.0/porttrace.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/porttrace.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/porttrace.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -44,7 +44,7 @@
         if {[catch {package require Thread} error]} {
             ui_warn "trace requires Tcl Thread package ($error)"
         } else {
-            global env trace_fifo trace_sandboxbounds portpath
+            global env trace_fifo trace_sandboxbounds portpath distpath
             # Create a fifo.
             # path in unix socket limited to 109 chars
             # # set trace_fifo "$workpath/trace_fifo"
@@ -78,7 +78,7 @@
             # /Library/Caches/com.apple.Xcode
             # $CCACHE_DIR
             # $HOMEDIR/.ccache
-            set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/:/etc/passwd:/etc/groups:/etc/localtime:/Library/Caches/com.apple.Xcode:$env(HOME)/.ccache:${workpath}:$portpath"
+            set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/:/etc/passwd:/etc/groups:/etc/localtime:/Library/Caches/com.apple.Xcode:$env(HOME)/.ccache:${workpath}:${portpath}:${distpath}"
             if {[info exists env(TMPDIR)]} {
                 set trace_sandboxbounds "${trace_sandboxbounds}:$env(TMPDIR)"
             }
@@ -104,6 +104,7 @@
     global env
     if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
         unset env(DARWINTRACE_SANDBOX_BOUNDS)
+        unsetenv DARWINTRACE_SANDBOX_BOUNDS
     }
 }
 
@@ -147,11 +148,9 @@
     global os.platform
     if {${os.platform} == "darwin"} {
         global env trace_fifo
-        unset env(DYLD_INSERT_LIBRARIES)
-        unset env(DYLD_FORCE_FLAT_NAMESPACE)
-        unset env(DARWINTRACE_LOG)
-        if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
-            unset env(DARWINTRACE_SANDBOX_BOUNDS)
+        foreach var {DYLD_INSERT_LIBRARIES DYLD_FORCE_FLAT_NAMESPACE DARWINTRACE_LOG DARWINTRACE_SANDBOX_BOUNDS} {
+            array unset env $var
+            unsetenv $var
         }
 
         #kill socket
@@ -213,7 +212,7 @@
 
 # Private.
 # Slave method to read a line from the trace.
-proc porttrace::lave_read_line {chan} {
+proc porttrace::slave_read_line {chan} {
     global ports_list trace_filemap sandbox_violation_list workpath
     global env
 

Modified: branches/gsoc09-gui/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc09-gui/base/src/port1.0/portutil.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/port1.0/portutil.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -681,11 +681,11 @@
     # Pick up a unique name.
     if {[variant_exists $platform]} {
         set suffix 1
-        while {[variant_exists "$platform-$suffix"]} {
+        while {[variant_exists "${platform}_${suffix}"]} {
             incr suffix
         }
 
-        set platform "$platform-$suffix"
+        set platform "${platform}_${suffix}"
     }
     variant $platform $code
 
@@ -1268,7 +1268,6 @@
                     # outside the sandbox.
                     if {$target != "activate"
                       && $target != "archive"
-                      && $target != "fetch"
                       && $target != "install"} {
                         porttrace::trace_enable_fence
                     }
@@ -1699,7 +1698,7 @@
     # test for conflicting variants
     foreach v [ditem_key $ditem conflicts] {
         if {[variant_isset $v]} {
-            ui_error "Variant $name conflicts with $v"
+            ui_error "[option name]: Variant $name conflicts with $v"
             return 1
         }
     }
@@ -1708,7 +1707,7 @@
     if {[catch "variant-${name}" result]} {
         global errorInfo
         ui_debug "$errorInfo"
-        ui_error "Error executing $name: $result"
+        ui_error "[option name]: Error executing $name: $result"
         return 1
     }
     return 0
@@ -1882,20 +1881,8 @@
 }
 
 proc add_default_universal_variant {args} {
-    # Declare default universal variant if universal SDK is installed
-    variant universal {
-        pre-fetch {
-            if {![file exists ${configure.universal_sysroot}]} {
-                return -code error "Universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail"
-            }
-        }
-
-        eval configure.args-append ${configure.universal_args}
-        eval configure.cflags-append ${configure.universal_cflags}
-        eval configure.cppflags-append ${configure.universal_cppflags}
-        eval configure.cxxflags-append ${configure.universal_cxxflags}
-        eval configure.ldflags-append ${configure.universal_ldflags}
-    }
+    # Declare default universal variant (all the magic happens in portconfigure now)
+    variant universal {}
 }
 
 # Target class definition.

Modified: branches/gsoc09-gui/base/src/registry1.0/portuninstall.tcl
===================================================================
--- branches/gsoc09-gui/base/src/registry1.0/portuninstall.tcl	2009-06-20 23:53:19 UTC (rev 52670)
+++ branches/gsoc09-gui/base/src/registry1.0/portuninstall.tcl	2009-06-21 00:25:45 UTC (rev 52671)
@@ -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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090620/a4f1baef/attachment-0001.html>


More information about the macports-changes mailing list