aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs2
-rw-r--r--t/parse.t14
2 files changed, 14 insertions, 2 deletions
diff --git a/URPM.xs b/URPM.xs
index 3542f15..c5e8b10 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3077,7 +3077,7 @@ Urpm_parse_hdlist__XS(urpm, filename, ...)
HV *provides = fprovides && SvROK(*fprovides) && SvTYPE(SvRV(*fprovides)) == SVt_PVHV ? (HV*)SvRV(*fprovides) : NULL;
if (depslist != NULL) {
- pid_t pid;
+ pid_t pid = 0;
int d;
int empty_archive = 0;
FD_t fd;
diff --git a/t/parse.t b/t/parse.t
index 61d8bfe..d62b34f 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 29;
+use Test::More tests => 35;
use MDV::Packdrakeng;
use URPM;
use URPM::Build;
@@ -44,6 +44,7 @@ ok(-f 'hdlist.cz');
my $b = new URPM;
($start, $end) = $b->parse_hdlist('hdlist.cz', keep_all_tags => 1);
+is("$start $end", "0 0", 'parse_hdlist');
ok(@{$b->{depslist}} == 1);
$pkg = $b->{depslist}[0];
ok($pkg);
@@ -53,6 +54,17 @@ is($pkg->get_tag(1002), '1mdk', 'release');
is($pkg->queryformat("%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}"), "test-rpm-1.0-1mdk.noarch",
q/get headers from hdlist/);
+my $headers = eval { [ $b->parse_rpms_build_headers(rpms => [ "t/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ],
+ dir => 't/headers') ] };
+is($@, '', 'parse_rpms_build_headers');
+is(int @$headers, 1, 'parse_rpms_build_headers');
+ok(@{$b->{depslist}} == 2);
+($start, $end) = eval { $b->parse_headers(dir => "t/headers", headers => $headers) };
+is($@, '', 'parse_headers');
+is("$start $end", "2 2", 'parse_headers');
+
+
+
# Version comparison
ok(URPM::rpmvercmp("1-1mdk", "1-1mdk") == 0, "Same value = 0");
ok(URPM::rpmvercmp("0:1-1mdk", "1-1mdk") == -1, "Same value, epoch 0 on left = 1");