vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| hello, not sure if this is relevant, especially with the redesign of all things packages, but here is a tiny patch for "pkg_info -o" to list packages that are installed but not present in the INDEX file; it should help people that want to have up to date packages. Index: usr.sbin/pkg_add/pkg_info ================================================== ================= RCS file: /cvs/src/usr.sbin/pkg_add/pkg_info,v retrieving revision 1.28 diff -c -r1.28 pkg_info *** usr.sbin/pkg_add/pkg_info 16 Jan 2005 11:16:23 -0000 1.28 --- usr.sbin/pkg_add/pkg_info 25 Mar 2005 09:57:43 -0000 *************** *** 82,87 **** --- 82,105 ---- return sort(OpenBSD::PkgSpec::match($pat, installed_packages())); } + my %port_index; + + sub read_port_index + { + my $index = "/usr/ports/INDEX"; + if(exists $ENV{'PORTSDIR'}) { + $index = $ENV{'PORTSDIR'} . '/INDEX'; + } + open(INDEX, $index) or die "$!\nDefine PORTSDIR or run 'make index'?"; + while(<INDEX>) { + my @all = split /\|/; + if(@all == 15) { + $port_index{$all[0]} = 1; + } + } + close(INDEX); + } + sub filter_files { require OpenBSD::PackingOld; *************** *** 139,145 **** our ($opt_c, $opt_D, $opt_d, $opt_f, $opt_I, $opt_i, $opt_k, $opt_K, $opt_L, $opt_m, $opt_p, $opt_q, $opt_R, $opt_r, $opt_s, $opt_v, $opt_h, $opt_l, ! $opt_a, $opt_M, $opt_U, $opt_A); my $terse = 0; my $exit_code = 0; my @sought_files; --- 157,163 ---- our ($opt_c, $opt_D, $opt_d, $opt_f, $opt_I, $opt_i, $opt_k, $opt_K, $opt_L, $opt_m, $opt_p, $opt_q, $opt_R, $opt_r, $opt_s, $opt_v, $opt_h, $opt_l, ! $opt_a, $opt_M, $opt_U, $opt_A, $opt_o); my $terse = 0; my $exit_code = 0; my @sought_files; *************** *** 150,155 **** --- 168,176 ---- unless (-d $dir) { print STDERR "Error printing info for $pkg: no info ?\n"; } + if ($opt_o) { + return if exists $port_index{$pkg}; + } if ($opt_I) { my $l = 20 - length($pkg); $l = 1 if $l <= 0; *************** *** 249,255 **** my $locked; try { ! getopts('cDdfhIikKLmpqRrsvhe:E:MU:l:aA', {'e' => sub { my $pat = shift; --- 270,276 ---- my $locked; try { ! getopts('cDdfhIikKLmpqRrsvhe:E:MU:l:aAo', {'e' => sub { my $pat = shift; *************** *** 312,323 **** Usage "Missing package name(s)" unless $terse && $opt_q; } ! if (@ARGV > 0 && ($opt_a || $opt_A)) { ! Usage "Can't specify package name(s) with -a"; } if (@ARGV == 0) { @ARGV = sort(installed_packages(defined $opt_A ? 0 : 1)); } if (@sought_files) { --- 333,348 ---- Usage "Missing package name(s)" unless $terse && $opt_q; } ! if (@ARGV > 0 && ($opt_a || $opt_A || $opt_o)) { ! Usage "Can't specify package name(s) with -a or -o"; } if (@ARGV == 0) { @ARGV = sort(installed_packages(defined $opt_A ? 0 : 1)); + } + + if ($opt_o) { + read_port_index(); } if (@sought_files) { Index: usr.sbin/pkg_add/pkg_info.1 ================================================== ================= RCS file: /cvs/src/usr.sbin/pkg_add/pkg_info.1,v retrieving revision 1.16 diff -c -r1.16 pkg_info.1 *** usr.sbin/pkg_add/pkg_info.1 13 Mar 2005 09:19:02 -0000 1.16 --- usr.sbin/pkg_add/pkg_info.1 25 Mar 2005 09:57:43 -0000 *************** *** 33,39 **** .Ar pkg-name Op Ar ... .Ek .Nm pkg_info ! .Op Fl Aa Ar flags .Sh DESCRIPTION The .Nm --- 33,39 ---- .Ar pkg-name Op Ar ... .Ek .Nm pkg_info ! .Op Fl Aao Ar flags .Sh DESCRIPTION The .Nm *************** *** 139,144 **** --- 139,150 ---- This lets you add a special token to the start of each field. .It Fl M Show the install-message file (if any) for each package. + .It Fl o + List packages that are not present in the ports + .Pa INDEX + file. These + packages may have been superseded by a newer version and you may want to + upgrade them. .It Fl p Show the installation prefix for each package. .It Fl q |