#! /usr/bin/perl # use strict; use AptPkg::Config '$_config'; use AptPkg::System '$_system'; use AptPkg::Version; use AptPkg::Cache; $_config->init; $_config->{quiet} = 2; $_system = $_config->system; $vs = $_system->versioning; my $cache = AptPkg::Cache->new; for (<>) { chop; ($pack,$ver,$comment)=split(' ',$_,3); $p=$cache->{$pack}; die "$pack not here" unless $p and $p->{VersionList}; for (@{$p->{VersionList}}) { next if $vs->compare($_->{VerStr},$ver)<0; print "$pack/".$_->{FileList}->[0]->{File}->{Archive}; print " ($comment)" if $comment; print "\n"; $ok=1; last; } } exit 1-$ok;