Permalink
Browse files
Add install ports proc to restore
- Loading branch information
Showing
with
31 additions
and
0 deletions.
-
+1
−0
src/macports1.0/reclaim.tcl
-
+30
−0
src/macports1.0/restore.tcl
|
|
@@ -406,6 +406,7 @@ namespace eval reclaim { |
|
|
foreach port $portlist { |
|
|
sortdependents_helper $port ports_for_name dependents seen ret |
|
|
} |
|
|
puts $ret |
|
|
return $ret |
|
|
} |
|
|
|
|
|
|
|
|
@@ -132,4 +132,34 @@ namespace eval restore { |
|
|
} |
|
|
return 0 |
|
|
} |
|
|
|
|
|
proc install_ports {portList} { |
|
|
|
|
|
foreach port $portList { |
|
|
|
|
|
set name [string trim [lindex $port 0]] |
|
|
set variations [lindex $port 1] |
|
|
|
|
|
array unset portinfo |
|
|
array set portinfo [lindex $res 1] |
|
|
set porturl $portinfo(porturl) |
|
|
|
|
|
# TODO: error handling, if any? |
|
|
|
|
|
set workername [mportopen $porturl [list subport $portinfo(name)] $variations] |
|
|
|
|
|
# TODO: instead of mportexec, lookup for some API? |
|
|
if {[catch {set result [mportexec $workername install]} result]} { |
|
|
global errorInfo |
|
|
mportclose $workername |
|
|
ui_msg "$errorInfo" |
|
|
return -code error "Unable to execute target 'install' for port '$name': $result" |
|
|
} else { |
|
|
mportclose $workername |
|
|
} |
|
|
|
|
|
# port will be active here |
|
|
} |
|
|
|
|
|
} |
|
|
} |