Skip to content
Permalink
Browse files

Add install ports proc to restore

  • Loading branch information
umeshksingla authored and neverpanic committed Jul 17, 2017
1 parent 2df3aa5 commit 68bf1234b66c0b0aade39f2b3554b4e6b001a0b7
Showing with 31 additions and 0 deletions.
  1. +1 −0 src/macports1.0/reclaim.tcl
  2. +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
}

}
}

0 comments on commit 68bf123

Please sign in to comment.
You can’t perform that action at this time.