whitespace and docs

master
Kyle Keen 11 years ago
parent 3b3c1c993a
commit 33aa170425
  1. 41
      pacgraph
  2. 9
      pacgraph.1

@ -324,9 +324,9 @@ class Gentoo(object):
name = pkg.partition('/')[2]
ver = name.rfind('-')
if name[ver+1] == 'r':
name = name[:name.rfind('-', 0, ver)]
name = name[:name.rfind('-', 0, ver)]
else:
name = name[:ver]
name = name[:ver]
return name
def load_tree(self):
@ -334,26 +334,27 @@ class Gentoo(object):
tree = {}
out = call_stdout('qsize --bytes --nocolor --all')
for line in out:
if line != '':
words = line.split()
name = self.get_name(words[0])
size = words[5]
tree[name] = Node(name=name, size=int(size), link=set())
if line == '':
continue
words = line.split()
name = self.get_name(words[0])
size = words[5]
tree[name] = Node(name=name, size=int(size), link=set())
print("Getting dependencies")
out = call_stdout('emerge --pretend --verbose --depclean')
for line in out:
if line[:4] == ' ':
if line[4] == '@':
if line[4:] == '@selected':
tree[name].explicit = True
else:
name = self.get_name(line)
tree[name].links.add(dep)
elif line[:2] == ' ':
dep = self.get_name(line)
elif line[:3] == '>>>':
break
if line[:4] == ' ':
if line[4] == '@':
if line[4:] == '@selected':
tree[name].explicit = True
else:
name = self.get_name(line)
tree[name].links.add(dep)
elif line[:2] == ' ':
dep = self.get_name(line)
elif line[:3] == '>>>':
break
return tree
def local_load(self):
@ -949,7 +950,7 @@ def parse():
beta = optparse.OptionGroup(parser, "Experimental Options")
beta.add_option('-m', '--mode', dest='mode', default=default_action,
help='Curently supported modes are arch, arch-repo, debian, redhat and ipkg. Default is %s.' % default_action)
help='Curently supported modes are arch, arch-repo, debian, redhat, ipkg and gentoo. Default is %s.' % default_action)
beta.add_option('-n', '--no-compression', dest='use_compression', action='store_false', default=True,
help='Disable all chain compression.')
beta.add_option('--shared', dest='shared', action='store_true', default=False,
@ -1008,7 +1009,7 @@ def main():
filename = os.path.expanduser(options.filename)
tree = None
if options.mode == 'autodetect':
if any(map(exists, 'emerge paludis'.split())):
if exists('emerge'):
print ('Autodetected gentoo.')
options.mode = 'gentoo'
if exists('rpm'):

@ -10,7 +10,7 @@
-[h|s|o|e|c|r|n] [-f FILENAME] [-b|l|t|d COLOR] [-p INT INT] [-m MODE] [--shared] [--disable-palette] [package names]
.Sh DESCRIPTION
.Nm
draws a pretty picture of your installed packages. Common uses are exploring dependency trees or finding hundreds of megs of useless packages. Supported distributions include Arch, Debian and Redhat.
draws a pretty picture of your installed packages. Common uses are exploring dependency trees or finding hundreds of megs of useless packages. Supported distributions include Arch, Debian, Redhat and Gentoo.
.Pp
.Nm
will by default generate a pacgraph.svg and if a converter is found automatically produce pacgraph.png. Alternately, pacgraph-tk provides and interactive version while pacgraph -c/--console produces a brief text summary. A list of packages may be provided as arguments to select them.
@ -62,7 +62,7 @@ Takes two integers, for the smallest and largest font size. Default is -p 10 10
.Pp
.Bl -tag -width ".." -compact
.It Cm -m MODE --mode=MODE
Currently supported modes are arch, arch-repo, debian, redhat and ipkg. Default is arch. Use arch-repo to plot specific packages instead of installed packages.
Currently supported modes are arch, arch-repo, debian, redhat, ipkg and gentoo. Default is autodetect. Use arch-repo to plot specific packages instead of installed packages.
.Pp
.It Cm -n --no-compression
Disable all chain compression.
@ -80,5 +80,8 @@ was written by
.An Kyle Keen Aq keenerd@gmail.com
with patches from
.An Carl Hamann
for Debian and Redhat support.
for Debian and Redhat support
and
.An André Aparício
for Gentoo support.

Loading…
Cancel
Save