Ticket #1252: patch-port.tcl

File patch-port.tcl, 1.4 KB (added by tp62@…, 20 years ago)

patch for darwinports/base/src/port/port.tcl

Line 
1--- port.tcl.old        Sat Nov 29 19:00:30 2003
2+++ port.tcl    Tue Jan  6 01:29:46 2004
3@@ -277,26 +277,28 @@
4                 set shortname [file tail $rfile]
5                 set fd [open $rfile r]
6             }
7-            set entry [read $fd]
8-            # kind of a corner case but I ran into it testing
9-            if {[catch {close $fd} result]} {
10-                puts "Port failed: $rfile may be corrupted"
11-               exit 1
12-            }
13 
14-            # look for a contents list
15-            set ix [lsearch $entry contents]
16-            if {$ix >= 0} {
17-                set contents [lindex $entry [incr ix]]
18-                set uninst_err 0
19+            while {-1 < [gets $fd line]} {
20+                set match [regexp {^contents \{(.*)\}$} $line dummy contents]
21+                if {$match == 1} {
22                 puts "Contents of $shortname"
23                 foreach f $contents {
24                     puts "\t[lindex $f 0]"
25                 }
26-            } else {
27+                    break
28+                }
29+            }
30+
31+            if {$match == 0} {
32                 puts "No contents list for $shortname"
33                exit 1
34             }
35+
36+            # kind of a corner case but I ran into it testing
37+            if {[catch {close $fd} result]} {
38+                puts "Port failed: $rfile may be corrupted"
39+                exit 1
40+            }
41         } else {
42             puts "Contents listing failed - no registry entry"
43            exit 1