Created
March 23, 2012 21:21
-
-
Save fdelbos/2175177 to your computer and use it in GitHub Desktop.
display information on each package on freebsd
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/local/bin/python | |
import os, sys, commands | |
def print_package(name): | |
rows, columns = os.popen('stty size', 'r').read().split() | |
for i in range (int(columns)): | |
sys.stdout.write('_') | |
print '\n' | |
print '\033[1;32m' + name + '\033[1;m' | |
print '\n' | |
status, output = commands.getstatusoutput('pkg_info ' + name) | |
print output | |
status, output = commands.getstatusoutput('pkg_info -o ' + name) | |
print '\033[1;33m' + output + '\033[1;m' | |
status, output = commands.getstatusoutput('pkg_info -rR ' + name) | |
print '\033[1;31m' + output + '\033[1;m' | |
status, output = commands.getstatusoutput('pkg_info') | |
lines = output.split('\n') | |
for line in lines: | |
pkg = line.split(' ')[0] | |
print_package(pkg) | |
var = raw_input("press enter for next: ") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment