Created
March 8, 2018 20:55
-
-
Save paulp/e44777ac3d3d906c199cabc769c4215b to your computer and use it in GitHub Desktop.
Mine macports sqlite database for package of origin for each program in /opt/local/bin.
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 bash | |
# | |
DB="/opt/local/var/macports/registry/registry.db" | |
QUERY="select ports.name,files.path | |
from files | |
inner join ports | |
on files.id=ports.id AND files.path GLOB '/opt/local/bin/*'" | |
sqlite3 -list -separator ' ' "$DB" "$QUERY" \ | |
| while read -r port path; do echo "$port: $(basename "$path")"; done \ | |
| sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment