[78177] trunk/base/src

jmr at macports.org jmr at macports.org
Wed Apr 27 08:45:39 PDT 2011


Revision: 78177
          http://trac.macports.org/changeset/78177
Author:   jmr at macports.org
Date:     2011-04-27 08:45:38 -0700 (Wed, 27 Apr 2011)
Log Message:
-----------
fix up logfile paths

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/port/port.tcl
    trunk/base/src/port1.0/portclean.tcl
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2011-04-27 15:04:21 UTC (rev 78176)
+++ trunk/base/src/macports1.0/macports.tcl	2011-04-27 15:45:38 UTC (rev 78177)
@@ -134,7 +134,7 @@
 
     ui_debug "Starting logging for $portname"
 
-    set logname [file join [macports::getportlogpath $portpath] $portname]
+    set logname [macports::getportlogpath $portpath $portname]
     file mkdir $logname
     set logname [file join $logname "main.log"]
 
@@ -1806,11 +1806,11 @@
     return [file join $portdbpath build $port_path $portname]
 }
 
-proc macports::getportlogpath {id} {
+proc macports::getportlogpath {id {portname ""}} {
     global macports::portdbpath
     regsub {://} $id {.} port_path
     regsub -all {/} $port_path {_} port_path
-    return [file join $portdbpath logs $port_path]
+    return [file join $portdbpath logs $port_path $portname]
 }
 
 proc macports::getportworkpath_from_buildpath {portbuildpath} {

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2011-04-27 15:04:21 UTC (rev 78176)
+++ trunk/base/src/port/port.tcl	2011-04-27 15:45:38 UTC (rev 78177)
@@ -1712,7 +1712,7 @@
             array set portinfo [lindex $result 1]
         }
         set portpath [macports::getportdir $porturl]
-        set logfile [file join [macports::getportlogpath $portpath] "main.log"]
+        set logfile [file join [macports::getportlogpath $portpath $portname] "main.log"]
         if {[file exists $logfile]} {
             if {[catch {set fp [open $logfile r]} result]} {
                 break_softcontinue "Could not open file $logfile: $result" 1 status
@@ -3562,7 +3562,7 @@
                 }
 
                 logfile {
-                    set logfile [file join [macports::getportlogpath $portdir] "main.log"]
+                    set logfile [file join [macports::getportlogpath $portdir $portname] "main.log"]
                     if {[file isfile $logfile]} {
                         puts $logfile
                     } else {

Modified: trunk/base/src/port1.0/portclean.tcl
===================================================================
--- trunk/base/src/port1.0/portclean.tcl	2011-04-27 15:04:21 UTC (rev 78176)
+++ trunk/base/src/port1.0/portclean.tcl	2011-04-27 15:45:38 UTC (rev 78177)
@@ -239,14 +239,16 @@
     return 0
 }
 proc portclean::clean_logs {args} {
-    global portpath portbuildpath worksymlink portverbose keeplogs prefix
+    global portpath portbuildpath worksymlink portverbose keeplogs prefix subport
     set logpath [getportlogpath $portpath]
-  	if {[file isdirectory $logpath]} {
-        ui_debug "Removing directory: ${logpath}"
-        if {[catch {delete $logpath} result]} {
+    ser subdir [file join $logpath $subport]
+  	if {[file isdirectory $subdir]} {
+        ui_debug "Removing directory: ${subdir}"
+        if {[catch {delete $subdir} result]} {
             ui_debug "$::errorInfo"
             ui_error "$result"
         }
+        catch {file delete $logpath}
     } else {
         ui_debug "No log directory found to remove at ${logpath}"
     }           	

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2011-04-27 15:04:21 UTC (rev 78176)
+++ trunk/base/src/port1.0/portutil.tcl	2011-04-27 15:45:38 UTC (rev 78177)
@@ -1390,7 +1390,7 @@
         }
         if {[exists copy_log_files]} {
             set log_files [option copy_log_files]
-            set log_dir [getportlogpath $portpath]
+            set log_dir [getportlogpath $portpath $subport]
             file mkdir $log_dir
  
             foreach log_file $log_files {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110427/e89a80ab/attachment.html>


More information about the macports-changes mailing list