[24502] branches/dp2mp-move/base/src/macports1.0

source_changes at macosforge.org source_changes at macosforge.org
Thu Apr 26 20:52:37 PDT 2007


Revision: 24502
          http://trac.macosforge.org/projects/macports/changeset/24502
Author:   jmpp at macports.org
Date:     2007-04-26 20:52:36 -0700 (Thu, 26 Apr 2007)

Log Message:
-----------

All of darwinpors1.0 to macports1.0! Branch again configures, compiles, installs, makes clean and distclean,
but of course is not yet functional as other Tcl packages still reference darwinports1.0.

Modified Paths:
--------------
    branches/dp2mp-move/base/src/macports1.0/macports.c
    branches/dp2mp-move/base/src/macports1.0/macports.h
    branches/dp2mp-move/base/src/macports1.0/macports.tcl
    branches/dp2mp-move/base/src/macports1.0/macports_autoconf.tcl.in
    branches/dp2mp-move/base/src/macports1.0/macports_dlist.tcl
    branches/dp2mp-move/base/src/macports1.0/macports_fastload.tcl.in
    branches/dp2mp-move/base/src/macports1.0/macports_index.tcl
    branches/dp2mp-move/base/src/macports1.0/options.h
    branches/dp2mp-move/base/src/macports1.0/portconf.c
    branches/dp2mp-move/base/src/macports1.0/session.c
    branches/dp2mp-move/base/src/macports1.0/test_dlist.tcl
    branches/dp2mp-move/base/src/macports1.0/util.c
    branches/dp2mp-move/base/src/macports1.0/util.h

Modified: branches/dp2mp-move/base/src/macports1.0/macports.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.c	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports.c	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,5 +1,5 @@
 /*
- * darwinports.c
+ * macports.c
  * $Id$
  *
  * Copyright (c) 2003 Apple Computer, Inc.
@@ -36,11 +36,11 @@
 
 #include <tcl.h>
 
-int darwinports_Init(Tcl_Interp *interp)
+int macports_Init(Tcl_Interp *interp)
 {
 	if(Tcl_InitStubs(interp, "8.3", 0) == NULL)
 		return TCL_ERROR;
-	if(Tcl_PkgProvide(interp, "darwinports", "1.0") != TCL_OK)
+	if(Tcl_PkgProvide(interp, "macports", "1.0") != TCL_OK)
 		return TCL_ERROR;
 	return TCL_OK;
 }

Modified: branches/dp2mp-move/base/src/macports1.0/macports.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.h	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports.h	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,5 +1,5 @@
 /*
- * darwinports.h
+ * macports.h
  * $Id$
  *
  * Copyright (c) 2003 Apple Computer, Inc.
@@ -30,31 +30,31 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef __DARWINPORTS_H__
-#define __DARWINPORTS_H__
+#ifndef __MACPORTS_H__
+#define __MACPORTS_H__
 
-typedef void* dp_session_t;
-typedef void* dp_software_t;
+typedef void* mp_session_t;
+typedef void* mp_software_t;
 
-typedef void* dp_array_t;
-dp_array_t dp_array_create();
-dp_array_t dp_array_create_copy(dp_array_t a);
-dp_array_t dp_array_retain(dp_array_t a);
-void dp_array_release(dp_array_t a);
-void dp_array_append(dp_array_t a, const void* data);
-int dp_array_get_count(dp_array_t a);
-const void* dp_array_get_index(dp_array_t a, int index);
+typedef void* mp_array_t;
+mp_array_t mp_array_create();
+mp_array_t mp_array_create_copy(mp_array_t a);
+mp_array_t mp_array_retain(mp_array_t a);
+void mp_array_release(mp_array_t a);
+void mp_array_append(mp_array_t a, const void* data);
+int mp_array_get_count(mp_array_t a);
+const void* mp_array_get_index(mp_array_t a, int index);
 /* something for delete */
 
-dp_session_t dp_session_open();
-int dp_session_sync_index();
+mp_session_t mp_session_open();
+int mp_session_sync_index();
 
-int dp_software_search(dp_session_t dp, const char* regexp, dp_software_t* out_matches, int* out_count);
-dp_software_t dp_software_open_portfile(dp_session_t dp, const char* path, const char** options);
-dp_session_t dp_software_get_session(dp_software_t sw);
-dp_software_t dp_software_exec(dp_software_t sw, const char* target);
-int dp_softare_close(dp_software_t sw);
+int mp_software_search(mp_session_t mp, const char* regexp, mp_software_t* out_matches, int* out_count);
+mp_software_t mp_software_open_portfile(mp_session_t mp, const char* path, const char** options);
+mp_session_t mp_software_get_session(mp_software_t sw);
+mp_software_t mp_software_exec(mp_software_t sw, const char* target);
+int mp_softare_close(mp_software_t sw);
 
-int dp_session_close();
+int mp_session_close();
 
-#endif /* __DARWINPORTS_H__ */
+#endif /* __MACPORTS_H__ */

Modified: branches/dp2mp-move/base/src/macports1.0/macports.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,4 +1,4 @@
-# darwinports.tcl
+# macports.tcl
 # $Id$
 #
 # Copyright (c) 2002 Apple Computer, Inc.
@@ -31,12 +31,12 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 #
-package provide darwinports 1.0
-package require darwinports_dlist 1.0
-package require darwinports_index 1.0
+package provide macports 1.0
+package require macports_dlist 1.0
+package require macports_index 1.0
 
-namespace eval darwinports {
-    namespace export bootstrap_options user_options portinterp_options open_dports ui_priorities
+namespace eval macports {
+    namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
     variable bootstrap_options "\
     	portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
     	portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
@@ -55,7 +55,7 @@
     # they are not exported to the interpreter in system_options array.
     variable portinterp_deferred_options "xcodeversion xcodebuildcmd"
 	
-    variable open_dports {}
+    variable open_mports {}
     
     variable ui_priorities "debug info msg error warn"
 }
@@ -73,7 +73,7 @@
 # if these functions are not provided, defaults are used, but this should
 # not be relied upon for production code
 
-proc darwinports::ui_init {priority message} {
+proc macports::ui_init {priority message} {
 	# Get the list of channels.
 	if {[llength [info commands ui_channels]] > 0} {
 		set channels [ui_channels $priority]
@@ -109,7 +109,7 @@
 }
 
 # Defult implementation of ui_prefix
-proc darwinports::ui_prefix_default {priority} {
+proc macports::ui_prefix_default {priority} {
 	switch $priority {
 		debug {
 			return "DEBUG: "
@@ -127,7 +127,7 @@
 }
 
 # Default implementation of ui_channels
-proc darwinports::ui_channels_default {priority} {
+proc macports::ui_channels_default {priority} {
     switch $priority {
         debug -
         info {
@@ -145,8 +145,8 @@
     }
 }
 
-foreach priority ${darwinports::ui_priorities} {
-    proc ui_$priority {str} [subst { darwinports::ui_init $priority \$str }]
+foreach priority ${macports::ui_priorities} {
+    proc ui_$priority {str} [subst { macports::ui_init $priority \$str }]
 }
 
 # Replace puts to catch errors (typically broken pipes when being piped to head)
@@ -158,7 +158,7 @@
 # check for a binary in the path
 # returns an error code if it can not be found
 # copied from portutil.tcl
-proc darwinports::binaryInPath {binary} {
+proc macports::binaryInPath {binary} {
     global env
     foreach dir [split $env(PATH) :] { 
 	if {[file executable [file join $dir $binary]]} {
@@ -170,18 +170,18 @@
 }
 
 # deferred option processing
-proc darwinports::getoption {name} {
-	global darwinports::$name
+proc macports::getoption {name} {
+	global macports::$name
 	return [expr $$name]
 }
 
 # deferred and on-need extraction of xcodeversion and xcodebuildcmd.
-proc darwinports::setxcodeinfo {name1 name2 op} {
-	global darwinports::xcodeversion
-	global darwinports::xcodebuildcmd
+proc macports::setxcodeinfo {name1 name2 op} {
+	global macports::xcodeversion
+	global macports::xcodebuildcmd
 	
-	trace remove variable darwinports::xcodeversion read darwinports::setxcodeinfo
-	trace remove variable darwinports::xcodebuildcmd read darwinports::setxcodeinfo
+	trace remove variable macports::xcodeversion read macports::setxcodeinfo
+	trace remove variable macports::xcodebuildcmd read macports::setxcodeinfo
 
 	if {[catch {set xcodebuild [binaryInPath "xcodebuild"]}] == 0} {
 		if {![info exists xcodeversion]} {
@@ -190,39 +190,39 @@
 				if {[regexp "DevToolsCore-(.*); DevToolsSupport-(.*)" $xcodebuildversion devtoolscore_v devtoolssupport_v] == 1} {
 					if {$devtoolscore_v >= 620.0 && $devtoolssupport_v >= 610.0} {
 						# for now, we don't need to distinguish 2.1 from 2.1 or higher.
-						set darwinports::xcodeversion "2.1"
+						set macports::xcodeversion "2.1"
 					} else {
-						set darwinports::xcodeversion "2.0orlower"
+						set macports::xcodeversion "2.0orlower"
 					}
 				} else {
-					set darwinports::xcodeversion "2.0orlower"
+					set macports::xcodeversion "2.0orlower"
 				}
 			} else {
-				set darwinports::xcodeversion "2.0orlower"
+				set macports::xcodeversion "2.0orlower"
 			}
 		}
 		
 		if {![info exists xcodebuildcmd]} {
-			set darwinports::xcodebuildcmd "xcodebuild"
+			set macports::xcodebuildcmd "xcodebuild"
 		}
 	} elseif {[catch {set pbxbuild [binaryInPath "pbxbuild"]}] == 0} {
 		if {![info exists xcodeversion]} {
-			set darwinports::xcodeversion "pb"
+			set macports::xcodeversion "pb"
 		}
 		if {![info exists xcodebuildcmd]} {
-			set darwinports::xcodebuildcmd "pbxbuild"
+			set macports::xcodebuildcmd "pbxbuild"
 		}
 	} else {
 		if {![info exists xcodeversion]} {
-			set darwinports::xcodeversion "none"
+			set macports::xcodeversion "none"
 		}
 		if {![info exists xcodebuildcmd]} {
-			set darwinports::xcodebuildcmd "none"
+			set macports::xcodebuildcmd "none"
 		}
 	}
 }
 
-proc dportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
+proc mportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
 	if {$up_ui_options eq ""} {
 		array set ui_options {}
 	} else {
@@ -240,28 +240,28 @@
 	}
 	
 	global auto_path env
-	global darwinports::autoconf::dports_conf_path
-	global darwinports::bootstrap_options
-	global darwinports::user_options
-	global darwinports::extra_env
-	global darwinports::portconf
-	global darwinports::portdbpath
-	global darwinports::portsharepath
-	global darwinports::registry.format
-	global darwinports::registry.path
-	global darwinports::sources
-	global darwinports::sources_conf
-	global darwinports::startupitem_type
-   	global darwinports::destroot_umask
-   	global darwinports::libpath
-   	global darwinports::prefix
-   	global darwinports::registry.installtype
-   	global darwinports::rsync_dir
-   	global darwinports::rsync_options
-   	global darwinports::rsync_server
-   	global darwinports::variants_conf
-   	global darwinports::xcodebuildcmd
-   	global darwinports::xcodeversion
+	global macports::autoconf::mports_conf_path
+	global macports::bootstrap_options
+	global macports::user_options
+	global macports::extra_env
+	global macports::portconf
+	global macports::portdbpath
+	global macports::portsharepath
+	global macports::registry.format
+	global macports::registry.path
+	global macports::sources
+	global macports::sources_conf
+	global macports::startupitem_type
+   	global macports::destroot_umask
+   	global macports::libpath
+   	global macports::prefix
+   	global macports::registry.installtype
+   	global macports::rsync_dir
+   	global macports::rsync_options
+   	global macports::rsync_server
+   	global macports::variants_conf
+   	global macports::xcodebuildcmd
+   	global macports::xcodeversion
    	
    	# Configure the search path for configuration files
    	set conf_files ""
@@ -269,7 +269,7 @@
 		set PORTSRC [lindex [array get env PORTSRC] 1]
 		lappend conf_files ${PORTSRC}
     }
-    lappend conf_files "~/.macports/ports.conf" "${dports_conf_path}/ports.conf"
+    lappend conf_files "~/.macports/macports.conf" "${mports_conf_path}/macports.conf"
     
     # Process the first configuration file we find on conf_files list
 	foreach file $conf_files {
@@ -278,13 +278,9 @@
 			set fd [open $file r]
 			while {[gets $fd line] >= 0} {
 				if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
-					if {[regexp {^"(.*)"[ \t]*$} $val match val2] == 1} {
-						# Nasty hack for malformed rsync_options in ports.conf
-						set val $val2
-					}
 					if {[lsearch $bootstrap_options $option] >= 0} {
-						set darwinports::$option $val
-						global darwinports::$option
+						set macports::$option $val
+						global macports::$option
 					}
 				}
 			}
@@ -300,15 +296,15 @@
 		while {[gets $fd line] >= 0} {
 			if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
 				if {[lsearch $user_options $option] >= 0} {
-					set darwinports::$option $val
-					global darwinports::$option
+					set macports::$option $val
+					global macports::$option
 				}
 			}
 		}
 	}
 	
     if {![info exists sources_conf]} {
-        return -code error "sources_conf must be set in $dports_conf_path/ports.conf or in your ~/.portsrc"
+        return -code error "sources_conf must be set in $mports_conf_path/macports.conf or in your ~/.macports/macports.conf file"
     }
     if {[catch {set fd [open $sources_conf r]} result]} {
         return -code error "$result"
@@ -320,8 +316,8 @@
 	}
     }
     if {![info exists sources]} {
-	if {[file isdirectory dports]} {
-	    set sources "file://[pwd]/dports"
+	if {[file isdirectory mports]} {
+	    set sources "file://[pwd]/mports"
 	} else {
 	    return -code error "No sources defined in $sources_conf"
 	}
@@ -352,7 +348,7 @@
 	}
 
     if {![info exists portdbpath]} {
-	return -code error "portdbpath must be set in $dports_conf_path/ports.conf or in your ~/.portsrc"
+	return -code error "portdbpath must be set in $mports_conf_path/macports.conf or in your ~/.macports/macports.conf"
     }
     if {![file isdirectory $portdbpath]} {
 	if {![file exists $portdbpath]} {
@@ -373,8 +369,8 @@
 	    }
 	}
     }
-    if {![file isdirectory ${darwinports::registry.path}]} {
-	return -code error "${darwinports::registry.path} is not a directory. Please create the directory $portdbpath and try again"
+    if {![file isdirectory ${macports::registry.path}]} {
+	return -code error "${macports::registry.path} is not a directory. Please create the directory $portdbpath and try again"
     }
 
 	# Format for receipts, can currently be either "flat" or "sqlite"
@@ -396,48 +392,48 @@
     
 	# Autoclean mode, whether to automatically call clean after "install"
 	if {![info exists portautoclean]} {
-		set darwinports::portautoclean "yes"
-		global darwinports::portautoclean
+		set macports::portautoclean "yes"
+		global macports::portautoclean
 	}
 	# Check command line override for autoclean
 	if {[info exists options(ports_autoclean)]} {
 		if {![string equal $options(ports_autoclean) $portautoclean]} {
-			set darwinports::portautoclean $options(ports_autoclean)
+			set macports::portautoclean $options(ports_autoclean)
 		}
 	}
 	# Trace mode, whether to use darwintrace to debug ports.
 	if {![info exists porttrace]} {
-		set darwinports::porttrace "no"
-		global darwinports::porttrace
+		set macports::porttrace "no"
+		global macports::porttrace
 	}
 	# Check command line override for trace
 	if {[info exists options(ports_trace)]} {
 		if {![string equal $options(ports_trace) $porttrace]} {
-			set darwinports::porttrace $options(ports_trace)
+			set macports::porttrace $options(ports_trace)
 		}
 	}
 
 	# Export verbosity.
 	if {![info exists portverbose]} {
-		set darwinports::portverbose "no"
-		global darwinports::portverbose
+		set macports::portverbose "no"
+		global macports::portverbose
 	}
 	if {[info exists ui_options(ports_verbose)]} {
 		if {![string equal $ui_options(ports_verbose) $portverbose]} {
-			set darwinports::portverbose $ui_options(ports_verbose)
+			set macports::portverbose $ui_options(ports_verbose)
 		}
 	}
 
 	# Archive mode, whether to create/use binary archive packages
 	if {![info exists portarchivemode]} {
-		set darwinports::portarchivemode "yes"
-		global darwinports::portarchivemode
+		set macports::portarchivemode "yes"
+		global macports::portarchivemode
 	}
 
 	# Archive path, where to store/retrieve binary archive packages
 	if {![info exists portarchivepath]} {
-		set darwinports::portarchivepath [file join $portdbpath packages]
-		global darwinports::portarchivepath
+		set macports::portarchivepath [file join $portdbpath packages]
+		global macports::portarchivepath
 	}
 	if {$portarchivemode == "yes"} {
 		if {![file isdirectory $portarchivepath]} {
@@ -455,35 +451,36 @@
 	# Archive type, what type of binary archive to use (CPIO, gzipped
 	# CPIO, XAR, etc.)
 	if {![info exists portarchivetype]} {
-		set darwinports::portarchivetype "cpgz"
-		global darwinports::portarchivetype
+		set macports::portarchivetype "cpgz"
+		global macports::portarchivetype
 	}
 	# Convert archive type to a list for multi-archive support, colon or
 	# comma separators indicates to use multiple archive formats
 	# (reading and writing)
-	set darwinports::portarchivetype [split $portarchivetype {:,}]
+	set macports::portarchivetype [split $portarchivetype {:,}]
 
 	# Set rync options
 	if {![info exists rsync_server]} {
-		set darwinports::rsync_server rsync.darwinports.org
-		global darwinports::rsync_server
+		set macports::rsync_server rsync.macports.org
+		global macports::rsync_server
 	}
 	if {![info exists rsync_dir]} {
-		set darwinports::rsync_dir dpupdate1/base/
-		global darwinports::rsync_dir
+	    # Still thinking about this path.
+		set macports::rsync_dir release/base/
+		global macports::rsync_dir
 	}
 	if {![info exists rsync_options]} {
-		set rsync_options "-rtzv --delete --delete-after"
-		global darwinports::rsync_options
+		set rsync_options "-rtzv --delete-after"
+		global macports::rsync_options
 	}
 
-    set portsharepath ${prefix}/share/darwinports
+    set portsharepath ${prefix}/share/macports
     if {![file isdirectory $portsharepath]} {
 	return -code error "Data files directory '$portsharepath' must exist"
     }
     
     if {![info exists libpath]} {
-	set libpath "${prefix}/share/darwinports/Tcl"
+	set libpath "${prefix}/share/macports/Tcl"
     }
 
     if {![info exists binpath]} {
@@ -494,8 +491,8 @@
     
     # Set startupitem default type (can be overridden by portfile)
     if {![info exists startupitem_type]} {
-    	set darwinports::startupitem_type "default"
-    	global darwinports::startupitem_type
+    	set macports::startupitem_type "default"
+    	global macports::startupitem_type
     }
     
     # ENV cleanup.
@@ -520,8 +517,8 @@
 
 	if {![info exists xcodeversion] || ![info exists xcodebuildcmd]} {
 		# We'll resolve these later (if needed)
-		trace add variable darwinports::xcodeversion read darwinports::setxcodeinfo
-		trace add variable darwinports::xcodebuildcmd read darwinports::setxcodeinfo
+		trace add variable macports::xcodeversion read macports::setxcodeinfo
+		trace add variable macports::xcodebuildcmd read macports::setxcodeinfo
 	}
 
     # Set the default umask
@@ -543,11 +540,11 @@
 
     if {[file isdirectory $libpath]} {
 		lappend auto_path $libpath
-		set darwinports::auto_path $auto_path
+		set macports::auto_path $auto_path
 
 		# XXX: not sure if this the best place, but it needs to happen
 		# early, and after auto_path has been set.  Or maybe Pextlib
-		# should ship with darwinports1.0 API?
+		# should ship with macports1.0 API?
 		package require Pextlib 1.0
 		package require registry 1.0
     } else {
@@ -555,8 +552,8 @@
     }
 }
 
-proc darwinports::worker_init {workername portpath portbuildpath options variations} {
-    global darwinports::portinterp_options darwinports::portinterp_deferred_options registry.installtype
+proc macports::worker_init {workername portpath portbuildpath options variations} {
+    global macports::portinterp_options macports::portinterp_deferred_options registry.installtype
 
 	# Tell the sub interpreter about all the Tcl packages we already
 	# know about so it won't glob for packages.
@@ -572,20 +569,20 @@
 			package require port \$version \}"
 
     # Clearly separate slave interpreters and the master interpreter.
-	$workername alias dport_exec dportexec
-	$workername alias dport_open dportopen
-	$workername alias dport_close dportclose
-	$workername alias dport_search dportsearch
+	$workername alias mport_exec mportexec
+	$workername alias mport_open mportopen
+	$workername alias mport_close mportclose
+	$workername alias mport_search mportsearch
 
     # instantiate the UI call-backs
-	foreach priority ${darwinports::ui_priorities} {
+	foreach priority ${macports::ui_priorities} {
 		$workername alias ui_$priority ui_$priority
 	}
 	$workername alias ui_prefix ui_prefix
 	$workername alias ui_channels ui_channels
     
     # Export some utility functions defined here.
-    $workername alias darwinports_create_thread darwinports::create_thread
+    $workername alias macports_create_thread macports::create_thread
 
 	# New Registry/Receipts stuff
 	$workername alias registry_new registry::new_entry
@@ -604,11 +601,11 @@
 	$workername alias registry_active registry::active
 
 	# deferred options processing.
-	$workername alias getoption darwinports::getoption
+	$workername alias getoption macports::getoption
 
     foreach opt $portinterp_options {
 		if {![info exists $opt]} {
-		    global darwinports::$opt
+		    global macports::$opt
 		}
         if {[info exists $opt]} {
             $workername eval set system_options($opt) \{[set $opt]\}
@@ -617,7 +614,7 @@
     }
     
 	foreach opt $portinterp_deferred_options {
-		global darwinports::$opt
+		global macports::$opt
 		# define the trace hook.
 		$workername eval \
 			"proc trace_$opt {name1 name2 op} { \n\
@@ -648,10 +645,10 @@
 # Create a thread with most configuration options set.
 # The newly created thread is sent portinterp_options vars and knows where to
 # find all packages we know.
-proc darwinports::create_thread {} {
+proc macports::create_thread {} {
     package require Thread
 
-    global darwinports::portinterp_options
+    global macports::portinterp_options
 
 	# Create the thread.
 	set result [thread::create -preserved {thread::wait}]
@@ -666,23 +663,23 @@
 	}
 
 	# inherit configuration variables.
-	thread::send -async $result "namespace eval darwinports {}"
+	thread::send -async $result "namespace eval macports {}"
 	foreach opt $portinterp_options {
 		if {![info exists $opt]} {
-			global darwinports::$opt
+			global macports::$opt
 		}
         if {[info exists $opt]} {
-			thread::send -async $result "global darwinports::$opt"
-			set val [set darwinports::$opt]
-			thread::send -async $result "set darwinports::$opt \"$val\""
+			thread::send -async $result "global macports::$opt"
+			set val [set macports::$opt]
+			thread::send -async $result "set macports::$opt \"$val\""
 		}
 	}
 	
 	return $result
 }
 
-proc darwinports::fetch_port {url} {
-    global darwinports::portdbpath tcl_platform
+proc macports::fetch_port {url} {
+    global macports::portdbpath tcl_platform
     set fetchdir [file join $portdbpath portdirs]
     set fetchfile [file tail $url]
     if {[catch {file mkdir $fetchdir} result]} {
@@ -706,7 +703,7 @@
     return [file join $fetchdir $portdir]
 }
 
-proc darwinports::getprotocol {url} {
+proc macports::getprotocol {url} {
     if {[regexp {(?x)([^:]+)://.+} $url match protocol] == 1} {
         return ${protocol}
     } else {
@@ -717,18 +714,18 @@
 # XXX: this really needs to be rethought in light of the remote index
 # I've added the destdir parameter.  This is the location a remotely
 # fetched port will be downloaded to (currently only applies to
-# dports:// sources).
-proc darwinports::getportdir {url {destdir "."}} {
+# mports:// sources).
+proc macports::getportdir {url {destdir "."}} {
 	if {[regexp {(?x)([^:]+)://(.+)} $url match protocol string] == 1} {
 		switch -regexp -- ${protocol} {
 			{^file$} {
 				return $string
 			}
-			{^dports$} {
-				return [darwinports::index::fetch_port $url $destdir]
+			{^mports$} {
+				return [macports::index::fetch_port $url $destdir]
 			}
 			{^https?$|^ftp$} {
-				return [darwinports::fetch_port $url]
+				return [macports::fetch_port $url]
 			}
 			default {
 				return -code error "Unsupported protocol $protocol"
@@ -739,28 +736,28 @@
 	}
 }
 
-# dportopen
-# Opens a DarwinPorts portfile specified by a URL.  The portfile is
+# mportopen
+# Opens a MacPorts portfile specified by a URL.  The Portfile is
 # opened with the given list of options and variations.  The result
 # of this function should be treated as an opaque handle to a
-# DarwinPorts Portfile.
+# MacPorts Portfile.
 
-proc dportopen {porturl {options ""} {variations ""} {nocache ""}} {
-    global darwinports::portdbpath darwinports::portconf darwinports::open_dports auto_path
+proc mportopen {porturl {options ""} {variations ""} {nocache ""}} {
+    global macports::portdbpath macports::portconf macports::open_mports auto_path
 
-	# Look for an already-open DPort with the same URL.
+	# Look for an already-open MPort with the same URL.
 	# XXX: should compare options and variations here too.
 	# if found, return the existing reference and bump the refcount.
 	if {$nocache != ""} {
-		set dport {}
+		set mport {}
 	} else {
-		set dport [dlist_search $darwinports::open_dports porturl $porturl]
+		set mport [dlist_search $macports::open_mports porturl $porturl]
 	}
-	if {$dport != {}} {
-		set refcnt [ditem_key $dport refcnt]
+	if {$mport != {}} {
+		set refcnt [ditem_key $mport refcnt]
 		incr refcnt
-		ditem_key $dport refcnt $refcnt
-		return $dport
+		ditem_key $mport refcnt $refcnt
+		return $mport
 	}
 
 	array set options_array $options
@@ -770,7 +767,7 @@
 		set portdir ""
 	}
 
-	set portdir [darwinports::getportdir $porturl $portdir]
+	set portdir [macports::getportdir $porturl $portdir]
 	ui_debug "Changing to port directory: $portdir"
 	cd $portdir
 	set portpath [pwd]
@@ -780,22 +777,22 @@
 
 	set workername [interp create]
 
-	set dport [ditem_create]
-	lappend darwinports::open_dports $dport
-	ditem_key $dport porturl $porturl
-	ditem_key $dport portpath $portpath
-	ditem_key $dport workername $workername
-	ditem_key $dport options $options
-	ditem_key $dport variations $variations
-	ditem_key $dport refcnt 1
+	set mport [ditem_create]
+	lappend macports::open_mports $mport
+	ditem_key $mport porturl $porturl
+	ditem_key $mport portpath $portpath
+	ditem_key $mport workername $workername
+	ditem_key $mport options $options
+	ditem_key $mport variations $variations
+	ditem_key $mport refcnt 1
 	
-    darwinports::worker_init $workername $portpath [darwinports::getportbuildpath $portpath] $options $variations
+    macports::worker_init $workername $portpath [macports::getportbuildpath $portpath] $options $variations
 
     $workername eval source Portfile
 
-    ditem_key $dport provides [$workername eval return \$portname]
+    ditem_key $mport provides [$workername eval return \$portname]
 
-    return $dport
+    return $mport
 }
 
 # Traverse a directory with ports, calling a function on the path of ports
@@ -807,7 +804,7 @@
 # func:		function to call on every port directory (it is passed
 #			category/port/ as its parameter)
 # root:		the directory with all the categories directories.
-proc dporttraverse {func {root .}} {
+proc mporttraverse {func {root .}} {
 	# Save the current directory
 	set pwd [pwd]
 	
@@ -840,13 +837,13 @@
 	cd $pwd
 }
 
-### _dportsearchpath is private; subject to change without notice
+### _mportsearchpath is private; subject to change without notice
 
 # depregex -> regex on the filename to find.
 # search_path -> directories to search
 # executable -> whether we want to check that the file is executable by current
 #				user or not.
-proc _dportsearchpath {depregex search_path {executable 0}} {
+proc _mportsearchpath {depregex search_path {executable 0}} {
     set found 0
     foreach path $search_path {
 	if {![file isdirectory $path]} {
@@ -880,10 +877,10 @@
 # Environment variables DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH,
 # DYLD_FALLBACK_FRAMEWORK_PATH, and DYLD_FALLBACK_LIBRARY_PATH take precedence
 
-proc _libtest {dport depspec} {
+proc _libtest {mport depspec} {
     global env tcl_platform
 	set depline [lindex [split $depspec :] 1]
-	set prefix [_dportkey $dport prefix]
+	set prefix [_mportkey $mport prefix]
 	
 	if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
 	    lappend search_path $env(DYLD_FRAMEWORK_PATH)
@@ -912,29 +909,29 @@
 		set depregex \^${depname}\\.so${depversion}\$
 	}
 
-	return [_dportsearchpath $depregex $search_path]
+	return [_mportsearchpath $depregex $search_path]
 }
 
 ### _bintest is private; subject to change without notice
 
-proc _bintest {dport depspec} {
+proc _bintest {mport depspec} {
     global env
 	set depregex [lindex [split $depspec :] 1]
-	set prefix [_dportkey $dport prefix] 
+	set prefix [_mportkey $mport prefix] 
 	
 	set search_path [split $env(PATH) :]
 	
 	set depregex \^$depregex\$
 	
-	return [_dportsearchpath $depregex $search_path 1]
+	return [_mportsearchpath $depregex $search_path 1]
 }
 
 ### _pathtest is private; subject to change without notice
 
-proc _pathtest {dport depspec} {
+proc _pathtest {mport depspec} {
     global env
 	set depregex [lindex [split $depspec :] 1]
-	set prefix [_dportkey $dport prefix] 
+	set prefix [_mportkey $mport prefix] 
     
 	# separate directory from regex
 	set fullname $depregex
@@ -948,81 +945,81 @@
 
 	set depregex \^$depregex\$
 
-	return [_dportsearchpath $depregex $search_path]
+	return [_mportsearchpath $depregex $search_path]
 }
 
 ### _porttest is private; subject to change without notice
 
-proc _porttest {dport depspec} {
+proc _porttest {mport depspec} {
 	# We don't actually look for the port, but just return false
-	# in order to let the dportdepends handle the dependency
+	# in order to let the mportdepends handle the dependency
 	return 0
 }
 
-### _dportinstalled is private; may change without notice
+### _mportinstalled is private; may change without notice
 
 # Determine if a port is already *installed*, as in "in the registry".
-proc _dportinstalled {dport} {
+proc _mportinstalled {mport} {
 	# Check for the presense of the port in the registry
-	set workername [ditem_key $dport workername]
+	set workername [ditem_key $mport workername]
 	set res [$workername eval registry_exists \${portname} \${portversion}]
 	if {$res != 0} {
-		ui_debug "[ditem_key $dport provides] is installed"
+		ui_debug "[ditem_key $mport provides] is installed"
 		return 1
 	} else {
 		return 0
 	}
 }
 
-### _dportispresent is private; may change without notice
+### _mportispresent is private; may change without notice
 
 # Determine if some depspec is satisfied or if the given port is installed.
 # We actually start with the registry (faster?)
 #
-# dport		the port to test (to figure out if it's present)
+# mport		the port to test (to figure out if it's present)
 # depspec	the dependency test specification (path, bin, lib, etc.)
-proc _dportispresent {dport depspec} {
+proc _mportispresent {mport depspec} {
 	# Check for the presense of the port in the registry
-	set workername [ditem_key $dport workername]
-	ui_debug "Searching for dependency: [ditem_key $dport provides]"
+	set workername [ditem_key $mport workername]
+	ui_debug "Searching for dependency: [ditem_key $mport provides]"
 	if {[catch {set reslist [$workername eval registry_installed \${portname}]} res]} {
 		set res 0
 	} else {
 		set res [llength $reslist]
 	}
 	if {$res != 0} {
-		ui_debug "Found Dependency: receipt exists for [ditem_key $dport provides]"
+		ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
 		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 $dport provides]"
+		ui_debug "Didn't find receipt, going to depspec regex for: [ditem_key $mport provides]"
 		set type [lindex [split $depspec :] 0]
 		switch $type {
-			lib { return [_libtest $dport $depspec] }
-			bin { return [_bintest $dport $depspec] }
-			path { return [_pathtest $dport $depspec] }
-			port { return [_porttest $dport $depspec] }
+			lib { return [_libtest $mport $depspec] }
+			bin { return [_bintest $mport $depspec] }
+			path { return [_pathtest $mport $depspec] }
+			port { return [_porttest $mport $depspec] }
 			default {return -code error "unknown depspec type: $type"}
 		}
 		return 0
 	}
 }
 
-### _dportexec is private; may change without notice
+### _mportexec is private; may change without notice
 
-proc _dportexec {target dport} {
+proc _mportexec {target mport} {
 	# xxx: set the work path?
-	set workername [ditem_key $dport workername]
+	set workername [ditem_key $mport workername]
 	if {![catch {$workername eval eval_variants variations $target} result] && $result == 0 &&
 		![catch {$workername eval eval_targets $target} result] && $result == 0} {
 		# If auto-clean mode, clean-up after dependency install
-		if {[string equal ${darwinports::portautoclean} "yes"]} {
+		if {[string equal ${macports::portautoclean} "yes"]} {
 			# Make sure we are back in the port path before clean
 			# otherwise if the current directory had been changed to
 			# inside the port,  the next port may fail when trying to
 			# install because [pwd] will return a "no file or directory"
 			# error since the directory it was in is now gone.
-			set portpath [ditem_key $dport portpath]
+			set portpath [ditem_key $mport portpath]
 			catch {cd $portpath}
 			$workername eval eval_targets clean
 		}
@@ -1033,15 +1030,15 @@
 	}
 }
 
-# dportexec
-# Execute the specified target of the given dport.
+# mportexec
+# Execute the specified target of the given mport.
 
-proc dportexec {dport target} {
-    global darwinports::registry.installtype
+proc mportexec {mport target} {
+    global macports::registry.installtype
 
-	set workername [ditem_key $dport workername]
+	set workername [ditem_key $mport workername]
 
-	# XXX: move this into dportopen?
+	# XXX: move this into mportopen?
 	if {[$workername eval eval_variants variations $target] != 0} {
 		return 1
 	}
@@ -1060,23 +1057,23 @@
 		|| $target == "pkg" || $target == "mpkg"
 		|| $target == "rpmpackage" || $target == "dpkg" } {
 
-		if {[dportdepends $dport $target] != 0} {
+		if {[mportdepends $mport $target] != 0} {
 			return 1
 		}
 		
 		# Select out the dependents along the critical path,
-		# but exclude this dport, we might not be installing it.
-		set dlist [dlist_append_dependents $darwinports::open_dports $dport {}]
+		# but exclude this mport, we might not be installing it.
+		set dlist [dlist_append_dependents $macports::open_mports $mport {}]
 		
-		dlist_delete dlist $dport
+		dlist_delete dlist $mport
 
 		# install them
 		# xxx: as with below, this is ugly.  and deps need to be fixed to
 		# understand Port Images before this can get prettier
-		if { [string equal ${darwinports::registry.installtype} "image"] } {
-			set result [dlist_eval $dlist _dportinstalled [list _dportexec "activate"]]
+		if { [string equal ${macports::registry.installtype} "image"] } {
+			set result [dlist_eval $dlist _mportinstalled [list _mportexec "activate"]]
 		} else {
-			set result [dlist_eval $dlist _dportinstalled [list _dportexec "install"]]
+			set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
 		}
 		
 		if {$result != {}} {
@@ -1090,19 +1087,19 @@
 		
 		# Close the dependencies, we're done installing them.
 		foreach ditem $dlist {
-			dportclose $ditem
+			mportclose $ditem
 		}
 	}
 
 	# If we're doing an install, check if we should clean after
 	set clean 0
-	if {[string equal ${darwinports::portautoclean} "yes"] && [string equal $target "install"] } {
+	if {[string equal ${macports::portautoclean} "yes"] && [string equal $target "install"] } {
 		set clean 1
 	}
 
 	# If we're doing image installs, then we should activate after install
 	# xxx: This isn't pretty
-	if { [string equal ${darwinports::registry.installtype} "image"] && [string equal $target "install"] } {
+	if { [string equal ${macports::registry.installtype} "image"] && [string equal $target "install"] } {
 		set target activate
 	}
 	
@@ -1112,7 +1109,7 @@
 	# If auto-clean mode and successful install, clean-up after install
 	if {$result == 0 && $clean == 1} {
 		# Make sure we are back in the port path, just in case
-		set portpath [ditem_key $dport portpath]
+		set portpath [ditem_key $mport portpath]
 		catch {cd $portpath}
 		$workername eval eval_targets clean
 	}
@@ -1120,40 +1117,40 @@
 	return $result
 }
 
-proc darwinports::getsourcepath {url} {
-	global darwinports::portdbpath
+proc macports::getsourcepath {url} {
+	global macports::portdbpath
 	regsub {://} $url {.} source_path
 	regsub -all {/} $source_path {_} source_path
 	return [file join $portdbpath sources $source_path]
 }
 
-proc darwinports::getportbuildpath {id} {
-	global darwinports::portdbpath
+proc macports::getportbuildpath {id} {
+	global macports::portdbpath
 	regsub {://} $id {.} port_path
 	regsub -all {/} $port_path {_} port_path
 	return [file join $portdbpath build $port_path]
 }
 
-proc darwinports::getindex {source} {
+proc macports::getindex {source} {
 	# Special case file:// sources
-	if {[darwinports::getprotocol $source] == "file"} {
-		return [file join [darwinports::getportdir $source] PortIndex]
+	if {[macports::getprotocol $source] == "file"} {
+		return [file join [macports::getportdir $source] PortIndex]
 	}
 
-	return [file join [darwinports::getsourcepath $source] PortIndex]
+	return [file join [macports::getsourcepath $source] PortIndex]
 }
 
-proc dportsync {args} {
-	global darwinports::sources darwinports::portdbpath tcl_platform
-	global darwinports::autoconf::rsync_path
+proc mportsync {args} {
+	global macports::sources macports::portdbpath macports::rsync_options tcl_platform
+	global macports::autoconf::rsync_path 
 
 	foreach source $sources {
 		ui_info "Synchronizing from $source"
-		switch -regexp -- [darwinports::getprotocol $source] {
+		switch -regexp -- [macports::getprotocol $source] {
 			{^file$} {
-			    set portdir [darwinports::getportdir $source]
+			    set portdir [macports::getportdir $source]
 				if {[file exists $portdir/.svn]} {
-				    if {[catch {set svncmd [darwinports::binaryInPath "svn"]}] == 0} {
+				    if {[catch {set svncmd [macports::binaryInPath "svn"]}] == 0} {
 				        set svn_commandline "${svncmd} update --non-interactive \"${portdir}\""
 				        ui_debug $svn_commandline
 				        if {[catch {system $svn_commandline}]} {
@@ -1167,12 +1164,12 @@
 				    }
 				}
 			}
-			{^dports$} {
-				darwinports::index::sync $darwinports::portdbpath $source
+			{^mports$} {
+				macports::index::sync $macports::portdbpath $source
 			}
 			{^rsync$} {
 				# Where to, boss?
-				set destdir [file dirname [darwinports::getindex $source]]
+				set destdir [file dirname [macports::getindex $source]]
 
 				if {[catch {file mkdir $destdir} result]} {
 					return -code error $result
@@ -1184,7 +1181,7 @@
 				}
 
 				# Do rsync fetch
-				if {[catch {system "${darwinports::autoconf::rsync_path} -rtzv --delete-after --delete \"$source\" \"$destdir\""}]} {
+				if {[catch {system "${macports::autoconf::rsync_path} $rsync_options \"$source\" \"$destdir\""}]} {
 					return -code error "sync failed doing rsync"
 				}
 				if {[catch {system "chmod -R a+r \"$destdir\""}]} {
@@ -1192,7 +1189,7 @@
 				}
 			}
 			{^https?$|^ftp$} {
-				set indexfile [darwinports::getindex $source]
+				set indexfile [macports::getindex $source]
 				if {[catch {file mkdir [file dirname $indexfile]} result]} {
 					return -code error $result
 				}
@@ -1202,19 +1199,19 @@
 	}
 }
 
-proc dportsearch {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
-	global darwinports::portdbpath darwinports::sources
+proc mportsearch {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
+	global macports::portdbpath macports::sources
 	set matches [list]
 	set easy [expr { $field == "name" }]
 	
 	set found 0
 	foreach source $sources {
-		if {[darwinports::getprotocol $source] == "dports"} {
+		if {[macports::getprotocol $source] == "mports"} {
 			array set attrs [list name $pattern]
-			set res [darwinports::index::search $darwinports::portdbpath $source [array get attrs]]
+			set res [macports::index::search $macports::portdbpath $source [array get attrs]]
 			eval lappend matches $res
 		} else {
-			if {[catch {set fd [open [darwinports::getindex $source] r]} result]} {
+			if {[catch {set fd [open [macports::getindex $source] r]} result]} {
 				ui_warn "Can't open index file for source: $source"
 			} else {
 				incr found 1
@@ -1242,10 +1239,10 @@
 						if {$easy} {
 							array set portinfo $line
 						}
-						switch -regexp -- [darwinports::getprotocol ${source}] {
+						switch -regexp -- [macports::getprotocol ${source}] {
 							{^rsync$} {
 								# Rsync files are local
-								set source_url "file://[darwinports::getsourcepath $source]"
+								set source_url "file://[macports::getsourcepath $source]"
 							}
 							default {
 								set source_url $source
@@ -1277,19 +1274,19 @@
 	return $matches
 }
 
-proc dportinfo {dport} {
-	set workername [ditem_key $dport workername]
+proc mportinfo {mport} {
+	set workername [ditem_key $mport workername]
     return [$workername eval array get PortInfo]
 }
 
-proc dportclose {dport} {
-	global darwinports::open_dports
-	set refcnt [ditem_key $dport refcnt]
+proc mportclose {mport} {
+	global macports::open_mports
+	set refcnt [ditem_key $mport refcnt]
 	incr refcnt -1
-	ditem_key $dport refcnt $refcnt
+	ditem_key $mport refcnt $refcnt
 	if {$refcnt == 0} {
-		dlist_delete darwinports::open_dports $dport
-		set workername [ditem_key $dport workername]
+		dlist_delete macports::open_mports $mport
+		set workername [ditem_key $mport workername]
 		interp delete $workername
 	}
 }
@@ -1298,32 +1295,32 @@
 # This API should be considered work in progress and subject to change without notice.
 ##### "
 
-# _dportkey
+# _mportkey
 # - returns a variable from the port's interpreter
 
-proc _dportkey {dport key} {
-	set workername [ditem_key $dport workername]
+proc _mportkey {mport key} {
+	set workername [ditem_key $mport workername]
 	return [$workername eval "return \$${key}"]
 }
 
-# dportdepends builds the list of dports which the given port depends on.
-# This list is added to $dport.
+# mportdepends builds the list of mports which the given port depends on.
+# This list is added to $mport.
 # This list actually depends on the target.
 # This method can optionally recurse through the dependencies, looking for
 #   dependencies of dependencies.
 # This method can optionally cut the search when ports are already installed or
 #   the dependencies are satisfied.
 #
-# dport -> dport item
+# mport -> mport item
 # target -> target to consider the dependency for
 # recurseDeps -> if the search should be recursive
 # skipSatisfied -> cut the search tree when encountering installed/satisfied
 #                  dependencies ports.
 # accDeps -> accumulator for recursive calls
 # return 0 if everything was ok, an non zero integer otherwise.
-proc dportdepends {dport {target ""} {recurseDeps 1} {skipSatisfied 1} {accDeps {}}} {
+proc mportdepends {mport {target ""} {recurseDeps 1} {skipSatisfied 1} {accDeps {}}} {
 
-	array set portinfo [dportinfo $dport]
+	array set portinfo [mportinfo $mport]
 	set depends {}
 	set deptypes {}
 		
@@ -1359,7 +1356,7 @@
 		set dep_portname [lindex [split $depspec :] end]
 		
 		# Find the porturl
-		if {[catch {set res [dportsearch $dep_portname false exact]} error]} {
+		if {[catch {set res [mportsearch $dep_portname false exact]} error]} {
 			global errorInfo
 			ui_debug "$errorInfo"
 			ui_error "Internal error: port search failed: $error"
@@ -1378,17 +1375,17 @@
 			return 1
 		}
 
-		set options [ditem_key $dport options]
-		set variations [ditem_key $dport variations]
+		set options [ditem_key $mport options]
+		set variations [ditem_key $mport variations]
 
 		# Figure out the subport.	
-		set subport [dportopen $porturl $options $variations]
+		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 || ![_dportispresent $subport $depspec]} {
+		if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {
 			# Append the sub-port's provides to the port's requirements list.
-			ditem_append_unique $dport requires "[ditem_key $subport provides]"
+			ditem_append_unique $mport requires "[ditem_key $subport provides]"
 	
 			if {$recurseDeps} {
 				# Skip the port if it's already in the accumulated list.
@@ -1407,7 +1404,7 @@
 	if {$recurseDeps} {
 		foreach subport $subPorts {
 			# Sub ports should be installed (all dependencies must be satisfied).
-			set res [dportdepends $subport "" $recurseDeps $skipSatisfied $accDeps]
+			set res [mportdepends $subport "" $recurseDeps $skipSatisfied $accDeps]
 			if {$res != 0} {
 				return $res
 			}
@@ -1418,9 +1415,9 @@
 }
 
 # selfupdate procedure
-proc darwinports::selfupdate {optionslist} {
-	global darwinports::prefix darwinports::rsync_server darwinports::rsync_dir darwinports::rsync_options
-	global darwinports::autoconf::rsync_path
+proc macports::selfupdate {optionslist} {
+	global macports::prefix macports::portdbpath macports::rsync_server macports::rsync_dir macports::rsync_options
+	global macports::autoconf::rsync_path
 	array set options $optionslist
 	
 	if { [info exists options(ports_force)] && $options(ports_force) == "yes" } {
@@ -1431,83 +1428,84 @@
 		ui_debug "Rebuilding the MacPorts base system if needed."
 	}
 	# syncing ports tree. We expect the user have rsync:// in the sources.conf
-	if {[catch {dportsync} result]} {
-		return -code error "Couldn't sync dports tree: $result"
+	if {[catch {mportsync} result]} {
+		return -code error "Couldn't sync the ports tree: $result"
 	}
 
-	set dp_base_path [file join $prefix var/db/dports/sources/rsync.${rsync_server}_${rsync_dir}/]
-	if {![file exists $dp_base_path]} {
-		file mkdir $dp_base_path
+	set mp_base_path [file join $portdbpath sources ${rsync_server}_${rsync_dir}/]
+	if {![file exists $mp_base_path]} {
+		file mkdir $mp_base_path
 	}
-	ui_debug "MacPorts base dir: $dp_base_path"
+	ui_debug "MacPorts base dir: $mp_base_path"
 
-	# get user of the darwinports system
-	set user [file attributes [file join $prefix var/db/dports/sources/] -owner]
+	# get user of the MacPorts system
+	set user [file attributes [file join $portdbpath sources/] -owner]
 	ui_debug "Setting user: $user"
 
-	# get darwinports version 
-	set dp_version_path [file join ${prefix}/etc/ports/ dp_version]
-	if { [file exists $dp_version_path]} {
-		set fd [open $dp_version_path r]
-		gets $fd dp_version_old
+	# get MacPorts version 
+	set mp_version_path [file join $mports_conf_path mp_version]
+	if { [file exists $mp_version_path]} {
+		set fd [open $mp_version_path r]
+		gets $fd mp_version_old
 		close $fd
 	} else {
-		set dp_version_old 0
+		set mp_version_old 0
 	}
-	ui_msg "DarwinPorts base version $dp_version_old installed"
+	ui_msg "MacPorts base version $mp_version_old installed"
 
 	ui_debug "Updating using rsync"
-	if { [catch { system "${darwinports::autoconf::rsync_path} $rsync_options rsync://${rsync_server}/${rsync_dir} $dp_base_path" } ] } {
+	if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir} $mp_base_path" } ] } {
 		return -code error "Error: rsync failed in selfupdate"
 	}
 
-	# get downloaded darwinports version and write the old version back
-	set fd [open [file join $dp_base_path config/dp_version] r]
-	gets $fd dp_version_new
+	# get downloaded macports version and write the old version back
+	set fd [open [file join $mp_base_path config mp_version] r]
+	gets $fd mp_version_new
 	close $fd
-	ui_msg "Downloaded MacPorts base version $dp_version_new"
+	ui_msg "Downloaded MacPorts base version $mp_version_new"
 
 	# check if we we need to rebuild base
-	if {$dp_version_new > $dp_version_old || $use_the_force_luke == "yes"} {
+	if {$mp_version_new > $mp_version_old || $use_the_force_luke == "yes"} {
 		ui_msg "Configuring, Building and Installing new MacPorts base"
 		# check if $prefix/bin/port is writable, if so we go !
 		# get installation user / group 
 		set owner root
 		set group admin
-		if {[file exists [file join $prefix bin/port] ]} {
+	        set portprog [file join $prefix bin port]
+		if {[file exists $portprog ]} {
 			# set owner
-			set owner [file attributes [file join $prefix bin/port] -owner]
+			set owner [file attributes $portprog -owner]
 			# set group
-			set group [file attributes [file join $prefix bin/port] -group]
+			set group [file attributes $portprog -group]
 		}
 		set p_user [exec /usr/bin/whoami]
-		if {[file writable ${prefix}/bin/port] || [string equal $p_user $owner] } {
+		if {[file writable $portprog] || [string equal $p_user $owner] } {
 			ui_debug "permissions OK"
 		} else {
 			return -code error "Error: $p_user cannot write to ${prefix}/bin - try using sudo"
 		}
 		ui_debug "Setting owner: $owner group: $group"
 
-		set dp_tclpackage_path [file join $prefix var/db/dports/ .tclpackage]
-		if { [file exists $dp_tclpackage_path]} {
-			set fd [open $dp_tclpackage_path r]
+		set mp_tclpackage_path [file join $portdbpath .tclpackage]
+		if { [file exists $mp_tclpackage_path]} {
+			set fd [open $mp_tclpackage_path r]
 			gets $fd tclpackage
 			close $fd
 		} else {
-			set tclpackage [file join ${prefix} share/darwinports/Tcl]
+			set tclpackage [file join ${prefix} share macports Tcl]
 		}
 		# do the actual installation of new base
 		ui_debug "Install in: $prefix as $owner : $group - TCL-PACKAGE in $tclpackage"
-		if { [catch { system "cd $dp_base_path && ./configure --prefix=$prefix --with-install-user=$owner --with-install-group=$group --with-tclpackage=$tclpackage && make && make install" } result] } {
+		if { [catch { system "cd $mp_base_path && ./configure --prefix=$prefix --with-install-user=$owner --with-install-group=$group --with-tclpackage=$tclpackage && make && make install" } result] } {
 			return -code error "Error installing new MacPorts base: $result"
 		}
 	} else {
 		ui_msg "The MacPorts installation is not outdated and so was not updated"
 	}
 
-	# set the darwinports system to the right owner 
+	# set the macports system to the right owner 
 	ui_debug "Setting ownership to $user"
-	if { [catch { exec chown -R $user [file join $prefix var/db/dports/sources/] } result] } {
+	if { [catch { exec chown -R $user [file join $portdbpath sources/] } result] } {
 		return -code error "Couldn't change permissions: $result"
 	}
 
@@ -1517,14 +1515,16 @@
 	return 0
 }
 
-proc darwinports::version {} {
-	global darwinports::prefix darwinports::rsync_server darwinports::rsync_dir
+proc macports::version {} {
+	global macports::rsync_server macports::rsync_dir
+        global macports::autconf:mports_conf_path
 	
-	set dp_version_path [file join $prefix etc/ports/ dp_version]
+	set mp_version_path [file join $mports_conf_path mp_version]
 
-	if [file exists $dp_version_path] {
-		set fd [open $dp_version_path r]
+	if [file exists $mp_version_path] {
+		set fd [open $mp_version_path r]
 		gets $fd retval
+	        close $fd
 		return $retval
 	} else {
 		return -1
@@ -1532,9 +1532,9 @@
 }
 
 # upgrade procedure
-proc darwinports::upgrade {portname dspec variationslist optionslist {depscachename ""}} {
-	global darwinports::registry.installtype
-	global darwinports::portarchivemode
+proc macports::upgrade {portname dspec variationslist optionslist {depscachename ""}} {
+	global macports::registry.installtype
+	global macports::portarchivemode
 	array set options $optionslist
 	array set variations $variationslist
 	if {![string match "" $depscachename]} {
@@ -1545,7 +1545,7 @@
 	set epoch_override 0
 
 	# check if the port is in tree
-	if {[catch {dportsearch $portname false exact} result]} {
+	if {[catch {mportsearch $portname false exact} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_error "port search failed: $result"
@@ -1567,7 +1567,7 @@
 	set version_in_tree "$portinfo(version)_$portinfo(revision)"
 	set epoch_in_tree "$portinfo(epoch)"
 
-	# the depflag tells us if we should follow deps (this is for stuff installed outside DP)
+	# the depflag tells us if we should follow deps (this is for stuff installed outside MacPorts)
 	# if this is set (not 0) we dont follow the deps
 	set depflag 0
 
@@ -1575,29 +1575,29 @@
 	set ilist {}
 	if { [catch {set ilist [registry::installed $portname ""]} result] } {
 		if {$result == "Registry error: $portname not registered as installed." } {
-			ui_debug "$portname is *not* installed by DarwinPorts"
+			ui_debug "$portname is *not* installed by MacPorts"
 			# open porthandle    
 			set porturl $portinfo(porturl)
 		    if {![info exists porturl]} {
 		        set porturl file://./    
 			}    
-			if {[catch {set workername [dportopen $porturl [array get options] ]} result]} {
+			if {[catch {set workername [mportopen $porturl [array get options] ]} result]} {
 					global errorInfo
 					ui_debug "$errorInfo"
 			        ui_error "Unable to open port: $result"        
 					return 1
 		    }
 
-			if {![_dportispresent $workername $dspec ] } {
+			if {![_mportispresent $workername $dspec ] } {
 				# port in not installed - install it!
-				if {[catch {set result [dportexec $workername install]} result]} {
+				if {[catch {set result [mportexec $workername install]} result]} {
 					global errorInfo
 					ui_debug "$errorInfo"
 					ui_error "Unable to exec port: $result"
 					return 1
 				}
 			} else {
-				# port installed outside DP
+				# port installed outside MacPorts
 				ui_debug "$portname installed outside the MacPorts system"
 				set depflag 1
 			}
@@ -1642,7 +1642,7 @@
     			}
 			}
 		}
-        if { [lindex $num 4] == 0 && 0 == [string compare "image" ${darwinports::registry.installtype}] } {
+        if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
 			# activate the latest installed version
 			if {[catch {portimage::activate $portname $version_installed$variant $optionslist} result]} {
 				global errorInfo
@@ -1715,8 +1715,8 @@
 
 				if { [llength deplist] > 0 } {
 					foreach dep $deplist {
-						set dpname [lindex $dep 2] 
-						darwinports::upgrade $dpname "port:$dpname" [array get variations] [array get options]
+						set mpname [lindex $dep 2] 
+						macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
 					}
 				}
 			}
@@ -1753,7 +1753,7 @@
 	}
 	ui_debug "new portvariants: [array get variations]"
 	
-	if {[catch {set workername [dportopen $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"
@@ -1761,13 +1761,13 @@
 	}
 
 	# install version_in_tree
-	if {0 == [string compare "yes" ${darwinports::portarchivemode}]} {
+	if {0 == [string compare "yes" ${macports::portarchivemode}]} {
 		set upgrade_action "archive"
 	} else {
 		set upgrade_action "destroot"
 	}
 
-	if {[catch {set result [dportexec $workername $upgrade_action]} result] || $result != 0} {
+	if {[catch {set result [mportexec $workername $upgrade_action]} result] || $result != 0} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_error "Unable to upgrade port: $result"
@@ -1775,7 +1775,7 @@
 	}
 
 	# uninstall old ports
-    if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${darwinports::registry.installtype}] } {
+    if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${macports::registry.installtype}] } {
 		# uninstall old
 		ui_debug "Uninstalling $portname $version_installed$oldvariant"
 		if {[catch {portuninstall::uninstall $portname $version_installed$oldvariant $optionslist} result]} {
@@ -1794,7 +1794,7 @@
 		}
 	}
 
-	if {[catch {set result [dportexec $workername install]} result]} {
+	if {[catch {set result [mportexec $workername install]} result]} {
 		global errorInfo
 		ui_debug "$errorInfo"
 		ui_error "Couldn't activate $portname $version_in_tree$oldvariant: $result"
@@ -1811,13 +1811,13 @@
 
 		if { [llength deplist] > 0 } {
 			foreach dep $deplist {
-				set dpname [lindex $dep 2] 
-				darwinports::upgrade $dpname "port:$dpname" [array get variations] [array get options]
+				set mpname [lindex $dep 2] 
+				macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
 			}
 		}
 	}
 
 	
 	# close the port handle
-	dportclose $workername
+	mportclose $workername
 }

Modified: branches/dp2mp-move/base/src/macports1.0/macports_autoconf.tcl.in
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_autoconf.tcl.in	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports_autoconf.tcl.in	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,4 +1,4 @@
-# darwinports-autoconf.tcl.in
+# macports-autoconf.tcl.in
 # $Id$
 #
 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
@@ -28,9 +28,9 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 #
-package provide darwinports 1.0
+package provide macports 1.0
 
-namespace eval darwinports::autoconf {
-	variable dports_conf_path "@PORTCONFIGDIR_EXPANDED@"
+namespace eval macports::autoconf {
+	variable mports_conf_path "@MPCONFIGDIR_EXPANDED@"
 	variable rsync_path "@RSYNC@"
 }

Modified: branches/dp2mp-move/base/src/macports1.0/macports_dlist.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_dlist.tcl	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports_dlist.tcl	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,4 +1,4 @@
-# darwinports1.0/darwinports_dlist.tcl
+# macports1.0/macports_dlist.tcl
 # $Id$
 #
 # Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
@@ -29,7 +29,7 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-package provide darwinports_dlist 1.0
+package provide macports_dlist 1.0
 
 # dependency dependency list evaluation package
 #
@@ -46,7 +46,7 @@
 # A dlist is an ordinary TCL list.
 # A ditem should be created with the [ditem_create] procedure,
 # and treated as an opaque reference.
-# A statusdict is an ordinary TCL array, though darwinports_dlist
+# A statusdict is an ordinary TCL array, though macports_dlist
 # should be given complete domain over its contents.
 # XXX: should statusdict and dlist be part of a ditem tuple?
 # Values in the status dict will be {-1, 0, 1} for {failure,
@@ -116,12 +116,12 @@
 }
 
 # ditem_create
-# Create a new array in the darwinports_dlist namespace
+# Create a new array in the macports_dlist namespace
 # returns the name of the array.  This should be used as
 # the ditem handle.
 
 proc ditem_create {} {
-	return [darwinports_dlist::ditem_create]
+	return [macports_dlist::ditem_create]
 }
 
 # ditem_key
@@ -133,11 +133,11 @@
 proc ditem_key {ditem args} {
 	set nbargs [llength $args]
 	if {$nbargs > 1} {
-		return [darwinports_dlist::ditem_key $ditem [lindex $args 0] [lindex $args 1]]
+		return [macports_dlist::ditem_key $ditem [lindex $args 0] [lindex $args 1]]
 	} elseif {$nbargs == 1} {
-		return [darwinports_dlist::ditem_key $ditem [lindex $args 0]]
+		return [macports_dlist::ditem_key $ditem [lindex $args 0]]
 	} else {
-		return [darwinports_dlist::ditem_key $ditem]
+		return [macports_dlist::ditem_key $ditem]
 	}
 }
 
@@ -148,7 +148,7 @@
 #	value - the value to append to the key
 
 proc ditem_append {ditem key args} {
-	eval "return \[darwinports_dlist::ditem_append $ditem $key $args\]"
+	eval "return \[macports_dlist::ditem_append $ditem $key $args\]"
 }
 
 # ditem_append_unique
@@ -159,7 +159,7 @@
 #	value - the value to append to the key
 
 proc ditem_append_unique {ditem key args} {
-	eval "return \[darwinports_dlist::ditem_append_unique $ditem $key $args\]"
+	eval "return \[macports_dlist::ditem_append_unique $ditem $key $args\]"
 }
 
 # ditem_contains
@@ -169,7 +169,7 @@
 #	key   - the key to examine
 #	value - optional value to search for in the key
 proc ditem_contains {ditem key args} {
-	eval "return \[darwinports_dlist::ditem_contains $ditem $key $args\]"
+	eval "return \[macports_dlist::ditem_contains $ditem $key $args\]"
 }
 
 # dlist_append_dependents
@@ -315,13 +315,13 @@
 # Anything below this point is subject to change without notice.
 #####
 
-# Each ditem is actually an array in the darwinports_dlist
+# Each ditem is actually an array in the macports_dlist
 # namespace.  ditem keys correspond to the equivalent array
 # key.  A dlist is simply a list of names of ditem arrays.
-# All private API functions exist in the darwinports_dlist
+# All private API functions exist in the macports_dlist
 # namespace.
 
-namespace eval darwinports_dlist {
+namespace eval macports_dlist {
 
 variable ditem_uniqid 0
 
@@ -388,6 +388,6 @@
 	}
 }
 
-# End of darwinports_dlist namespace
+# End of macports_dlist namespace
 }
 

Modified: branches/dp2mp-move/base/src/macports1.0/macports_fastload.tcl.in
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_fastload.tcl.in	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports_fastload.tcl.in	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,7 +1,7 @@
-# darwinports_fastload.tcl.in
+# macports_fastload.tcl.in
 # $Id$
 #
-# Copyright (c) 2004 Paul Guyot, Darwinports Team.
+# Copyright (c) 2004 Paul Guyot, MacPorts Team.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -29,12 +29,12 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-# This script is here to fast load all the darwinports-related packages.
+# This script is here to fast load all the MacPorts related packages.
 # This avoids the very expensive globbing of Tcl' package mechanism.
 # Please note that this is not required and base/ should work even if some
 # packages are moved as long as their new location is in Tcl's package paths.
 # However, this file also defines a workaround to avoid conflicts between a /
-# installation of DP and a user installation of DP (on the same box).
+# installation of MacPorts and a user installation of MacPorts (on the same box).
 # (this workaround isn't required on 10.4.2).
 #
 # The package command that's replaced in this code works somewhat differently
@@ -70,10 +70,10 @@
 	}
 }
 
-set dir [file join "@TCL_PACKAGE_DIR@" darwinports1.0]
+set dir [file join "@TCL_PACKAGE_DIR@" macports1.0]
 catch {source [file join $dir pkgIndex.tcl]}
 
-foreach dir [glob -directory "@prefix_expanded@" -join share darwinports Tcl *] {
+foreach dir [glob -directory "@prefix_expanded@" -join share macports Tcl *] {
 	catch {source [file join $dir pkgIndex.tcl]}
 }
 

Modified: branches/dp2mp-move/base/src/macports1.0/macports_index.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports_index.tcl	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/macports_index.tcl	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,4 +1,4 @@
-# darwinports_index.tcl
+# macports_index.tcl
 # $Id$
 #
 # Copyright (c) 2004 Apple Computer, Inc.
@@ -29,35 +29,35 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 # 31-Mar-2004
-# Kevin Van Vechten <kevin at opendarwin.org>
+# Kevin Van Vechten <kevin at opedarwin.org>
 #
 
-package provide darwinports_index 1.0
+package provide macports_index 1.0
 
-namespace eval darwinports::index {
+namespace eval macports::index {
 	variable has_sqlite {}
 }
 
-proc darwinports::index::init {} {
-	global darwinports::index::has_sqlite darwinports::prefix
-	if {$darwinports::index::has_sqlite == 1 ||
-		[file exists ${darwinports::prefix}/lib/tclsqlite.dylib]} {
-		load ${darwinports::prefix}/lib/tclsqlite.dylib Sqlite
-		set darwinports::index::has_sqlite 1
+proc macports::index::init {} {
+	global macports::index::has_sqlite macports::prefix
+	if {$macports::index::has_sqlite == 1 ||
+		[file exists ${macports::prefix}/lib/tclsqlite.dylib]} {
+		load ${macports::prefix}/lib/tclsqlite.dylib Sqlite
+		set macports::index::has_sqlite 1
 	} else {
 		return -code error "Sqlite must be installed to use a remote index.  Use the tclsqlite port."
 	}
 }
 
-proc darwinports::index::get_path {source} {
-    global darwinports::portdbpath
+proc macports::index::get_path {source} {
+    global macports::portdbpath
     regsub {://} $source {.} source_dir
     regsub -all {/} $source_dir {_} source_dir
     return [file join $portdbpath sources $source_dir]
 }
 
 
-# darwinports::index::sync
+# macports::index::sync
 # Interact with the remote index at the specified URL.
 # Replays the SQL transactions contained in the remote
 # index file into a local database, creating it if it
@@ -70,10 +70,10 @@
 #              on the url will be appended to this path.
 # url        - the url of the remote index to synchronize with
 
-proc darwinports::index::sync {portdbpath url} {
-	darwinports::index::init
+proc macports::index::sync {portdbpath url} {
+	macports::index::init
 
-	set indexpath [darwinports::index::get_path $url]
+	set indexpath [macports::index::get_path $url]
 	if {[catch {file mkdir $indexpath} result]} {
 		return -code error "$indexpath could not be created: $result"
 	}
@@ -82,7 +82,7 @@
 	cd $indexpath
 	
 	# We actually use http:// as the transport mechanism
-	set url [regsub -- {^dports} $url {http}]
+	set url [regsub -- {^mports} $url {http}]
 
 	# If the database didn't exist, initialize it.
 	# The schema is available on the server in the initialize.sql file.
@@ -165,7 +165,7 @@
 	cd $oldpath
 }
 
-# darwinports::index::search
+# macports::index::search
 #
 # Searches the cached copy of the specified port index for
 # the Portfile satisfying the given query.
@@ -181,9 +181,9 @@
 # attrs      - an array of the attributes to search for
 #			   currently only "name" is supported.
 
-proc darwinports::index::search {portdbpath url attrslist} {
-	darwinports::index::init
-	set indexpath [darwinports::index::get_path $url]
+proc macports::index::search {portdbpath url attrslist} {
+	macports::index::init
+	set indexpath [macports::index::get_path $url]
 
 	if {![file exists $indexpath/database.sqlite]} {
 		return -code error "Can't open index file for source $url. Have you synced your source indexes (port sync)?"
@@ -232,7 +232,7 @@
 		}
 	}
 	
-	# Historically dportsearch has returned a serialized list of arrays.
+	# Historically mportsearch has returned a serialized list of arrays.
 	# This is kinda gross and really needs to change to a more opaque
 	# data type in the future, but to ease the transition we're it the old
 	# way here.  For each port that matched the query, build up an array 
@@ -273,11 +273,11 @@
 
 
 
-# darwinports::index::fetch_port
+# macports::index::fetch_port
 #
 # Checks for a locally cached copy of the port, or downloads the port
 # from the specified URL.  The port is extracted into the current working
-# directory along with a .dports_source file containing the url of the
+# directory along with a .mports_source file containing the url of the
 # source the port came from.  (This can be later used as a default for
 # "port submit")
 #
@@ -287,8 +287,8 @@
 # but we really ought to have an opaque handle to a port.  We want to
 # get the source URL and the Portfile.tar.gz md5 from this opaque handle.
 
-proc darwinports::index::fetch_port {url destdir} {
-	global darwinports::sources
+proc macports::index::fetch_port {url destdir} {
+	global macports::sources
 	
 	set portsource ""
 	set portname ""
@@ -303,7 +303,7 @@
 	foreach source $sources {
 		if {[regexp -- "^$source" $url] == 1} {
 			set portsource $source
-			set indexpath [darwinports::index::get_path $source]
+			set indexpath [macports::index::get_path $source]
 			
 			# Extract the relative portion of the url, 
 			# and append it to the indexpath, this is where
@@ -357,7 +357,7 @@
 				return -code error "Could not unpack port file: $result"
 			}
 			
-			set fd [open ".dports_source" w]
+			set fd [open ".mports_source" w]
 			puts $fd "source: $portsource"
 			puts $fd "port: $portname"
 			puts $fd "version: $portversion"
@@ -367,7 +367,7 @@
 			cd $oldcwd
 		} else {		
 			# We actually use http:// as the transport mechanism
-			set http_url [regsub -- {^dports} $url {http}]
+			set http_url [regsub -- {^mports} $url {http}]
 			if {[catch {exec curl -L -s -S -o $fetchfile $http_url} result ]} {
 				return -code error "Could not download port from remote index: $result"
 			}

Modified: branches/dp2mp-move/base/src/macports1.0/options.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/options.h	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/options.h	2007-04-27 03:52:36 UTC (rev 24502)
@@ -37,13 +37,13 @@
 #include "util.h"
 
 /*
- * dp_options_t
+ * mp_options_t
  *
- * The dp_options_t type manages a collection of various options.
+ * The mp_options_t type manages a collection of various options.
  * Each option has a type, either a string scalar, or an array
  * of strings.  Options may also have a default value.
  *
- * Each dp_options_t should be thought of as a single namespace
+ * Each mp_options_t should be thought of as a single namespace
  * for options.
  *
  * All option names and option values should be UTF-8 strings.
@@ -58,70 +58,70 @@
         char*     string;
         u_int64_t integer;
     } data;
-} dp_desc_t;
+} mp_desc_t;
 
-void dp_desc_free(dp_desc_t d);
+void mp_desc_free(mp_desc_t d);
     // uses free(3) on "array", "string", and "any" types
-    // also performs dp_desc_free() on elements of arrays
-void dp_desc_copy(dp_desc_t* dst, dp_desc_t* src);
+    // also performs mp_desc_free() on elements of arrays
+void mp_desc_copy(mp_desc_t* dst, mp_desc_t* src);
     // allocates any needed space with malloc(3)
 
 
 /* types */
 enum {
-    DP_TYPE_NULL = 0x0000,
-    DP_TYPE_DATA = 0x0001,	// binary data
-    DP_TYPE_UTF_8 = 0x0002,	// UTF-8 string
-    DP_TYPE_INT_64 = 0x0003,	// 64-bit integer
+    MP_TYPE_NULL = 0x0000,
+    MP_TYPE_DATA = 0x0001,	// binary data
+    MP_TYPE_UTF_8 = 0x0002,	// UTF-8 string
+    MP_TYPE_INT_64 = 0x0003,	// 64-bit integer
     
-    DP_TYPE_ARRAY = 0x0100	// array of descriptors
+    MP_TYPE_ARRAY = 0x0100	// array of descriptors
 };
 
 /* option flags */
 enum {
-    DP_OPTIONS_FLAG_IMMUTABLE = 0x10000
+    MP_OPTIONS_FLAG_IMMUTABLE = 0x10000
 };
 
-typedef void* dp_options_t;
+typedef void* mp_options_t;
 
 
 /* result codes */
 enum {
-    DP_OPTIONS_SUCCESS = 0,
+    MP_OPTIONS_SUCCESS = 0,
 
-    DP_OPTIONS_ERROR_UNDEFINED = -1,
+    MP_OPTIONS_ERROR_UNDEFINED = -1,
         // the specified option has not been declared
 
-    DP_OPTIONS_ERROR_WRONG_TYPE = -10,
+    MP_OPTIONS_ERROR_WRONG_TYPE = -10,
         // array operation requested on a string type
         // type differs from previous declaration
     
-    DP_OPTIONS_ERROR_WRONG_DEFAULT = -11,
+    MP_OPTIONS_ERROR_WRONG_DEFAULT = -11,
         // default differs from previous declaration
 
-    DP_OPTIONS_ERROR_IMMUTABLE = -12,
+    MP_OPTIONS_ERROR_IMMUTABLE = -12,
         // could not set the value, the option is immutable
         
-    DP_OPTIONS_ERROR_LAST
+    MP_OPTIONS_ERROR_LAST
 };
 
-dp_options_t dp_options_create();
-dp_options_t dp_options_retain(dp_options_t);
-void dp_options_release(dp_options_t);
+mp_options_t mp_options_create();
+mp_options_t mp_options_retain(mp_options_t);
+void mp_options_release(mp_options_t);
 
-int dp_options_declare(dp_options_t o, char* name, int flags, dp_desc_t* default_value);
+int mp_options_declare(mp_options_t o, char* name, int flags, mp_desc_t* default_value);
     // will copy default_value internally
 
-int dp_options_set_value(dp_options_t o, char* name, dp_desc_t* new_value);
+int mp_options_set_value(mp_options_t o, char* name, mp_desc_t* new_value);
     // will copy new_value internally
 
-int dp_options_get_value(dp_options_t o, char* name, dp_desc_t* out_value);
-    // free out_value with dp_desc_free();
+int mp_options_get_value(mp_options_t o, char* name, mp_desc_t* out_value);
+    // free out_value with mp_desc_free();
 
-int dp_options_set_ex_attr(dp_options_t o, char* name, char* key, dp_desc_t* new_value);
+int mp_options_set_ex_attr(mp_options_t o, char* name, char* key, mp_desc_t* new_value);
     // will copy new_value internally
 
-int dp_options_get_ex_attr(dp_options_t o, char* name, char* key, dp_desc_t* out_value);
-    // free out_value with dp_desc_free();
+int mp_options_get_ex_attr(mp_options_t o, char* name, char* key, mp_desc_t* out_value);
+    // free out_value with mp_desc_free();
 
-#endif /* __OPTION_H__ */
\ No newline at end of file
+#endif /* __OPTION_H__ */

Modified: branches/dp2mp-move/base/src/macports1.0/portconf.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/portconf.c	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/portconf.c	2007-04-27 03:52:36 UTC (rev 24502)
@@ -46,7 +46,7 @@
     return TCL_OK;
 }
 
-void parse_port_conf(dp_session_t dp UNUSED, char* path) {
+void parse_port_conf(mp_session_t mp UNUSED, char* path) {
     int fd = open(path, O_RDONLY, 0);
     if (fd != -1) {
         Tcl_Interp* interp = Tcl_CreateInterp();

Modified: branches/dp2mp-move/base/src/macports1.0/session.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/session.c	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/session.c	2007-04-27 03:52:36 UTC (rev 24502)
@@ -48,66 +48,66 @@
 
 /*
  *
- * dp_session_t
+ * mp_session_t
  *
  */
 struct session {
     char* portdbpath;
     char* portconf;
     char* sources_conf;
-    dp_array_t sources;
+    mp_array_t sources;
     char* portsharepath;
     char* registry_path;
 };
 
-dp_session_t dp_session_open() {
-    struct session* dp = (struct session*)malloc(sizeof(struct session));
+mp_session_t mp_session_open() {
+    struct session* mp = malloc(sizeof(struct session));
     char* path;
-    /* dp_array_t conf_files = dp_array_create(); */
+    /* mp_array_t conf_files = mp_array_create(); */
     
-    dp->portconf = NULL;
+    mp->portconf = NULL;
     
     /* first look at PORTSRC for testing/debugging */
     path = getenv("PORTSRC");
     if (path != NULL && access(path, R_OK) == 0) {
-        dp->portconf = strdup(path);
-        /* dp_array_append(conf_files, dp->portconf); */
+        mp->portconf = strdup(path);
+        /* mp_array_append(conf_files, mp->portconf); */
     }
 
-    /* then look in ~/.portsrc */
-    if (dp->portconf == NULL) {
+    /* then look in ~/.macports/macports.conf */
+    if (mp->portconf == NULL) {
         char* home = getenv("HOME");
         if (home != NULL) {
             char path[PATH_MAX];
-            snprintf(path, sizeof(path), "%s/.portsrc", home);
+            snprintf(path, sizeof(path), "%s/.macports/macports.conf", home);
             if (access(path, R_OK) == 0) {
-                dp->portconf = strdup(path);
-                /* dp_array_append(conf_files, dp->portconf); */
+                mp->portconf = strdup(path);
+                /* mp_array_append(conf_files, mp->portconf); */
             }
         }
     }
 
-    /* finally /etc/ports/ports.conf, or whatever path was configured */
-    if (dp->portconf == NULL) {
-      /* XXX: honor autoconf setting ($dports_conf_path) */
-        char* path = "/etc/ports/ports.conf";
+    /* finally ${prefix}/etc/macports/macports.conf, or whatever path was configured */
+    if (mp->portconf == NULL) {
+      /* XXX: honor autoconf setting ($mports_conf_path) */
+        char* path = "${prefix}/etc/macports/macports.conf";
         if (access(path, R_OK) == 0) {
-            dp->portconf = strdup(path);
-            /* dp_array_append(conf_files, dp->portconf); */
+            mp->portconf = strdup(path);
+            /* mp_array_append(conf_files, mp->portconf); */
         }
     }
     
     /* foreach conf_files */
     {
-        int fd = open(dp->portconf, O_RDONLY, 0);
+        int fd = open(mp->portconf, O_RDONLY, 0);
         if (fd != -1) {
 	  /* XXX: parse config file */
         }
     }
     
-    if (dp->sources_conf == NULL) {
-        fprintf(stderr, "sources_conf must be set in /etc/ports/ports.conf or in your ~/.portsrc\n");
+    if (mp->sources_conf == NULL) {
+        fprintf(stderr, "sources_conf must be set in ${prefix}/etc/macports/macports.conf or in your ~/.macports/macports.conf file\n");
     }
-    return (dp_session_t)dp;
+    return (mp_session_t)mp;
 }
 

Modified: branches/dp2mp-move/base/src/macports1.0/test_dlist.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/test_dlist.tcl	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/test_dlist.tcl	2007-04-27 03:52:36 UTC (rev 24502)
@@ -1,14 +1,14 @@
 #!/usr/bin/env tclsh
-# darwinports1.0/test_dlist.tcl
+# macports1.0/test_dlist.tcl
 # $Id$
 #
-# Copyright (c) 2003 Kevin Van Vechten <kevin at opendarwin.org>
+# Copyright (c) 2003 Kevin Van Vechten <kevin at openmac.org>
 
-# Test suite for darwinports_dlist package.
+# Test suite for macports_dlist package.
 
 #lappend auto_path .
-#package require darwinports_dlist 1.0
-source darwinports_dlist.tcl
+#package require macports_dlist 1.0
+source macports_dlist.tcl
 
 puts ""
 puts "Testing ditem"

Modified: branches/dp2mp-move/base/src/macports1.0/util.c
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/util.c	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/util.c	2007-04-27 03:52:36 UTC (rev 24502)
@@ -42,47 +42,47 @@
 
 /*
  *
- * dp_array_t
+ * mp_array_t
  *
  */
 
-dp_array_t dp_array_create() {
+mp_array_t mp_array_create() {
     Tcl_Obj* res = Tcl_NewListObj(0, NULL);
     if (_util_interp == NULL) _util_interp = Tcl_CreateInterp();
     return res;
 }
 
-dp_array_t dp_array_create_copy(dp_array_t a) {
+mp_array_t mp_array_create_copy(mp_array_t a) {
     Tcl_Obj* array = (Tcl_Obj*)a;
     Tcl_Obj* res = Tcl_DuplicateObj(array);
     return res;
 }
 
-dp_array_t dp_array_retain(dp_array_t a) {
+mp_array_t mp_array_retain(mp_array_t a) {
     Tcl_Obj* array = (Tcl_Obj*)a;
     Tcl_IncrRefCount(array);
-    return (dp_array_t)array;
+    return (mp_array_t)array;
 }
 
-void dp_array_release(dp_array_t a) {
+void mp_array_release(mp_array_t a) {
     Tcl_Obj* array = (Tcl_Obj*)a;
     Tcl_DecrRefCount(array);
 }
 
-void dp_array_append(dp_array_t a, const void* data) {
+void mp_array_append(mp_array_t a, const void* data) {
     Tcl_Obj* array = (Tcl_Obj*)a;
     Tcl_Obj* obj = Tcl_NewByteArrayObj((unsigned char*)&data, sizeof(void*));
     Tcl_ListObjAppendElement(_util_interp, array, obj);
 }
 
-int dp_array_get_count(dp_array_t a) {
+int mp_array_get_count(mp_array_t a) {
     int result;
     Tcl_Obj* array = (Tcl_Obj*)a;
     Tcl_ListObjLength(_util_interp, array, &result);
     return result;
 }
 
-const void* dp_array_get_index(dp_array_t a, int index) {
+const void* mp_array_get_index(mp_array_t a, int index) {
     void** resultPtr;
     int size;
     Tcl_Obj* array = (Tcl_Obj*)a;
@@ -96,7 +96,7 @@
 
 /*
  *
- * dp_hash_t
+ * mp_hash_t
  *
  */
 struct hashtable {
@@ -104,20 +104,20 @@
     int refcount;
 };
 
-dp_hash_t dp_hash_create() {
-    struct hashtable* hash = (struct hashtable*)malloc(sizeof(struct hashtable));
+mp_hash_t mp_hash_create() {
+    struct hashtable* hash = malloc(sizeof(struct hashtable));
     Tcl_InitHashTable(&hash->table, TCL_STRING_KEYS);
     hash->refcount = 1;
-    return (dp_hash_t)hash;
+    return (mp_hash_t)hash;
 }
 
-dp_hash_t dp_hash_retain(dp_hash_t h) {
+mp_hash_t mp_hash_retain(mp_hash_t h) {
     struct hashtable* hash = (struct hashtable*)h;
     ++hash->refcount;
     return h;
 }
 
-void dp_hash_release(dp_hash_t h) {
+void mp_hash_release(mp_hash_t h) {
     struct hashtable* hash = (struct hashtable*)h;
     --hash->refcount;
     if (hash->refcount == 0) {
@@ -126,14 +126,14 @@
     }
 }
 
-void dp_hash_set_value(dp_hash_t h, const void* key, const void* data) {
+void mp_hash_set_value(mp_hash_t h, const void* key, const void* data) {
     struct hashtable* hash = (struct hashtable*)h;
     int created;
     Tcl_HashEntry* entry = Tcl_CreateHashEntry(&hash->table, key, &created);
     Tcl_SetHashValue(entry, (ClientData)data);
 }
 
-const void* dp_hash_get_value(dp_hash_t h, const void* key) {
+const void* mp_hash_get_value(mp_hash_t h, const void* key) {
     struct hashtable* hash = (struct hashtable*)h;
     Tcl_HashEntry* entry = Tcl_FindHashEntry(&hash->table, key);
     if (entry != NULL) {

Modified: branches/dp2mp-move/base/src/macports1.0/util.h
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/util.h	2007-04-27 01:05:08 UTC (rev 24501)
+++ branches/dp2mp-move/base/src/macports1.0/util.h	2007-04-27 03:52:36 UTC (rev 24502)
@@ -33,14 +33,14 @@
 #ifndef __UTIL_H__
 #define __UTIL_H__
 
-typedef void* dp_hash_t;
-dp_hash_t dp_hash_create();
-dp_hash_t dp_hash_create_copy(dp_hash_t h);
-dp_hash_t dp_hash_retain(dp_hash_t h);
-void dp_hash_release(dp_hash_t h);
-void dp_hash_set_value(dp_hash_t h, const void* key, const void* data);
-int dp_hash_get_count(dp_hash_t h);
-const void* dp_hash_get_value(dp_hash_t h, const void* key);
+typedef void* mp_hash_t;
+mp_hash_t mp_hash_create();
+mp_hash_t mp_hash_create_copy(mp_hash_t h);
+mp_hash_t mp_hash_retain(mp_hash_t h);
+void mp_hash_release(mp_hash_t h);
+void mp_hash_set_value(mp_hash_t h, const void* key, const void* data);
+int mp_hash_get_count(mp_hash_t h);
+const void* mp_hash_get_value(mp_hash_t h, const void* key);
 /* something for delete */
 
 #endif /* __UTIL_H__ */

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070426/0594f22a/attachment.html


More information about the macports-changes mailing list