RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port/portindex.tcl,v
retrieving revision 1.12
diff -u -r1.12 portindex.tcl
|
|
|
39 | 39 | |
40 | 40 | proc pindex {portdir} { |
41 | 41 | global target fd directory archive outdir |
42 | | set interp [dportopen file://[file join $directory $portdir]] |
43 | | array set portinfo [dportinfo $interp] |
44 | | dportclose $interp |
45 | | set portinfo(portdir) $portdir |
46 | | puts "Adding port $portinfo(name)" |
47 | | if {$archive == "1"} { |
48 | | if ![file isdirectory [file join $outdir [file dirname $portdir]]] { |
49 | | if {[catch {file mkdir [file join $outdir [file dirname $portdir]]} result]} { |
50 | | puts "$result" |
| 42 | if {[catch {set interp [dportopen file://[file join $directory $portdir]]} result]} { |
| 43 | puts "Skipping improperly formatted file: $portdir/Portfile" |
| 44 | } else { |
| 45 | array set portinfo [dportinfo $interp] |
| 46 | dportclose $interp |
| 47 | set portinfo(portdir) $portdir |
| 48 | puts "Adding port $portinfo(name)" |
| 49 | if {$archive == "1"} { |
| 50 | if ![file isdirectory [file join $outdir [file dirname $portdir]]] { |
| 51 | if {[catch {file mkdir [file join $outdir [file dirname $portdir]]} result]} { |
| 52 | puts "$result" |
| 53 | exit 1 |
| 54 | } |
| 55 | } |
| 56 | set portinfo(portarchive) [file join [file dirname $portdir] [file tail $portdir]].tgz |
| 57 | cd [file join $directory [file dirname $portinfo(portdir)]] |
| 58 | puts "Archiving port $portinfo(name) to [file join $outdir $portinfo(portarchive)]" |
| 59 | if {[catch {exec tar -cf - [file tail $portdir] | gzip -c >[file join $outdir $portinfo(portarchive)]} result]} { |
| 60 | puts "Failed to create port archive $portinfo(portarchive): $result" |
51 | 61 | exit 1 |
52 | 62 | } |
53 | 63 | } |
54 | | set portinfo(portarchive) [file join [file dirname $portdir] [file tail $portdir]].tgz |
55 | | cd [file join $directory [file dirname $portinfo(portdir)]] |
56 | | puts "Archiving port $portinfo(name) to [file join $outdir $portinfo(portarchive)]" |
57 | | if {[catch {exec tar -cf - [file tail $portdir] | gzip -c >[file join $outdir $portinfo(portarchive)]} result]} { |
58 | | puts "Failed to create port archive $portinfo(portarchive): $result" |
59 | | exit 1 |
60 | | } |
| 64 | set output [array get portinfo] |
| 65 | set len [expr [string length $output] + 1] |
| 66 | puts $fd "$portinfo(name) $len" |
| 67 | puts $fd $output |
61 | 68 | } |
62 | | set output [array get portinfo] |
63 | | set len [expr [string length $output] + 1] |
64 | | puts $fd "$portinfo(name) $len" |
65 | | puts $fd $output |
66 | 69 | } |
67 | 70 | |
68 | 71 | if {[expr $argc > 4]} { |