Last active
April 6, 2024 00:07
-
-
Save jmroot/f524dcfe5fdadcd8b7a9c2e46151e0d4 to your computer and use it in GitHub Desktop.
Check which MacPorts ports have binary archives available
This file contains 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 | |
# For every available port, outputs the port name to available.txt | |
# if a binary archive is available on packages.macports.org, or to | |
# unavailable.txt if not. | |
package require macports | |
mportinit | |
set yesfile [open ./available.txt w] | |
set nofile [open ./unavailable.txt w] | |
set archive_site http://packages.macports.org | |
foreach {portname portinfo} [mportlistall] { | |
if {[catch {mportopen [dict get $portinfo porturl] [dict create subport $portname] ""} mport]} { | |
ui_warn "Failed to open portfile for ${portname}: $mport" | |
continue | |
} | |
set archive_name [[ditem_key $mport workername] eval {portfetch::percent_encode [get_portimage_name]}] | |
mportclose $mport | |
if {![catch {curl getsize ${archive_site}/${portname}/${archive_name}} size] && $size > 0} { | |
puts $yesfile $portname | |
} else { | |
puts $nofile $portname | |
} | |
} | |
close $yesfile | |
close $nofile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment