home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / perl5 / Parse / DebianChangelog / Entry.pm < prev    next >
Encoding:
Perl POD Document  |  2009-02-17  |  3.5 KB  |  176 lines

  1. #
  2. # Parse::DebianChangelog::Entry
  3. #
  4. # Copyright 2005 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.  
  21. =head1 NAME
  22.  
  23. Parse::DebianChangelog::Entry - represents one entry in a Debian changelog
  24.  
  25. =head1 SYNOPSIS
  26.  
  27. =head1 DESCRIPTION
  28.  
  29. =head2 Methods
  30.  
  31. =head3 init
  32.  
  33. Creates a new object, no options.
  34.  
  35. =head3 new
  36.  
  37. Alias for init.
  38.  
  39. =head3 is_empty
  40.  
  41. Checks if the object is actually initialized with data. Due to limitations
  42. in Parse::DebianChangelog this currently simply checks if one of the
  43. fields Source, Version, Maintainer, Date, or Changes is initalized.
  44.  
  45. =head2 Accessors
  46.  
  47. The following fields are available via accessor functions (all
  48. fields are string values unless otherwise noted):
  49.  
  50. =over 4
  51.  
  52. =item *
  53.  
  54. Source
  55.  
  56. =item *
  57.  
  58. Version
  59.  
  60. =item *
  61.  
  62. Distribution
  63.  
  64. =item *
  65.  
  66. Urgency
  67.  
  68. =item *
  69.  
  70. ExtraFields (all fields except for urgency as hash)
  71.  
  72. =item *
  73.  
  74. Header (the whole header in verbatim form)
  75.  
  76. =item *
  77.  
  78. Changes (the actual content of the bug report, in verbatim form)
  79.  
  80. =item *
  81.  
  82. Trailer (the whole trailer in verbatim form)
  83.  
  84. =item *
  85.  
  86. Closes (Array of bug numbers)
  87.  
  88. =item *
  89.  
  90. Maintainer (name B<and> email address)
  91.  
  92. =item *
  93.  
  94. Date
  95.  
  96. =item *
  97.  
  98. Timestamp (Date expressed in seconds since the epoche)
  99.  
  100. =item *
  101.  
  102. ERROR (last parse error related to this entry in the format described
  103. at Parse::DebianChangelog::get_parse_errors.
  104.  
  105. =back
  106.  
  107. =cut
  108.  
  109. package Parse::DebianChangelog::Entry;
  110.  
  111. use strict;
  112. use warnings;
  113.  
  114. use base qw( Class::Accessor );
  115. use Parse::DebianChangelog::Util qw( :all );
  116.  
  117. Parse::DebianChangelog::Entry->mk_accessors(qw( Closes Changes Maintainer
  118.                         MaintainerEmail Date
  119.                         Urgency Distribution
  120.                         Source Version ERROR
  121.                         ExtraFields Header
  122.                         Trailer Timestamp ));
  123.  
  124. sub new {
  125.     return init(@_);
  126. }
  127.  
  128. sub init {
  129.     my $classname = shift;
  130.     my $self = {};
  131.     bless( $self, $classname );
  132.  
  133.     return $self;
  134. }
  135.  
  136. sub is_empty {
  137.     my ($self) = @_;
  138.  
  139.     return !($self->{Changes}
  140.          || $self->{Source}
  141.          || $self->{Version}
  142.          || $self->{Maintainer}
  143.          || $self->{Date});
  144. }
  145.  
  146. 1;
  147. __END__
  148.  
  149. =head1 SEE ALSO
  150.  
  151. Parse::DebianChangelog
  152.  
  153. =head1 AUTHOR
  154.  
  155. Frank Lichtenheld, E<lt>frank@lichtenheld.deE<gt>
  156.  
  157. =head1 COPYRIGHT AND LICENSE
  158.  
  159. Copyright (C) 2005 by Frank Lichtenheld
  160.  
  161. This program is free software; you can redistribute it and/or modify
  162. it under the terms of the GNU General Public License as published by
  163. the Free Software Foundation; either version 2 of the License, or
  164. (at your option) any later version.
  165.  
  166. This program is distributed in the hope that it will be useful,
  167. but WITHOUT ANY WARRANTY; without even the implied warranty of
  168. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  169. GNU General Public License for more details.
  170.  
  171. You should have received a copy of the GNU General Public License
  172. along with this program; if not, write to the Free Software
  173. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  174.  
  175. =cut
  176.