1 |
This little perl script provides a sorted list of packages (installed or available to install). I got tired of trying to remember which directory under /usr/portage or /var/db/pkg holds a given ebuild. |
2 |
|
3 |
Now i just enter, for example, 'list-pkgs | grep cups' to see what's available or 'list-pkgs db | grep gtk' to see what's already installed. |
4 |
|
5 |
|
6 |
#!/usr/bin/perl |
7 |
# list-pkgs |
8 |
# Collins Richey 08Mar2001 |
9 |
# usage: list-pkgs db (list installed packages in /va/db/pkg) |
10 |
# list-pkgs (list packages in /usr/portage) |
11 |
if ($ARGV[0] eq "db") |
12 |
{ @list = `find \/var\/db\/pkg -print|grep '.ebuild'`; |
13 |
print "Packages already installed\n\n"; |
14 |
} |
15 |
else |
16 |
{ @list = `find \/usr\/portage -print|grep '.ebuild'`; |
17 |
print "Packages available to be installed\n\n"; |
18 |
} |
19 |
while ($a = shift(@list)) |
20 |
{ chop($a); |
21 |
@list2 = split(/\//,$a); |
22 |
$pkg = pop(@list2); |
23 |
$trash = shift(@list2); |
24 |
$place = join('/',@list2); |
25 |
push(@list3,"$pkg \/$place\n"); |
26 |
} |
27 |
@list3 = sort(@list3); |
28 |
print @list3; |
29 |
|
30 |
|
31 |
enjoy! |
32 |
-- |
33 |
Collins Richey |
34 |
Denver Area |
35 |
Gentoo_rc5 XFCE |