Created
October 16, 2013 16:10
-
-
Save jsoffer/7010475 to your computer and use it in GitHub Desktop.
Crea de manera ingenua una gráfica .dot que contiene las dependencias de los ports instalados en un sistema FreeBSD (9.1, requiere 'pkg' estilo pkgng)
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
from subprocess import check_output | |
data = check_output(["pkg", "info", "-a", "-d"]) | |
fuente = '' | |
print "digraph Dependencias {" | |
for linea in data.split('\n'): | |
if linea: | |
if linea[-1] == ':': | |
fuente = linea[:-1] | |
else: | |
print "\""+ fuente.strip()+ "\"->\""+ linea.strip()+ "\"" | |
print "overlap=false" | |
print "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment