Created
January 9, 2026 11:57
-
-
Save jmroot/175892576ff9ecae1cff79e7701cf63c to your computer and use it in GitHub Desktop.
Print an arbitrary variable from a Portfile interpreter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env port-tclsh | |
| # usage: mportkey.tcl varname portname [variants] | |
| lassign $argv varname portname variants | |
| package require macports | |
| mportinit | |
| lassign [mportlookup $portname] portname portinfo | |
| set variations [macports::_variants_to_variations $variants] | |
| set mport [mportopen [dict get $portinfo porturl] [dict create subport $portname] $variations] | |
| puts [_mportkey $mport $varname] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment