Make darwinports scripting easier
Currently writing a script that uses the darwinports infrastructure requires defining several procs and passing around arrays of options. Ideally I could write a script that looked like
package require darwinports
dportinit
# do stuff here
but instead I need to do something like
package require darwinports
proc ui_isset {val} { if {$val == "ports_debug"} {return 1} {return 0} }
proc global_option_isset {val} { return 0 }
# UI callback
proc ui_prefix {priority} {
switch $priority {
debug {
return "DEBUG: "
}
error {
return "Error: "
}
warn {
return "Warning: "
}
default {
return ""
}
}
}
proc ui_channels {priority} {
return {stderr}
}
array set ui_options {ports_debug yes}
array set global_options {}
array set global_variations {}
dportinit ui_options global_options global_variations
Darwinports should gracefully handle the lack of these procs and should also allow you to pass nothing to dportinit to mean default behaviour.
Change History (6)
Milestone: |
→ Needs developer review
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
Milestone: |
Needs developer review →
MacPorts 1.4
|
Priority: |
Nice to have →
Low
|
Fixed in r24460