#!/usr/bin/perl -w # # 2011/05/16: v2.2 if ($#ARGV == -1) { print "Usage: $0 123456-78 ...\n"; exit 1 } my %p; open (S, "/usr/bin/showrev -p | sort |"); while () { chomp; $_ =~ s/Requires:.*$//; foreach my $i (split (/[, ]+/, $_)) { next unless ($i =~ /^(\d{6})-(\d{2})$/); next if ((exists $p{$1}) && ($p{$1} ge $2)); $p{$1}=$2; } } close (S); foreach my $i (@ARGV) { next unless ($i =~ /(\d{6})-(\d{2})/); next if ((exists $p{$1}) && ($p{$1} ge $2)); print "$1-$2\n"; }