Changelog.pm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. #
  2. # Dpkg::Changelog
  3. #
  4. # Copyright © 2005, 2007 Frank Lichtenheld <frank@lichtenheld.de>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. #
  20. =head1 NAME
  21. Dpkg::Changelog
  22. =head1 DESCRIPTION
  23. to be written
  24. =head2 Functions
  25. =cut
  26. package Dpkg::Changelog;
  27. use strict;
  28. use warnings;
  29. use English;
  30. use Dpkg;
  31. use Dpkg::Gettext;
  32. use Dpkg::ErrorHandling qw(warning report);
  33. use base qw(Exporter);
  34. our %EXPORT_TAGS = ( 'util' => [ qw(
  35. find_closes
  36. data2rfc822
  37. data2rfc822_mult
  38. get_dpkg_changes
  39. ) ] );
  40. our @EXPORT_OK = @{$EXPORT_TAGS{util}};
  41. =pod
  42. =head3 init
  43. Creates a new object instance. Takes a reference to a hash as
  44. optional argument, which is interpreted as configuration options.
  45. There are currently no supported general configuration options, but
  46. see the other methods for more specific configuration options which
  47. can also specified to C<init>.
  48. If C<infile> or C<instring> are specified (see L<parse>), C<parse()>
  49. is called from C<init>. If a fatal error is encountered during parsing
  50. (e.g. the file can't be opened), C<init> will not return a
  51. valid object but C<undef>!
  52. =cut
  53. sub init {
  54. my $classname = shift;
  55. my $config = shift || {};
  56. my $self = {};
  57. bless( $self, $classname );
  58. $config->{verbose} = 1 if $config->{debug};
  59. $self->{config} = $config;
  60. $self->reset_parse_errors;
  61. if ($self->{config}{infile} || $self->{config}{instring}) {
  62. defined($self->parse) or return undef;
  63. }
  64. return $self;
  65. }
  66. =pod
  67. =head3 reset_parse_errors
  68. Can be used to delete all information about errors ocurred during
  69. previous L<parse> runs. Note that C<parse()> also calls this method.
  70. =cut
  71. sub reset_parse_errors {
  72. my ($self) = @_;
  73. $self->{errors}{parser} = [];
  74. }
  75. sub _do_parse_error {
  76. my ($self, $file, $line_nr, $error, $line) = @_;
  77. shift;
  78. push @{$self->{errors}{parser}}, [ @_ ];
  79. unless ($self->{config}{quiet}) {
  80. if ($line) {
  81. warning("%20s(l$NR): $error\nLINE: $line", $file);
  82. } else {
  83. warning("%20s(l$NR): $error", $file);
  84. }
  85. }
  86. }
  87. =pod
  88. =head3 get_parse_errors
  89. Returns all error messages from the last L<parse> run.
  90. If called in scalar context returns a human readable
  91. string representation. If called in list context returns
  92. an array of arrays. Each of these arrays contains
  93. =over 4
  94. =item 1.
  95. the filename of the parsed file or C<String> if a string was
  96. parsed directly
  97. =item 2.
  98. the line number where the error occurred
  99. =item 3.
  100. an error description
  101. =item 4.
  102. the original line
  103. =back
  104. NOTE: This format isn't stable yet and may change in later versions
  105. of this module.
  106. =cut
  107. sub get_parse_errors {
  108. my ($self) = @_;
  109. if (wantarray) {
  110. return @{$self->{errors}{parser}};
  111. } else {
  112. my $res = "";
  113. foreach my $e (@{$self->{errors}{parser}}) {
  114. if ($e->[3]) {
  115. $res .= report(_g('warning'),_g("%s(l%s): %s\nLINE: %s"), @$e );
  116. } else {
  117. $res .= report(_g('warning'),_g("%s(l%s): %s"), @$e );
  118. }
  119. }
  120. return $res;
  121. }
  122. }
  123. sub _do_fatal_error {
  124. my ($self, $msg, @msg) = @_;
  125. $self->{errors}{fatal} = report(_g('fatal error'), $msg, @msg);
  126. warning($msg, @msg) unless $self->{config}{quiet};
  127. }
  128. =pod
  129. =head3 get_error
  130. Get the last non-parser error (e.g. the file to parse couldn't be opened).
  131. =cut
  132. sub get_error {
  133. my ($self) = @_;
  134. return $self->{errors}{fatal};
  135. }
  136. =pod
  137. =head3 data
  138. C<data> returns an array (if called in list context) or a reference
  139. to an array of Dpkg::Changelog::Entry objects which each
  140. represent one entry of the changelog.
  141. This method supports the common output options described in
  142. section L<"COMMON OUTPUT OPTIONS">.
  143. =cut
  144. sub data {
  145. my ($self, $config) = @_;
  146. my $data = $self->{data};
  147. if ($config) {
  148. $self->{config}{DATA} = $config if $config;
  149. $data = $self->_data_range( $config ) or return undef;
  150. }
  151. return @$data if wantarray;
  152. return $data;
  153. }
  154. sub __sanity_check_range {
  155. my ( $data, $from, $to, $since, $until, $start, $end ) = @_;
  156. if (($$start || $$end) && ($$from || $$since || $$to || $$until)) {
  157. warning(_g( "you can't combine 'count' or 'offset' with any other range option" ));
  158. $$from = $$since = $$to = $$until = '';
  159. }
  160. if ($$from && $$since) {
  161. warning(_g( "you can only specify one of 'from' and 'since', using 'since'" ));
  162. $$from = '';
  163. }
  164. if ($$to && $$until) {
  165. warning(_g( "you can only specify one of 'to' and 'until', using 'until'" ));
  166. $$to = '';
  167. }
  168. if ($$since && ($data->[0]{Version} eq $$since)) {
  169. warning(_g( "'since' option specifies most recent version, ignoring" ));
  170. $$since = '';
  171. }
  172. if ($$until && ($data->[$#{$data}]{Version} eq $$until)) {
  173. warning(_g( "'until' option specifies oldest version, ignoring" ));
  174. $$until = '';
  175. }
  176. $$start = 0 if $$start < 0;
  177. return if $$start > $#$data;
  178. $$end = $#$data if $$end > $#$data;
  179. return if $$end < 0;
  180. $$end = $$start if $$end < $$start;
  181. #TODO: compare versions
  182. return 1;
  183. }
  184. sub _data_range {
  185. my ($self, $config) = @_;
  186. my $data = $self->data or return undef;
  187. return [ @$data ] if $config->{all};
  188. my $since = $config->{since} || '';
  189. my $until = $config->{until} || '';
  190. my $from = $config->{from} || '';
  191. my $to = $config->{to} || '';
  192. my $count = $config->{count} || 0;
  193. my $offset = $config->{offset} || 0;
  194. return if $offset and not $count;
  195. if ($offset > 0) {
  196. $offset -= ($count < 0);
  197. } elsif ($offset < 0) {
  198. $offset = $#$data + ($count > 0) + $offset;
  199. } else {
  200. $offset = $#$data if $count < 0;
  201. }
  202. my $start = my $end = $offset;
  203. $start += $count+1 if $count < 0;
  204. $end += $count-1 if $count > 0;
  205. return unless __sanity_check_range( $data, \$from, \$to,
  206. \$since, \$until,
  207. \$start, \$end );
  208. unless ($from or $to or $since or $until or $start or $end) {
  209. return [ @$data ] if $config->{default_all} and not $count;
  210. return [ $data->[0] ];
  211. }
  212. return [ @{$data}[$start .. $end] ] if $start or $end;
  213. my @result;
  214. my $include = 1;
  215. $include = 0 if $to or $until;
  216. foreach (@$data) {
  217. my $v = $_->{Version};
  218. $include = 1 if $v eq $to;
  219. last if $v eq $since;
  220. push @result, $_ if $include;
  221. $include = 1 if $v eq $until;
  222. last if $v eq $from;
  223. }
  224. return \@result;
  225. }
  226. sub _abort_early {
  227. my ($self) = @_;
  228. my $data = $self->data or return;
  229. my $config = $self->{config} or return;
  230. # use Data::Dumper;
  231. # warn "Abort early? (\$# = $#$data)\n".Dumper($config);
  232. return if $config->{all};
  233. my $since = $config->{since} || '';
  234. my $until = $config->{until} || '';
  235. my $from = $config->{from} || '';
  236. my $to = $config->{to} || '';
  237. my $count = $config->{count} || 0;
  238. my $offset = $config->{offset} || 0;
  239. return if $offset and not $count;
  240. return if $offset < 0 or $count < 0;
  241. if ($offset > 0) {
  242. $offset -= ($count < 0);
  243. }
  244. my $start = my $end = $offset;
  245. $end += $count-1 if $count > 0;
  246. unless ($from or $to or $since or $until or $start or $end) {
  247. return if not $count;
  248. return 1 if @$data;
  249. }
  250. return 1 if ($start or $end)
  251. and $start < @$data and $end < @$data;
  252. return unless $since or $from;
  253. foreach (@$data) {
  254. my $v = $_->{Version};
  255. return 1 if $v eq $since;
  256. return 1 if $v eq $from;
  257. }
  258. return;
  259. }
  260. =pod
  261. =head3 dpkg
  262. (and B<dpkg_str>)
  263. C<dpkg> returns a hash (in list context) or a hash reference
  264. (in scalar context) where the keys are field names and the values are
  265. field values. The following fields are given:
  266. =over 4
  267. =item Source
  268. package name (in the first entry)
  269. =item Version
  270. packages' version (from first entry)
  271. =item Distribution
  272. target distribution (from first entry)
  273. =item Urgency
  274. urgency (highest of all printed entries)
  275. =item Maintainer
  276. person that created the (first) entry
  277. =item Date
  278. date of the (first) entry
  279. =item Closes
  280. bugs closed by the entry/entries, sorted by bug number
  281. =item Changes
  282. content of the the entry/entries
  283. =back
  284. C<dpkg_str> returns a stringified version of this hash. The fields are
  285. ordered like in the list above.
  286. Both methods support the common output options described in
  287. section L<"COMMON OUTPUT OPTIONS">.
  288. =head3 dpkg_str
  289. See L<dpkg>.
  290. =cut
  291. our ( %FIELDIMPS, %URGENCIES );
  292. BEGIN {
  293. my $i=100;
  294. grep($FIELDIMPS{$_}=$i--,
  295. qw(Source Version Distribution Urgency Maintainer Date Closes
  296. Changes));
  297. $i=1;
  298. grep($URGENCIES{$_}=$i++,
  299. qw(low medium high critical emergency));
  300. }
  301. sub dpkg {
  302. my ($self, $config) = @_;
  303. $self->{config}{DPKG} = $config if $config;
  304. $config = $self->{config}{DPKG} || {};
  305. my $data = $self->_data_range( $config ) or return undef;
  306. my %f;
  307. foreach my $field (qw( Urgency Source Version
  308. Distribution Maintainer Date )) {
  309. $f{$field} = $data->[0]{$field};
  310. }
  311. $f{Changes} = get_dpkg_changes( $data->[0] );
  312. $f{Closes} = [ @{$data->[0]{Closes}} ];
  313. my $first = 1; my $urg_comment = '';
  314. foreach my $entry (@$data) {
  315. $first = 0, next if $first;
  316. my $oldurg = $f{Urgency} || '';
  317. my $oldurgn = $URGENCIES{$f{Urgency}} || -1;
  318. my $newurg = $entry->{Urgency_LC} || '';
  319. my $newurgn = $URGENCIES{$entry->{Urgency_LC}} || -1;
  320. $f{Urgency} = ($newurgn > $oldurgn) ? $newurg : $oldurg;
  321. $urg_comment .= $entry->{Urgency_Comment};
  322. $f{Changes} .= "\n .".get_dpkg_changes( $entry );
  323. push @{$f{Closes}}, @{$entry->{Closes}};
  324. }
  325. $f{Closes} = join " ", sort { $a <=> $b } @{$f{Closes}};
  326. $f{Urgency} .= $urg_comment;
  327. return %f if wantarray;
  328. return \%f;
  329. }
  330. sub dpkg_str {
  331. return data2rfc822( scalar dpkg(@_), \%FIELDIMPS );
  332. }
  333. =pod
  334. =head3 rfc822
  335. (and B<rfc822_str>)
  336. C<rfc822> returns an array of hashes (in list context) or a reference
  337. to this array (in scalar context) where each hash represents one entry
  338. in the changelog. For the format of such a hash see the description
  339. of the L<"dpkg"> method (while ignoring the remarks about which
  340. values are taken from the first entry).
  341. C<rfc822_str> returns a stringified version of this array.
  342. Both methods support the common output options described in
  343. section L<"COMMON OUTPUT OPTIONS">.
  344. =head3 rfc822_str
  345. See L<rfc822>.
  346. =cut
  347. sub rfc822 {
  348. my ($self, $config) = @_;
  349. $self->{config}{RFC822} = $config if $config;
  350. $config = $self->{config}{RFC822} || {};
  351. my $data = $self->_data_range( $config ) or return undef;
  352. my @out_data;
  353. foreach my $entry (@$data) {
  354. my %f;
  355. foreach my $field (qw( Urgency Source Version
  356. Distribution Maintainer Date )) {
  357. $f{$field} = $entry->{$field};
  358. }
  359. $f{Urgency} .= $entry->{Urgency_Comment};
  360. $f{Changes} = get_dpkg_changes( $entry );
  361. $f{Closes} = join " ", sort { $a <=> $b } @{$entry->{Closes}};
  362. push @out_data, \%f;
  363. }
  364. return @out_data if wantarray;
  365. return \@out_data;
  366. }
  367. sub rfc822_str {
  368. return data2rfc822_mult( scalar rfc822(@_), \%FIELDIMPS );
  369. }
  370. =pod
  371. =head1 COMMON OUTPUT OPTIONS
  372. The following options are supported by all output methods,
  373. all take a version number as value:
  374. =over 4
  375. =item since
  376. Causes changelog information from all versions strictly
  377. later than B<version> to be used.
  378. =item until
  379. Causes changelog information from all versions strictly
  380. earlier than B<version> to be used.
  381. =item from
  382. Similar to C<since> but also includes the information for the
  383. specified B<version> itself.
  384. =item to
  385. Similar to C<until> but also includes the information for the
  386. specified B<version> itself.
  387. =back
  388. The following options also supported by all output methods but
  389. don't take version numbers as values:
  390. =over 4
  391. =item all
  392. If set to a true value, all entries of the changelog are returned,
  393. this overrides all other options.
  394. =item count
  395. Expects a signed integer as value. Returns C<value> entries from the
  396. top of the changelog if set to a positive integer, and C<abs(value)>
  397. entries from the tail if set to a negative integer.
  398. =item offset
  399. Expects a signed integer as value. Changes the starting point for
  400. C<count>, either counted from the top (positive integer) or from
  401. the tail (negative integer). C<offset> has no effect if C<count>
  402. wasn't given as well.
  403. =back
  404. Some examples for the above options. Imagine an example changelog with
  405. entries for the versions 1.2, 1.3, 2.0, 2.1, 2.2, 3.0 and 3.1.
  406. Call Included entries
  407. C<E<lt>formatE<gt>({ since =E<gt> '2.0' })> 3.1, 3.0, 2.2
  408. C<E<lt>formatE<gt>({ until =E<gt> '2.0' })> 1.3, 1.2
  409. C<E<lt>formatE<gt>({ from =E<gt> '2.0' })> 3.1, 3.0, 2.2, 2.1, 2.0
  410. C<E<lt>formatE<gt>({ to =E<gt> '2.0' })> 2.0, 1.3, 1.2
  411. C<E<lt>formatE<gt>({ count =E<gt> 2 }>> 3.1, 3.0
  412. C<E<lt>formatE<gt>({ count =E<gt> -2 }>> 1.3, 1.2
  413. C<E<lt>formatE<gt>({ count =E<gt> 3,
  414. offset=E<gt> 2 }>> 2.2, 2.1, 2.0
  415. C<E<lt>formatE<gt>({ count =E<gt> 2,
  416. offset=E<gt> -3 }>> 2.0, 1.3
  417. C<E<lt>formatE<gt>({ count =E<gt> -2,
  418. offset=E<gt> 3 }>> 3.0, 2.2
  419. C<E<lt>formatE<gt>({ count =E<gt> -2,
  420. offset=E<gt> -3 }>> 2.2, 2.1
  421. Any combination of one option of C<since> and C<from> and one of
  422. C<until> and C<to> returns the intersection of the two results
  423. with only one of the options specified.
  424. =head1 UTILITY FUNCTIONS
  425. =head3 find_closes
  426. Takes one string as argument and finds "Closes: #123456, #654321" statements
  427. as supported by the Debian Archive software in it. Returns all closed bug
  428. numbers in an array reference.
  429. =cut
  430. sub find_closes {
  431. my $changes = shift;
  432. my @closes = ();
  433. while ($changes &&
  434. ($changes =~ /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/ig)) {
  435. push(@closes, $& =~ /\#?\s?(\d+)/g);
  436. }
  437. @closes = sort { $a <=> $b } @closes;
  438. return \@closes;
  439. }
  440. =pod
  441. =head3 data2rfc822
  442. Takes two hash references as arguments. The first should contain the
  443. data to output in RFC822 format. The second can contain a sorting order
  444. for the fields. The higher the numerical value of the hash value, the
  445. earlier the field is printed if it exists.
  446. Return the data in RFC822 format as string.
  447. =cut
  448. sub data2rfc822 {
  449. my ($data, $fieldimps) = @_;
  450. my $rfc822_str = '';
  451. # based on /usr/lib/dpkg/controllib.pl
  452. for my $f (sort { $fieldimps->{$b} <=> $fieldimps->{$a} } keys %$data) {
  453. my $v= $data->{$f} or next;
  454. $v =~ m/\S/o || next; # delete whitespace-only fields
  455. $v =~ m/\n\S/o
  456. && warning(_g("field %s has newline then non whitespace >%s<"),
  457. $f, $v);
  458. $v =~ m/\n[ \t]*\n/o && warning(_g("field %s has blank lines >%s<"),
  459. $f, $v);
  460. $v =~ m/\n$/o && warning(_g("field %s has trailing newline >%s<"),
  461. $f, $v);
  462. $v =~ s/\$\{\}/\$/go;
  463. $rfc822_str .= "$f: $v\n";
  464. }
  465. return $rfc822_str;
  466. }
  467. =pod
  468. =head3 data2rfc822_mult
  469. The first argument should be an array ref to an array of hash references.
  470. The second argument is a hash reference and has the same meaning as
  471. the second argument of L<data2rfc822>.
  472. Calls L<data2rfc822> for each element of the array given as first
  473. argument and returns the concatenated results.
  474. =cut
  475. sub data2rfc822_mult {
  476. my ($data, $fieldimps) = @_;
  477. my @rfc822 = ();
  478. foreach my $entry (@$data) {
  479. push @rfc822, data2rfc822($entry,$fieldimps);
  480. }
  481. return join "\n", @rfc822;
  482. }
  483. =pod
  484. =head3 get_dpkg_changes
  485. Takes a Dpkg::Changelog::Entry object as first argument.
  486. Returns a string that is suitable for using it in a C<Changes> field
  487. in the output format of C<dpkg-parsechangelog>.
  488. =cut
  489. sub get_dpkg_changes {
  490. my $changes = "\n ".($_[0]->Header||'')."\n .\n".($_[0]->Changes||'');
  491. chomp $changes;
  492. $changes =~ s/^ $/ ./mgo;
  493. return $changes;
  494. }
  495. =head1 NAME
  496. Dpkg::Changelog::Entry - represents one entry in a Debian changelog
  497. =head1 SYNOPSIS
  498. =head1 DESCRIPTION
  499. =head2 Methods
  500. =head3 init
  501. Creates a new object, no options.
  502. =head3 new
  503. Alias for init.
  504. =head3 is_empty
  505. Checks if the object is actually initialized with data. This
  506. currently simply checks if one of the fields Source, Version,
  507. Maintainer, Date, or Changes is initalized.
  508. =head2 Accessors
  509. The following fields are available via accessor functions (all
  510. fields are string values unless otherwise noted):
  511. =over 4
  512. =item *
  513. Source
  514. =item *
  515. Version
  516. =item *
  517. Distribution
  518. =item *
  519. Urgency
  520. =item *
  521. ExtraFields (all fields except for urgency as hash)
  522. =item *
  523. Header (the whole header in verbatim form)
  524. =item *
  525. Changes (the actual content of the bug report, in verbatim form)
  526. =item *
  527. Trailer (the whole trailer in verbatim form)
  528. =item *
  529. Closes (Array of bug numbers)
  530. =item *
  531. Maintainer (name B<and> email address)
  532. =item *
  533. Date
  534. =item *
  535. Timestamp (Date expressed in seconds since the epoche)
  536. =item *
  537. ERROR (last parse error related to this entry in the format described
  538. at Dpkg::Changelog::get_parse_errors.
  539. =back
  540. =cut
  541. package Dpkg::Changelog::Entry;
  542. use base qw( Class::Accessor );
  543. Dpkg::Changelog::Entry->mk_accessors(qw( Closes Changes Maintainer
  544. MaintainerEmail Date
  545. Urgency Distribution
  546. Source Version ERROR
  547. ExtraFields Header
  548. Trailer Timestamp ));
  549. sub new {
  550. return init(@_);
  551. }
  552. sub init {
  553. my $classname = shift;
  554. my $self = {};
  555. bless( $self, $classname );
  556. return $self;
  557. }
  558. sub is_empty {
  559. my ($self) = @_;
  560. return !($self->{Changes}
  561. || $self->{Source}
  562. || $self->{Version}
  563. || $self->{Maintainer}
  564. || $self->{Date});
  565. }
  566. 1;
  567. __END__
  568. =head1 AUTHOR
  569. Frank Lichtenheld, E<lt>frank@lichtenheld.deE<gt>
  570. =head1 COPYRIGHT AND LICENSE
  571. Copyright E<copy> 2005, 2007 by Frank Lichtenheld
  572. This program is free software; you can redistribute it and/or modify
  573. it under the terms of the GNU General Public License as published by
  574. the Free Software Foundation; either version 2 of the License, or
  575. (at your option) any later version.
  576. This program is distributed in the hope that it will be useful,
  577. but WITHOUT ANY WARRANTY; without even the implied warranty of
  578. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  579. GNU General Public License for more details.
  580. You should have received a copy of the GNU General Public License
  581. along with this program; if not, write to the Free Software
  582. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  583. =cut