2 # rpmdepsize - visualize the size of RPM dependencies
3 # (C) Copyright 2009 Red Hat Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 # Written by Richard W.M. Jones <rjones@redhat.com>
29 GetOptions ('help|?' => \$help,
32 pod2usage (1) if $help || @ARGV == 0;
33 pod2usage (-exitstatus => 0, -verbose => 2) if $man;
35 # Recurse through dependencies until all deps have been found.
45 foreach my $name (sort keys %deps) {
46 if (@{$deps{$name}} == 0) {
57 print "resolving deps in $name ...\n";
59 # repoquery is incredibly slow. Unfortunately python has a
60 # privileged position into the yum databases, and a python
61 # script to access this information runs quickly, so this
62 # is what the alternate implementation below uses.
64 # "repoquery --recursive --resolve -R $name |
65 # sort -u | awk -F- '{print \$1}'";
67 my $cmd = "./repodeps $name | grep -v '^Loaded plugins:'";
69 open RQ, "$cmd |" or die "$cmd: $!";
73 push @{$deps{$name}}, $_;
75 $deps{$_} = [] unless exists $deps{$_};
78 push @{$deps{$name}}, $name if $n == 0;
85 rpmdepsize - Visualize the size of RPM dependencies
89 rpmdepsize [--options] package [package ...]
97 Display short usage message and exit.
101 Display manual page and exit.
113 L<http://et.redhat.com/~rjones/rpmdepsize>
117 L<rpm(1)>, L<repoquery(1)>, L<dot(1)>.
121 Richard W.M. Jones <rjones @ redhat . com>
125 (C) Copyright 2009 Red Hat Inc.,
126 L<http://et.redhat.com/~rjones/febootstrap>.
128 This program is free software; you can redistribute it and/or modify
129 it under the terms of the GNU General Public License as published by
130 the Free Software Foundation; either version 2 of the License, or
131 (at your option) any later version.
133 This program is distributed in the hope that it will be useful,
134 but WITHOUT ANY WARRANTY; without even the implied warranty of
135 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136 GNU General Public License for more details.
138 You should have received a copy of the GNU General Public License
139 along with this program; if not, write to the Free Software
140 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.