Skip to content

Instantly share code, notes, and snippets.

@jsoffer
Created October 16, 2013 16:10
Show Gist options
  • Save jsoffer/7010475 to your computer and use it in GitHub Desktop.
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)
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