[25524] branches/dp2mp-move/base/src

source_changes at macosforge.org source_changes at macosforge.org
Wed May 23 22:24:08 PDT 2007


Revision: 25524
          http://trac.macosforge.org/projects/macports/changeset/25524
Author:   jmpp at macports.org
Date:     2007-05-23 22:24:08 -0700 (Wed, 23 May 2007)

Log Message:
-----------
Merging jberry's r25283: Remove workdir variable (...).

Modified Paths:
--------------
    branches/dp2mp-move/base/src/macports1.0/macports.tcl
    branches/dp2mp-move/base/src/port/port.tcl
    branches/dp2mp-move/base/src/port1.0/portmain.tcl
    branches/dp2mp-move/base/src/port1.0/portutil.tcl

Modified: branches/dp2mp-move/base/src/macports1.0/macports.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-05-24 04:46:38 UTC (rev 25523)
+++ branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-05-24 05:24:08 UTC (rev 25524)
@@ -41,14 +41,14 @@
     	portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
     	portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
     	porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
-    	rsync_dir startupitem_type xcodeversion xcodebuildcmd \
+    	rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
         mp_remote_url mp_remote_submit_url"
     variable user_options "submitter_name submitter_email submitter_key"
     variable portinterp_options "\
     	portdbpath portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
     	registry.path registry.format registry.installtype portarchivemode portarchivepath \
     	portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
-    	rsync_options rsync_dir startupitem_type \
+    	rsync_options rsync_dir startupitem_type place_worksymlink \
         mp_remote_url mp_remote_submit_url \
     	$user_options"
     
@@ -267,7 +267,6 @@
 	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
@@ -540,19 +539,21 @@
     }
     
     # Set startupitem default type (can be overridden by portfile)
-    if {![info exists startupitem_type]} {
+    if {![info exists macports::startupitem_type]} {
     	set macports::startupitem_type "default"
-    	global macports::startupitem_type
     }
 
+    # Default place_worksymlink
+    if {![info exists macports::place_worksymlink]} {
+	set macports::place_worksymlink yes
+    }
+
     # Default mp remote options
-    if {![info exists mp_remote_url]} {
+    if {![info exists macports::mp_remote_url]} {
 	set macports::mp_remote_url "http://db.macports.org"
-	global macports::mp_remote_url
     }
-    if {![info exists mp_remote_submit_url]} {
+    if {![info exists macports::mp_remote_submit_url]} {
 	set macports::mp_remote_submit_url "${macports::mp_remote_url}/submit"
-	global macports::mp_remote_submit_url
     }
     
     # ENV cleanup.
@@ -643,6 +644,7 @@
     
     # Export some utility functions defined here.
     $workername alias macports_create_thread macports::create_thread
+    $workername alias getportworkpath_from_buildpath macports::getportworkpath_from_buildpath
 
 	# New Registry/Receipts stuff
 	$workername alias registry_new registry::new_entry
@@ -775,7 +777,7 @@
 	if {[regexp {(?x)([^:]+)://(.+)} $url match protocol string] == 1} {
 		switch -regexp -- ${protocol} {
 			{^file$} {
-				return $string
+			    return [file normalize $string]
 			}
 			{^mports$} {
 				return [macports::index::fetch_port $url $destdir]
@@ -823,12 +825,11 @@
 		set portdir ""
 	}
 
-	set portdir [macports::getportdir $porturl $portdir]
-	ui_debug "Changing to port directory: $portdir"
-	cd $portdir
-	set portpath [pwd]
+	set portpath [macports::getportdir $porturl $portdir]
+	ui_debug "Changing to port directory: $portpath"
+	cd $portpath
     if {![file isfile Portfile]} {
-        return -code error "Could not find Portfile in $portdir"
+        return -code error "Could not find Portfile in $portpath"
     }
 
 	set workername [interp create]
@@ -1192,6 +1193,14 @@
 	return [file join $portdbpath build $port_path]
 }
 
+proc macnports::getportworkpath_from_buildpath {portbuildpath} {
+    return [file join $portbuildpath work]
+}
+
+proc macports::getportworkpath_from_portdir {portpath} {
+    return [macports::getportworkpath_from_buildpath [macports::getportbuildpath $portpath]]
+}
+
 proc macports::getindex {source} {
 	# Special case file:// sources
 	if {[macports::getprotocol $source] == "file"} {

Modified: branches/dp2mp-move/base/src/port/port.tcl
===================================================================
--- branches/dp2mp-move/base/src/port/port.tcl	2007-05-24 04:46:38 UTC (rev 25523)
+++ branches/dp2mp-move/base/src/port/port.tcl	2007-05-24 05:24:08 UTC (rev 25524)
@@ -1968,6 +1968,14 @@
 					puts $portdir
 				}
 				
+				work {
+					# output the path to the port's work directory
+					set workpath [macports::getportworkpath_from_portdir $portdir]
+					if {[file exists $workpath]} {
+						puts $workpath
+					}
+				}
+				
 				cd {
 					# Change to the port's directory, making it the default
 					# port for any future commands
@@ -2157,6 +2165,7 @@
 	edit		action_portcmds
 	cat			action_portcmds
 	dir			action_portcmds
+	work		action_portcmds
 	cd			action_portcmds
 	url			action_portcmds
 	file		action_portcmds

Modified: branches/dp2mp-move/base/src/port1.0/portmain.tcl
===================================================================
--- branches/dp2mp-move/base/src/port1.0/portmain.tcl	2007-05-24 04:46:38 UTC (rev 25523)
+++ branches/dp2mp-move/base/src/port1.0/portmain.tcl	2007-05-24 05:24:08 UTC (rev 25524)
@@ -42,7 +42,7 @@
 # define options
 options prefix name version revision epoch categories maintainers
 options long_description description homepage
-options workdir worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.arch os.endian platforms default_variants install.user install.group
+options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.arch os.endian platforms default_variants install.user install.group
 
 # Export options via PortInfo
 options_export name version revision epoch categories maintainers platforms description long_description homepage
@@ -53,9 +53,8 @@
 # Hard coded version number for resource location
 default portresourcepath {[file join $portsharepath resources/port1.0]}
 default distpath {[file join $portdbpath distfiles]}
-default workdir work
-default workpath {[file join $portbuildpath $workdir]}
-default worksymlink {[file join $portpath $workdir]}
+default workpath {[getportworkpath_from_buildpath $portbuildpath]}
+default worksymlink {[file join $portpath work]}
 default prefix /opt/local
 default x11prefix /usr/X11R6
 default destdir destroot

Modified: branches/dp2mp-move/base/src/port1.0/portutil.tcl
===================================================================
--- branches/dp2mp-move/base/src/port1.0/portutil.tcl	2007-05-24 04:46:38 UTC (rev 25523)
+++ branches/dp2mp-move/base/src/port1.0/portutil.tcl	2007-05-24 05:24:08 UTC (rev 25524)
@@ -941,7 +941,7 @@
 # filefindbypath
 # Provides searching of the standard path for included files
 proc filefindbypath {fname} {
-    global distpath filesdir workdir worksrcdir portpath
+    global distpath filesdir worksrcdir portpath
     
     if {[file readable $portpath/$fname]} {
 	return $portpath/$fname
@@ -1246,7 +1246,7 @@
 # open_statefile
 # open file to store name of completed targets
 proc open_statefile {args} {
-    global workpath worksymlink portname portpath ports_ignore_older
+    global workpath worksymlink place_worksymlink portname portpath ports_ignore_older
     
     if {![file isdirectory $workpath]} {
 	file mkdir $workpath
@@ -1266,7 +1266,7 @@
     }
 
     # Create a symlink to the workpath for port authors 
-    if {![file isdirectory $worksymlink]} {
+    if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
 	    exec ln -sf $workpath $worksymlink
     }
     
@@ -1288,8 +1288,6 @@
 # check_statefile
 # Check completed/selected state of target/variant $name
 proc check_statefile {class name fd} {
-    global portpath workdir
-    
     seek $fd 0
     while {[gets $fd line] >= 0} {
 	if {$line == "$class: $name"} {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070523/9296b3fd/attachment.html


More information about the macports-changes mailing list