Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #11837 (closed enhancement: fixed)

Opened 20 months ago

Last modified 16 months ago

Make darwinports scripting easier

Reported by: eridius@… Owned by: macports-tickets@…
Priority: Low Milestone: MacPorts 1.4
Component: base Version: 1.4.3
Keywords: Cc: eridius@…
Port:

Description

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

Changed 20 months ago by eridius@…

  • milestone set to Needs developer review

Changed 20 months ago by eridius@…

  • cc eridius@… added

Changed 20 months ago by eridius@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r24460

Changed 19 months ago by jmpp@…

  • milestone changed from Needs developer review to MacPorts 1.4

Changed 16 months ago by nox@…

  • priority changed from Nice to have to Low

Changed 16 months ago by jmpp@…

Merged into the release_1_4 branch in r24908.

-jmpp

Note: See TracTickets for help on using tickets.