aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2004-01-18 02:25:12 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2004-01-18 02:25:12 +0000
commitbb16bf4a39539c2fec0077919f21918626b74c1f (patch)
treee1c2e7710352c9d892a4800caea9aad4b7878a1a
parent09405dda232f82fba94e6847ce2066d174456e0a (diff)
downloadperl-URPM-bb16bf4a39539c2fec0077919f21918626b74c1f.tar
perl-URPM-bb16bf4a39539c2fec0077919f21918626b74c1f.tar.gz
perl-URPM-bb16bf4a39539c2fec0077919f21918626b74c1f.tar.bz2
perl-URPM-bb16bf4a39539c2fec0077919f21918626b74c1f.tar.xz
perl-URPM-bb16bf4a39539c2fec0077919f21918626b74c1f.zip
- parse_rpm_build_headers have same behaviour with dontdie and callback
when using cache or the rpm
-rw-r--r--URPM/Build.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm
index 2bd6aca..0282c8b 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -42,8 +42,16 @@ sub parse_rpms_build_headers {
if ($cache{$key} && $cache{$key}{time} > 0 && $cache{$key}{time} >= (stat $_)[9]) {
($id, undef) = $urpm->parse_hdlist("$dir/$cache{$key}{file}", !$options{callback});
- defined $id or die "bad header $dir/$cache{$key}{file}\n";
- $options{callback} and $options{callback}->($urpm, $id, %options);
+ unless (defined $id) {
+ if ($options{dontdie}) {
+ print STDERR "bad header $dir/$cache{$key}{file}\n";
+ next;
+ } else {
+ die "bad header $dir/$cache{$key}{file}\n";
+ }
+ }
+
+ $options{callback} and $options{callback}->($urpm, $id, %options, (file => $_));
$filename = $cache{$key}{file};
} else {
@@ -56,6 +64,7 @@ sub parse_rpms_build_headers {
die "bad rpm $_\n";
}
}
+
my $pkg = $urpm->{depslist}[$id];