Skip to content

Instantly share code, notes, and snippets.

@jmroot
Created December 26, 2022 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmroot/f84c329919356bfb1ed2d8425f3cfebb to your computer and use it in GitHub Desktop.
Save jmroot/f84c329919356bfb1ed2d8425f3cfebb to your computer and use it in GitHub Desktop.
Check which MacPorts ports are binary distributable
#!/usr/bin/env port-tclsh
# For every available port, outputs the port name to distributable.txt
# if binaries are considered distributable, or to not-distributable.txt
# if not (along with an explanation).
# Set this to where distributable_lib.tcl can be found
set distributable_lib_path .
package require macports
mportinit
source ${distributable_lib_path}/distributable_lib.tcl
set yesfile [open ./distributable.txt w]
set nofile [open ./not-distributable.txt w]
foreach {portname infolist} [mportlistall] {
set distributable_results [check_licenses $portname [list]]
if {[lindex $distributable_results 0] == 0} {
puts $yesfile $portname
} else {
puts $nofile "$portname [lindex $distributable_results 1]"
}
}
close $yesfile
close $nofile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment