Lines 344-349
Link Here
|
344 |
return @pkgs; |
344 |
return @pkgs; |
345 |
} |
345 |
} |
346 |
|
346 |
|
|
|
347 |
# Utility function to do --last |
348 |
sub sort_mtime(@) |
349 |
{ |
350 |
my (@pkgs) = @_; |
351 |
my @npkgs; |
352 |
my %mtimes; |
353 |
|
354 |
for $p (@pkgs) { |
355 |
my $ldbpath = "$dbpath/$p"; |
356 |
|
357 |
# When was this last built/installed? |
358 |
# Use a unique key (not just mtime) incase two packages have |
359 |
# identical mtime. |
360 |
$mtimes{ (stat "$ldbpath/USE")[9] . $p } = $p; |
361 |
} |
362 |
|
363 |
for $k (sort(keys(%mtimes))) { |
364 |
unshift @npkgs, $mtimes{$k}; |
365 |
} |
366 |
|
367 |
return @npkgs; |
368 |
} |
369 |
|
347 |
# Utility function to do -V |
370 |
# Utility function to do -V |
348 |
sub verify($) |
371 |
sub verify($) |
349 |
{ |
372 |
{ |
Lines 503-508
Link Here
|
503 |
} |
526 |
} |
504 |
} |
527 |
} |
505 |
|
528 |
|
|
|
529 |
# Sort package order. |
530 |
if ($opt{'last'}) { |
531 |
@pkgs = sort_mtime(@pkgs); |
532 |
} |
533 |
|
506 |
for my $p (@pkgs) { |
534 |
for my $p (@pkgs) { |
507 |
# Verify package |
535 |
# Verify package |
508 |
if ($opt{'V'}) { verify($p); next; } |
536 |
if ($opt{'V'}) { verify($p); next; } |
Lines 661-666
Link Here
|
661 |
'c', # list configuration files (implies -l) |
689 |
'c', # list configuration files (implies -l) |
662 |
'dump', # show all verifiable information for each file |
690 |
'dump', # show all verifiable information for each file |
663 |
# (must be used with -l, -c, or -d) |
691 |
# (must be used with -l, -c, or -d) |
|
|
692 |
'last', # order package listing by most recent install first |
664 |
'R|requires', # list package dependencies |
693 |
'R|requires', # list package dependencies |
665 |
'scripts', # print the various [un]install scripts |
694 |
'scripts', # print the various [un]install scripts |
666 |
'G|showgroup', # include group name in output |
695 |
'G|showgroup', # include group name in output |