summaryrefslogtreecommitdiff
path: root/perl-RPM2
diff options
context:
space:
mode:
authorcturner <devnull@localhost>2002-08-08 20:48:36 +0000
committercturner <devnull@localhost>2002-08-08 20:48:36 +0000
commit8578aab9a720afac5a8c16750290f86babef6607 (patch)
treed40d56d6a02445f3d1ce1db8719dd890c0847844 /perl-RPM2
parent6106bdb3594e9236854f09b25f2c88c868799fda (diff)
downloadlibrpm-tizen-8578aab9a720afac5a8c16750290f86babef6607.tar.gz
librpm-tizen-8578aab9a720afac5a8c16750290f86babef6607.tar.bz2
librpm-tizen-8578aab9a720afac5a8c16750290f86babef6607.zip
remove some spurious warnings, clean up some ambiguities
CVS patchset: 5616 CVS date: 2002/08/08 20:48:36
Diffstat (limited to 'perl-RPM2')
-rw-r--r--perl-RPM2/RPM2.pm41
-rw-r--r--perl-RPM2/RPM2.xs11
-rw-r--r--perl-RPM2/test.pl3
3 files changed, 32 insertions, 23 deletions
diff --git a/perl-RPM2/RPM2.pm b/perl-RPM2/RPM2.pm
index 8e4931c51..28ef15f45 100644
--- a/perl-RPM2/RPM2.pm
+++ b/perl-RPM2/RPM2.pm
@@ -6,7 +6,7 @@ use DynaLoader;
use Data::Dumper;
use vars qw/$VERSION/;
-$VERSION = '0.44';
+$VERSION = '0.45';
use vars qw/@ISA/;
@ISA = qw/DynaLoader/;
@@ -14,22 +14,26 @@ bootstrap RPM2 $VERSION;
my %tagmap;
-RPM2::_init_rpm();
-RPM2::_populate_header_tags(\%tagmap);
+RPM2_C::_init_rpm();
+RPM2_C::_populate_header_tags(\%tagmap);
+
+sub rpmvercmp {
+ return RPM2_C::rpmvercmp(@_);
+}
sub add_macro {
my $class = shift;
my $name = shift;
my $val = shift;
- RPM2::_add_macro($name, $val);
+ RPM2_C::_add_macro($name, $val);
}
sub delete_macro {
my $class = shift;
my $name = shift;
- RPM2::_delete_macro($name);
+ RPM2_C::_delete_macro($name);
}
sub open_rpm_db {
@@ -39,11 +43,11 @@ sub open_rpm_db {
my $self = bless { }, $class;
if ($params{-path}) {
$class->add_macro("_dbpath", $params{-path});
- $self->{db} = RPM2::_open_rpm_db(undef, $params{-readwrite} ? 1 : 0);
+ $self->{db} = RPM2_C::_open_rpm_db($params{-readwrite} ? 1 : 0);
$class->delete_macro("_dbpath");
}
else {
- $self->{db} = RPM2::_open_rpm_db(undef, $params{-readwrite} ? 1 : 0);
+ $self->{db} = RPM2_C::_open_rpm_db($params{-readwrite} ? 1 : 0);
}
return $self;
@@ -56,7 +60,7 @@ sub open_package {
open FH, "<$file"
or die "Can't open $file: $!";
- my $hdr = RPM2::_read_package_info(*FH);
+ my $hdr = RPM2_C::_read_package_info(*FH);
close FH;
$hdr = RPM2::Header->_new_raw($hdr, 1);
@@ -68,7 +72,7 @@ sub close_rpm_db {
my $self = shift;
die "db not open" unless $self->{db};
- RPM2::_close_rpm_db($self->{db});
+ RPM2_C::_close_rpm_db($self->{db});
$self->{db} = undef;
}
@@ -182,14 +186,14 @@ sub tag {
die "tag $tag invalid"
unless exists $tagmap{$tag};
- return RPM2::_header_tag($self->{header}, $tagmap{$tag});
+ return RPM2_C::_header_tag($self->{header}, $tagmap{$tag});
}
sub compare {
my $h1 = shift;
my $h2 = shift;
- return RPM2::_header_compare($h1->{header}, $h2->{header});
+ return RPM2_C::_header_compare($h1->{header}, $h2->{header});
}
sub op_bool {
@@ -213,7 +217,7 @@ sub op_spaceship {
sub is_source_package {
my $self = shift;
- return RPM2::_header_is_source($self->{header});
+ return RPM2_C::_header_is_source($self->{header});
}
sub as_nvre {
@@ -271,7 +275,7 @@ sub DESTROY {
my $self = shift;
if ($self->{need_free}) {
- RPM2::_free_header(delete $self->{header});
+ RPM2_C::_free_header(delete $self->{header});
}
}
@@ -283,8 +287,8 @@ sub new_iterator {
my $tag = shift;
my $key = shift;
- my $self = bless {}, $class;
- $self->{iter} = RPM2::_init_iterator($db, $tagmap{$tag}, $key, defined $key ? length $key : 0);
+ my $self = bless { }, $class;
+ $self->{iter} = RPM2_C::_init_iterator($db, $tagmap{$tag}, $key || "", defined $key ? length $key : 0);
$self->{db} = $db;
return $self;
@@ -295,10 +299,11 @@ sub next {
return unless $self->{iter};
- my $hdr = RPM2::_iterator_next($self->{iter});
+ my $hdr = RPM2_C::_iterator_next($self->{iter});
return unless $hdr;
- return RPM2::Header->_new_raw($hdr, 1);
+ my $ret = RPM2::Header->_new_raw($hdr, 1);
+ return $ret;
}
sub expand_iter {
@@ -316,7 +321,7 @@ sub DESTROY {
my $self = shift;
if ($self->{iter}) {
- RPM2::_destroy_iter($self->{iter});
+ RPM2_C::_destroy_iterator($self->{iter});
}
}
diff --git a/perl-RPM2/RPM2.xs b/perl-RPM2/RPM2.xs
index c9818979b..eebb6ee7c 100644
--- a/perl-RPM2/RPM2.xs
+++ b/perl-RPM2/RPM2.xs
@@ -13,8 +13,10 @@
#include "perl.h"
#include "XSUB.h"
-const char *CLASS = "RPM2";
-MODULE = RPM2 PACKAGE = RPM2
+const char *CLASS = "RPM2_C";
+MODULE = RPM2 PACKAGE = RPM2_C
+
+PROTOTYPES: ENABLE
int
rpmvercmp(one, two)
@@ -46,13 +48,12 @@ _close_rpm_db(db)
rpmdbClose(db);
rpmdb
-_open_rpm_db(path,for_write)
- char *path
+_open_rpm_db(for_write)
int for_write
PREINIT:
rpmdb db;
CODE:
- if (rpmdbOpen(path, &db, for_write ? O_RDWR | O_CREAT : O_RDONLY, 0644)) {
+ if (rpmdbOpen(NULL, &db, for_write ? O_RDWR | O_CREAT : O_RDONLY, 0644)) {
croak("rpmdbOpen failed");
RETVAL = NULL;
}
diff --git a/perl-RPM2/test.pl b/perl-RPM2/test.pl
index 4ea798782..6d8c05dc2 100644
--- a/perl-RPM2/test.pl
+++ b/perl-RPM2/test.pl
@@ -1,3 +1,6 @@
+#!/usr/bin/perl -w
+use strict;
+
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'