[69339] trunk/base/src/port1.0/portclean.tcl

snc at macports.org snc at macports.org
Thu Jul 1 05:16:02 PDT 2010


Revision: 69339
          http://trac.macports.org/changeset/69339
Author:   snc at macports.org
Date:     2010-07-01 05:15:59 -0700 (Thu, 01 Jul 2010)
Log Message:
-----------
check that patchfiles is set before using it

Modified Paths:
--------------
    trunk/base/src/port1.0/portclean.tcl

Modified: trunk/base/src/port1.0/portclean.tcl
===================================================================
--- trunk/base/src/port1.0/portclean.tcl	2010-07-01 04:53:57 UTC (rev 69338)
+++ trunk/base/src/port1.0/portclean.tcl	2010-07-01 12:15:59 UTC (rev 69339)
@@ -124,25 +124,27 @@
     }
 
     set count 0
-    foreach file [option patchfiles] {
-        set patchfile [getdistname $file]
-        ui_debug "Looking for $patchfile"
-        set patchfile [file join $distpath $patchfile]
-        if {[file isfile $patchfile]} {
-            ui_debug "Removing file: $patchfile"
-            if {[catch {delete $patchfile} result]} {
-                ui_debug "$::errorInfo"
-                ui_error "$result"
+    if {info exists patchfiles} {
+        foreach file [option patchfiles] {
+            set patchfile [getdistname $file]
+            ui_debug "Looking for $patchfile"
+            set patchfile [file join $distpath $patchfile]
+            if {[file isfile $patchfile]} {
+                ui_debug "Removing file: $patchfile"
+                if {[catch {delete $patchfile} result]} {
+                    ui_debug "$::errorInfo"
+                    ui_error "$result"
+                }
+                incr count
             }
-            incr count
-        }
-        if {!$usealtworkpath && [file isfile ${altprefix}${patchfile}]} {
-            ui_debug "Removing file: ${altprefix}${patchfile}"
-            if {[catch {delete ${altprefix}${patchfile}} result]} {
-                ui_debug "$::errorInfo"
-                ui_error "$result"
+            if {!$usealtworkpath && [file isfile ${altprefix}${patchfile}]} {
+                ui_debug "Removing file: ${altprefix}${patchfile}"
+                if {[catch {delete ${altprefix}${patchfile}} result]} {
+                    ui_debug "$::errorInfo"
+                    ui_error "$result"
+                }
+                incr count
             }
-            incr count
         }
     }
     if {$count > 0} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100701/795393e5/attachment.html>


More information about the macports-changes mailing list