Dpkg::Changelog::Parse - generic changelog parser for dpkg-parsechangelog
| Use Case | Command | Description |
|---|---|---|
| Parse default changelog | changelog_parse() | Returns Dpkg::Control object(s) from debian/changelog |
| Specify changelog file | changelog_parse(file => 'path/CHANGES') | Override default input file |
| Change output format | changelog_parse(format => 'rfc822') | Override default "dpkg" format |
| Select parser module | changelog_parse(changelogformat => 'myformat') | Use a custom parser (capitalized name) |
| Suppress parse warnings | changelog_parse(verbose => 0) | Disable warnings on standard error |
| Enable compression | changelog_parse(compression => 1) | Load file with compression support (off by default) |
This module provides a set of functions which reproduce all the features of dpkg-parsechangelog.
$fields = changelog_parse(%opt)
This function will parse a changelog. In list context, it returns as many Dpkg::Control objects as the parser did create. In scalar context, it will return only the first one. If the parser did not return any data, it will return an empty list in list context or undef on scalar context. If the parser failed, it will die. Any parse errors will be printed as warnings on standard error, but this can be disabled by passing $opt{verbose} to 0.
The changelog file that is parsed is debian/changelog by default but it can be overridden with $opt{file}. The changelog name used in output messages can be specified with $opt{label}, otherwise it will default to $opt{file}. The default output format is "dpkg" but it can be overridden with $opt{format}.
The parsing itself is done by a parser module (searched in the standard perl library directories. That module is named according to the format that it is able to parse, with the name capitalized. By default it is either Dpkg::Changelog::Debian (from the "debian" format) or the format name looked up in the 40 last lines of the changelog itself (extracted with this perl regular expression "\schangelog-format:\s+([0-9a-z]+)\W"). But it can be overridden with $opt{changelogformat}.
If $opt{compression} is false, the file will be loaded without compression support, otherwise by default compression support is disabled if the file is the default.
All the other keys in %opt are forwarded to the parser module constructor.
New option: verbose in changelog_parse().
Remove functions: changelog_parse_debian(), changelog_parse_plugin().
Remove warnings: For options forceplugin, libdir.
New option: compression in changelog_parse().
Deprecated functions: changelog_parse_debian(), changelog_parse_plugin().
Obsolete options: forceplugin, libdir.
New functions: changelog_parse_debian(), changelog_parse_plugin().
Mark the module as public.
Generated by phpman v4.9.25-3-gdbaf087 Author: Che Dong Under GNU General Public License
2026-07-06 23:15 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format