| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
|
| 6 |
eval { |
| 7 |
require Dpkg::Changelog::Parse; |
| 8 |
Dpkg::Changelog::Parse->import(); |
| 9 |
1; |
| 10 |
} or do { |
| 11 |
warn "warning: Dpkg::Changelog::Parse not present, install libdpkg-perl\n"; |
| 12 |
exit 0; |
| 13 |
}; |
| 14 |
|
| 15 |
# Usage: aptitude-changelog-parser [<filename> [<from-version>]] |
| 16 |
|
| 17 |
my %opts; |
| •18 |
$opts{verbose} = 0; |
| 19 |
if (scalar @ARGV >= 1) { |
| 20 |
$opts{file} = shift @ARGV; |
| 21 |
} |
| 22 |
if (scalar @ARGV == 1) { |
| 23 |
$opts{from} = $ARGV[0]; |
| 24 |
} else { |
| 25 |
$opts{all} = undef; |
| 26 |
} |
| 27 |
|
| 28 |
print join "\n", changelog_parse(format => 'rfc822', %opts); |