find-aptitude-doc-packages.pl 356 Bytes
Newer Older
1 2 3 4 5 6
#!/usr/bin/perl

use strict;
use warnings;
use 5.010;

7
my $mirror = $ARGV[0] || 'http://httpredir.debian.org/debian/';
8
my $pkg;
9 10 11 12 13 14 15 16 17

while (<STDIN>) {
    # Clear state
    if (/^$/) {
	undef $pkg;
	next;
    }

    # Package found
18 19
    if (/^Package: aptitude-doc-/) {
	$pkg = 1;
20 21 22
    }

    if ($pkg and /^Filename: (.*)$/) {
23
	say "$mirror/$1";
24 25 26
	next;
    }
}