Changelog.pm 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. # Copyright © 2005, 2007 Frank Lichtenheld <frank@lichtenheld.de>
  2. # Copyright © 2009 Raphaël Hertzog <hertzog@debian.org>
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. =encoding utf8
  17. =head1 NAME
  18. Dpkg::Changelog - base class to implement a changelog parser
  19. =head1 DESCRIPTION
  20. Dpkg::Changelog is a class representing a changelog file
  21. as an array of changelog entries (Dpkg::Changelog::Entry).
  22. By deriving this object and implementing its parse method, you
  23. add the ability to fill this object with changelog entries.
  24. =cut
  25. package Dpkg::Changelog;
  26. use strict;
  27. use warnings;
  28. our $VERSION = '1.01';
  29. use Carp;
  30. use Dpkg::Gettext;
  31. use Dpkg::ErrorHandling qw(:DEFAULT report REPORT_WARN);
  32. use Dpkg::Control;
  33. use Dpkg::Control::Changelog;
  34. use Dpkg::Control::Fields;
  35. use Dpkg::Index;
  36. use Dpkg::Version;
  37. use Dpkg::Vendor qw(run_vendor_hook);
  38. use parent qw(Dpkg::Interface::Storable);
  39. use overload
  40. '@{}' => sub { return $_[0]->{data} };
  41. =head1 METHODS
  42. =over 4
  43. =item $c = Dpkg::Changelog->new(%options)
  44. Creates a new changelog object.
  45. =cut
  46. sub new {
  47. my ($this, %opts) = @_;
  48. my $class = ref($this) || $this;
  49. my $self = {
  50. verbose => 1,
  51. parse_errors => []
  52. };
  53. bless $self, $class;
  54. $self->set_options(%opts);
  55. return $self;
  56. }
  57. =item $c->load($filename)
  58. Parse $filename as a changelog.
  59. =cut
  60. =item $c->set_options(%opts)
  61. Change the value of some options. "verbose" (defaults to 1) defines
  62. whether parse errors are displayed as warnings by default. "reportfile"
  63. is a string to use instead of the name of the file parsed, in particular
  64. in error messages. "range" defines the range of entries that we want to
  65. parse, the parser will stop as soon as it has parsed enough data to
  66. satisfy $c->get_range($opts{range}).
  67. =cut
  68. sub set_options {
  69. my ($self, %opts) = @_;
  70. $self->{$_} = $opts{$_} foreach keys %opts;
  71. }
  72. =item $c->reset_parse_errors()
  73. Can be used to delete all information about errors occurred during
  74. previous L<parse> runs.
  75. =cut
  76. sub reset_parse_errors {
  77. my $self = shift;
  78. $self->{parse_errors} = [];
  79. }
  80. =item $c->parse_error($file, $line_nr, $error, [$line])
  81. Record a new parse error in $file at line $line_nr. The error message is
  82. specified with $error and a copy of the line can be recorded in $line.
  83. =cut
  84. sub parse_error {
  85. my ($self, $file, $line_nr, $error, $line) = @_;
  86. push @{$self->{parse_errors}}, [ $file, $line_nr, $error, $line ];
  87. if ($self->{verbose}) {
  88. if ($line) {
  89. warning("%20s(l$line_nr): $error\nLINE: $line", $file);
  90. } else {
  91. warning("%20s(l$line_nr): $error", $file);
  92. }
  93. }
  94. }
  95. =item $c->get_parse_errors()
  96. Returns all error messages from the last L<parse> run.
  97. If called in scalar context returns a human readable
  98. string representation. If called in list context returns
  99. an array of arrays. Each of these arrays contains
  100. =over 4
  101. =item 1.
  102. a string describing the origin of the data (a filename usually). If the
  103. reportfile configuration option was given, its value will be used instead.
  104. =item 2.
  105. the line number where the error occurred
  106. =item 3.
  107. an error description
  108. =item 4.
  109. the original line
  110. =back
  111. =cut
  112. sub get_parse_errors {
  113. my $self = shift;
  114. if (wantarray) {
  115. return @{$self->{parse_errors}};
  116. } else {
  117. my $res = '';
  118. foreach my $e (@{$self->{parse_errors}}) {
  119. if ($e->[3]) {
  120. $res .= report(REPORT_WARN, g_("%s(l%s): %s\nLINE: %s"), @$e);
  121. } else {
  122. $res .= report(REPORT_WARN, g_('%s(l%s): %s'), @$e);
  123. }
  124. }
  125. return $res;
  126. }
  127. }
  128. =item $c->set_unparsed_tail($tail)
  129. Add a string representing unparsed lines after the changelog entries.
  130. Use undef as $tail to remove the unparsed lines currently set.
  131. =item $c->get_unparsed_tail()
  132. Return a string representing the unparsed lines after the changelog
  133. entries. Returns undef if there's no such thing.
  134. =cut
  135. sub set_unparsed_tail {
  136. my ($self, $tail) = @_;
  137. $self->{unparsed_tail} = $tail;
  138. }
  139. sub get_unparsed_tail {
  140. my $self = shift;
  141. return $self->{unparsed_tail};
  142. }
  143. =item @{$c}
  144. Returns all the Dpkg::Changelog::Entry objects contained in this changelog
  145. in the order in which they have been parsed.
  146. =item $c->get_range($range)
  147. Returns an array (if called in list context) or a reference to an array of
  148. Dpkg::Changelog::Entry objects which each represent one entry of the
  149. changelog. $range is a hash reference describing the range of entries
  150. to return. See section L<"RANGE SELECTION">.
  151. =cut
  152. sub __sanity_check_range {
  153. my ($self, $r) = @_;
  154. my $data = $self->{data};
  155. if (defined($r->{offset}) and not defined($r->{count})) {
  156. warning(g_("'offset' without 'count' has no effect")) if $self->{verbose};
  157. delete $r->{offset};
  158. }
  159. ## no critic (ControlStructures::ProhibitUntilBlocks)
  160. if ((defined($r->{count}) || defined($r->{offset})) &&
  161. (defined($r->{from}) || defined($r->{since}) ||
  162. defined($r->{to}) || defined($r->{until})))
  163. {
  164. warning(g_("you can't combine 'count' or 'offset' with any other " .
  165. 'range option')) if $self->{verbose};
  166. delete $r->{from};
  167. delete $r->{since};
  168. delete $r->{to};
  169. delete $r->{until};
  170. }
  171. if (defined($r->{from}) && defined($r->{since})) {
  172. warning(g_("you can only specify one of 'from' and 'since', using " .
  173. "'since'")) if $self->{verbose};
  174. delete $r->{from};
  175. }
  176. if (defined($r->{to}) && defined($r->{until})) {
  177. warning(g_("you can only specify one of 'to' and 'until', using " .
  178. "'until'")) if $self->{verbose};
  179. delete $r->{to};
  180. }
  181. # Handle non-existing versions
  182. my (%versions, @versions);
  183. foreach my $entry (@{$data}) {
  184. my $version = $entry->get_version();
  185. next unless defined $version;
  186. $versions{$version->as_string()} = 1;
  187. push @versions, $version->as_string();
  188. }
  189. if ((defined($r->{since}) and not exists $versions{$r->{since}})) {
  190. warning(g_("'%s' option specifies non-existing version"), 'since');
  191. warning(g_('use newest entry that is earlier than the one specified'));
  192. foreach my $v (@versions) {
  193. if (version_compare_relation($v, REL_LT, $r->{since})) {
  194. $r->{since} = $v;
  195. last;
  196. }
  197. }
  198. if (not exists $versions{$r->{since}}) {
  199. # No version was earlier, include all
  200. warning(g_('none found, starting from the oldest entry'));
  201. delete $r->{since};
  202. $r->{from} = $versions[-1];
  203. }
  204. }
  205. if ((defined($r->{from}) and not exists $versions{$r->{from}})) {
  206. warning(g_("'%s' option specifies non-existing version"), 'from');
  207. warning(g_('use oldest entry that is later than the one specified'));
  208. my $oldest;
  209. foreach my $v (@versions) {
  210. if (version_compare_relation($v, REL_GT, $r->{from})) {
  211. $oldest = $v;
  212. }
  213. }
  214. if (defined($oldest)) {
  215. $r->{from} = $oldest;
  216. } else {
  217. warning(g_("no such entry found, ignoring '%s' parameter"), 'from');
  218. delete $r->{from}; # No version was oldest
  219. }
  220. }
  221. if (defined($r->{until}) and not exists $versions{$r->{until}}) {
  222. warning(g_("'%s' option specifies non-existing version"), 'until');
  223. warning(g_('use oldest entry that is later than the one specified'));
  224. my $oldest;
  225. foreach my $v (@versions) {
  226. if (version_compare_relation($v, REL_GT, $r->{until})) {
  227. $oldest = $v;
  228. }
  229. }
  230. if (defined($oldest)) {
  231. $r->{until} = $oldest;
  232. } else {
  233. warning(g_("no such entry found, ignoring '%s' parameter"), 'until');
  234. delete $r->{until}; # No version was oldest
  235. }
  236. }
  237. if (defined($r->{to}) and not exists $versions{$r->{to}}) {
  238. warning(g_("'%s' option specifies non-existing version"), 'to');
  239. warning(g_('use newest entry that is earlier than the one specified'));
  240. foreach my $v (@versions) {
  241. if (version_compare_relation($v, REL_LT, $r->{to})) {
  242. $r->{to} = $v;
  243. last;
  244. }
  245. }
  246. if (not exists $versions{$r->{to}}) {
  247. # No version was earlier
  248. warning(g_("no such entry found, ignoring '%s' parameter"), 'to');
  249. delete $r->{to};
  250. }
  251. }
  252. if (defined($r->{since}) and $data->[0]->get_version() eq $r->{since}) {
  253. warning(g_("'since' option specifies most recent version, ignoring"));
  254. delete $r->{since};
  255. }
  256. if (defined($r->{until}) and $data->[-1]->get_version() eq $r->{until}) {
  257. warning(g_("'until' option specifies oldest version, ignoring"));
  258. delete $r->{until};
  259. }
  260. ## use critic
  261. }
  262. sub get_range {
  263. my ($self, $range) = @_;
  264. $range //= {};
  265. my $res = $self->_data_range($range);
  266. if (defined $res) {
  267. return @$res if wantarray;
  268. return $res;
  269. } else {
  270. return;
  271. }
  272. }
  273. sub _is_full_range {
  274. my ($self, $range) = @_;
  275. return 1 if $range->{all};
  276. # If no range delimiter is specified, we want everything.
  277. foreach my $delim (qw(since until from to count offset)) {
  278. return 0 if exists $range->{$delim};
  279. }
  280. return 1;
  281. }
  282. sub _data_range {
  283. my ($self, $range) = @_;
  284. my $data = $self->{data} or return;
  285. return [ @$data ] if $self->_is_full_range($range);
  286. $self->__sanity_check_range($range);
  287. my ($start, $end);
  288. if (defined($range->{count})) {
  289. my $offset = $range->{offset} // 0;
  290. my $count = $range->{count};
  291. # Convert count/offset in start/end
  292. if ($offset > 0) {
  293. $offset -= ($count < 0);
  294. } elsif ($offset < 0) {
  295. $offset = $#$data + ($count > 0) + $offset;
  296. } else {
  297. $offset = $#$data if $count < 0;
  298. }
  299. $start = $end = $offset;
  300. $start += $count+1 if $count < 0;
  301. $end += $count-1 if $count > 0;
  302. # Check limits
  303. $start = 0 if $start < 0;
  304. return if $start > $#$data;
  305. $end = $#$data if $end > $#$data;
  306. return if $end < 0;
  307. $end = $start if $end < $start;
  308. return [ @{$data}[$start .. $end] ];
  309. }
  310. ## no critic (ControlStructures::ProhibitUntilBlocks)
  311. my @result;
  312. my $include = 1;
  313. $include = 0 if defined($range->{to}) or defined($range->{until});
  314. foreach my $entry (@{$data}) {
  315. my $v = $entry->get_version();
  316. $include = 1 if defined($range->{to}) and $v eq $range->{to};
  317. last if defined($range->{since}) and $v eq $range->{since};
  318. push @result, $entry if $include;
  319. $include = 1 if defined($range->{until}) and $v eq $range->{until};
  320. last if defined($range->{from}) and $v eq $range->{from};
  321. }
  322. ## use critic
  323. return \@result if scalar(@result);
  324. return;
  325. }
  326. =item $c->abort_early()
  327. Returns true if enough data have been parsed to be able to return all
  328. entries selected by the range set at creation (or with set_options).
  329. =cut
  330. sub abort_early {
  331. my $self = shift;
  332. my $data = $self->{data} or return;
  333. my $r = $self->{range} or return;
  334. my $count = $r->{count} // 0;
  335. my $offset = $r->{offset} // 0;
  336. return if $self->_is_full_range($r);
  337. return if $offset < 0 or $count < 0;
  338. if (defined($r->{count})) {
  339. if ($offset > 0) {
  340. $offset -= ($count < 0);
  341. }
  342. my $start = my $end = $offset;
  343. $end += $count-1 if $count > 0;
  344. return ($start < @$data and $end < @$data);
  345. }
  346. return unless defined($r->{since}) or defined($r->{from});
  347. foreach my $entry (@{$data}) {
  348. my $v = $entry->get_version();
  349. return 1 if defined($r->{since}) and $v eq $r->{since};
  350. return 1 if defined($r->{from}) and $v eq $r->{from};
  351. }
  352. return;
  353. }
  354. =item $c->save($filename)
  355. Save the changelog in the given file.
  356. =item $c->output()
  357. =item "$c"
  358. Returns a string representation of the changelog (it's a concatenation of
  359. the string representation of the individual changelog entries).
  360. =item $c->output($fh)
  361. Output the changelog to the given filehandle.
  362. =cut
  363. sub output {
  364. my ($self, $fh) = @_;
  365. my $str = '';
  366. foreach my $entry (@{$self}) {
  367. my $text = $entry->output();
  368. print { $fh } $text if defined $fh;
  369. $str .= $text if defined wantarray;
  370. }
  371. my $text = $self->get_unparsed_tail();
  372. if (defined $text) {
  373. print { $fh } $text if defined $fh;
  374. $str .= $text if defined wantarray;
  375. }
  376. return $str;
  377. }
  378. our ( @URGENCIES, %URGENCIES );
  379. BEGIN {
  380. @URGENCIES = qw(low medium high critical emergency);
  381. my $i = 1;
  382. %URGENCIES = map { $_ => $i++ } @URGENCIES;
  383. }
  384. sub _format_dpkg {
  385. my ($self, $range) = @_;
  386. my @data = $self->get_range($range) or return;
  387. my $src = shift @data;
  388. my $f = Dpkg::Control::Changelog->new();
  389. $f->{Urgency} = $src->get_urgency() || 'unknown';
  390. $f->{Source} = $src->get_source() || 'unknown';
  391. $f->{Version} = $src->get_version() // 'unknown';
  392. $f->{Distribution} = join(' ', $src->get_distributions());
  393. $f->{Maintainer} = $src->get_maintainer() // '';
  394. $f->{Date} = $src->get_timestamp() // '';
  395. $f->{Timestamp} = $src->get_timepiece && $src->get_timepiece->epoch // '';
  396. $f->{Changes} = $src->get_dpkg_changes();
  397. # handle optional fields
  398. my $opts = $src->get_optional_fields();
  399. my %closes;
  400. foreach (keys %$opts) {
  401. if (/^Urgency$/i) { # Already dealt
  402. } elsif (/^Closes$/i) {
  403. $closes{$_} = 1 foreach (split(/\s+/, $opts->{Closes}));
  404. } else {
  405. field_transfer_single($opts, $f);
  406. }
  407. }
  408. foreach my $bin (@data) {
  409. my $oldurg = $f->{Urgency} // '';
  410. my $oldurgn = $URGENCIES{$f->{Urgency}} // -1;
  411. my $newurg = $bin->get_urgency() // '';
  412. my $newurgn = $URGENCIES{$newurg} // -1;
  413. $f->{Urgency} = ($newurgn > $oldurgn) ? $newurg : $oldurg;
  414. $f->{Changes} .= "\n" . $bin->get_dpkg_changes();
  415. # handle optional fields
  416. $opts = $bin->get_optional_fields();
  417. foreach (keys %$opts) {
  418. if (/^Closes$/i) {
  419. $closes{$_} = 1 foreach (split(/\s+/, $opts->{Closes}));
  420. } elsif (not exists $f->{$_}) { # Don't overwrite an existing field
  421. field_transfer_single($opts, $f);
  422. }
  423. }
  424. }
  425. if (scalar keys %closes) {
  426. $f->{Closes} = join ' ', sort { $a <=> $b } keys %closes;
  427. }
  428. run_vendor_hook('post-process-changelog-entry', $f);
  429. return $f;
  430. }
  431. sub _format_rfc822 {
  432. my ($self, $range) = @_;
  433. my @data = $self->get_range($range) or return;
  434. my @ctrl;
  435. foreach my $entry (@data) {
  436. my $f = Dpkg::Control::Changelog->new();
  437. $f->{Urgency} = $entry->get_urgency() || 'unknown';
  438. $f->{Source} = $entry->get_source() || 'unknown';
  439. $f->{Version} = $entry->get_version() // 'unknown';
  440. $f->{Distribution} = join(' ', $entry->get_distributions());
  441. $f->{Maintainer} = $entry->get_maintainer() // '';
  442. $f->{Date} = $entry->get_timestamp() // '';
  443. $f->{Timestamp} = $entry->get_timepiece && $entry->get_timepiece->epoch // '';
  444. $f->{Changes} = $entry->get_dpkg_changes();
  445. # handle optional fields
  446. my $opts = $entry->get_optional_fields();
  447. foreach (keys %$opts) {
  448. field_transfer_single($opts, $f) unless exists $f->{$_};
  449. }
  450. run_vendor_hook('post-process-changelog-entry', $f);
  451. push @ctrl, $f;
  452. }
  453. return @ctrl;
  454. }
  455. =item $control = $c->format_range($format, $range)
  456. Formats the changelog into Dpkg::Control::Changelog objects representing the
  457. entries selected by the optional range specifier (see L<"RANGE SELECTION">
  458. for details). In scalar context returns a Dpkg::Index object containing the
  459. selected entries, in list context returns an array of Dpkg::Control::Changelog
  460. objects.
  461. With format B<dpkg> the returned Dpkg::Control::Changelog object is coalesced
  462. from the entries in the changelog that are part of the range requested,
  463. with the fields described below, but considering that "selected entry"
  464. means the first entry of the selected range.
  465. With format B<rfc822> each returned Dpkg::Control::Changelog objects
  466. represents one entry in the changelog that is part of the range requested,
  467. with the fields described below, but considering that "selected entry"
  468. means for each entry.
  469. The different formats return undef if no entries are matched. The following
  470. fields are contained in the object(s) returned:
  471. =over 4
  472. =item Source
  473. package name (selected entry)
  474. =item Version
  475. packages' version (selected entry)
  476. =item Distribution
  477. target distribution (selected entry)
  478. =item Urgency
  479. urgency (highest of all entries in range)
  480. =item Maintainer
  481. person that created the (selected) entry
  482. =item Date
  483. date of the (selected) entry
  484. =item Timestamp
  485. date of the (selected) entry as a timestamp in seconds since the epoch
  486. =item Closes
  487. bugs closed by the (selected) entry/entries, sorted by bug number
  488. =item Changes
  489. content of the (selected) entry/entries
  490. =back
  491. =cut
  492. sub format_range {
  493. my ($self, $format, $range) = @_;
  494. my @ctrl;
  495. if ($format eq 'dpkg') {
  496. @ctrl = $self->_format_dpkg($range);
  497. } elsif ($format eq 'rfc822') {
  498. @ctrl = $self->_format_rfc822($range);
  499. } else {
  500. croak "unknown changelog output format $format";
  501. }
  502. if (wantarray) {
  503. return @ctrl;
  504. } else {
  505. my $index = Dpkg::Index->new(type => CTRL_CHANGELOG);
  506. foreach my $f (@ctrl) {
  507. $index->add($f);
  508. }
  509. return $index;
  510. }
  511. }
  512. =item $control = $c->dpkg($range)
  513. This is a deprecated alias for $c->format_range('dpkg', $range).
  514. =cut
  515. sub dpkg {
  516. my ($self, $range) = @_;
  517. warnings::warnif('deprecated',
  518. 'deprecated method, please use format_range("dpkg", $range) instead');
  519. return $self->format_range('dpkg', $range);
  520. }
  521. =item @controls = $c->rfc822($range)
  522. This is a deprecated alias for C<scalar c->format_range('rfc822', $range)>.
  523. =cut
  524. sub rfc822 {
  525. my ($self, $range) = @_;
  526. warnings::warnif('deprecated',
  527. 'deprecated method, please use format_range("rfc822", $range) instead');
  528. return scalar $self->format_range('rfc822', $range);
  529. }
  530. =back
  531. =head1 RANGE SELECTION
  532. A range selection is described by a hash reference where
  533. the allowed keys and values are described below.
  534. The following options take a version number as value.
  535. =over 4
  536. =item since
  537. Causes changelog information from all versions strictly
  538. later than B<version> to be used.
  539. =item until
  540. Causes changelog information from all versions strictly
  541. earlier than B<version> to be used.
  542. =item from
  543. Similar to C<since> but also includes the information for the
  544. specified B<version> itself.
  545. =item to
  546. Similar to C<until> but also includes the information for the
  547. specified B<version> itself.
  548. =back
  549. The following options don't take version numbers as values:
  550. =over 4
  551. =item all
  552. If set to a true value, all entries of the changelog are returned,
  553. this overrides all other options.
  554. =item count
  555. Expects a signed integer as value. Returns C<value> entries from the
  556. top of the changelog if set to a positive integer, and C<abs(value)>
  557. entries from the tail if set to a negative integer.
  558. =item offset
  559. Expects a signed integer as value. Changes the starting point for
  560. C<count>, either counted from the top (positive integer) or from
  561. the tail (negative integer). C<offset> has no effect if C<count>
  562. wasn't given as well.
  563. =back
  564. Some examples for the above options. Imagine an example changelog with
  565. entries for the versions 1.2, 1.3, 2.0, 2.1, 2.2, 3.0 and 3.1.
  566. Range Included entries
  567. ----- ----------------
  568. since => '2.0' 3.1, 3.0, 2.2
  569. until => '2.0' 1.3, 1.2
  570. from => '2.0' 3.1, 3.0, 2.2, 2.1, 2.0
  571. to => '2.0' 2.0, 1.3, 1.2
  572. count => 2 3.1, 3.0
  573. count => -2 1.3, 1.2
  574. count => 3, offset => 2 2.2, 2.1, 2.0
  575. count => 2, offset => -3 2.0, 1.3
  576. count => -2, offset => 3 3.0, 2.2
  577. count => -2, offset => -3 2.2, 2.1
  578. Any combination of one option of C<since> and C<from> and one of
  579. C<until> and C<to> returns the intersection of the two results
  580. with only one of the options specified.
  581. =head1 CHANGES
  582. =head2 Version 1.01 (dpkg 1.18.8)
  583. New method: $c->format_range().
  584. Deprecated methods: $c->dpkg(), $c->rfc822().
  585. New field Timestamp in output formats.
  586. =head2 Version 1.00 (dpkg 1.15.6)
  587. Mark the module as public.
  588. =cut
  589. 1;