diff options
author | cturner <devnull@localhost> | 2003-12-08 21:36:50 +0000 |
---|---|---|
committer | cturner <devnull@localhost> | 2003-12-08 21:36:50 +0000 |
commit | 6517cd197971687e4e3ae0452b5da1d48772acbd (patch) | |
tree | 353f9799a6417025950577157abc3968b56c428b /perl-RPM2/RPM2.pm | |
parent | 5e20d90422cb49d77248a11711ada17f28bf32de (diff) | |
download | librpm-tizen-6517cd197971687e4e3ae0452b5da1d48772acbd.tar.gz librpm-tizen-6517cd197971687e4e3ae0452b5da1d48772acbd.tar.bz2 librpm-tizen-6517cd197971687e4e3ae0452b5da1d48772acbd.zip |
add bindings and test case to load hdlist files like the python bindings
CVS patchset: 6965
CVS date: 2003/12/08 21:36:50
Diffstat (limited to 'perl-RPM2/RPM2.pm')
-rw-r--r-- | perl-RPM2/RPM2.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/perl-RPM2/RPM2.pm b/perl-RPM2/RPM2.pm index 76bbd734f..282dbdc8e 100644 --- a/perl-RPM2/RPM2.pm +++ b/perl-RPM2/RPM2.pm @@ -9,7 +9,7 @@ use File::Basename; use File::Spec; use vars qw/$VERSION/; -$VERSION = '0.63'; +$VERSION = '0.64'; use vars qw/@ISA/; @ISA = qw/DynaLoader/; @@ -51,6 +51,25 @@ sub open_rpm_db { return $self; } +sub open_hdlist { + my $class = shift; + my $file = shift; + + open FH, "<$file" + or die "Can't open $file: $!"; + + my @ret; + while (1) { + my ($hdr) = RPM2::_read_from_file(*FH); + last unless $hdr; + + push @ret, RPM2::Header->_new_raw($hdr); + } + + close FH; + return @ret; +} + sub open_package { my $class = shift; my $file = shift; |