aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Signature.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-06-14 10:08:24 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-06-14 10:08:24 +0000
commit18803273406f44b561861a44ba81bca762b31335 (patch)
tree4ea7acf553d9829ab78ae1911ebd1373ec90d224 /URPM/Signature.pm
parenta2fa45ec703832c48618f5828d883b8655bec090 (diff)
downloadperl-URPM-18803273406f44b561861a44ba81bca762b31335.tar
perl-URPM-18803273406f44b561861a44ba81bca762b31335.tar.gz
perl-URPM-18803273406f44b561861a44ba81bca762b31335.tar.bz2
perl-URPM-18803273406f44b561861a44ba81bca762b31335.tar.xz
perl-URPM-18803273406f44b561861a44ba81bca762b31335.zip
Verify if we can open the rpmdb, and abort if we can't (bug #22527)
Diffstat (limited to 'URPM/Signature.pm')
-rw-r--r--URPM/Signature.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/URPM/Signature.pm b/URPM/Signature.pm
index 6831680..0e9edd8 100644
--- a/URPM/Signature.pm
+++ b/URPM/Signature.pm
@@ -64,7 +64,8 @@ sub parse_pubkeys {
my ($block, $content);
my $db = $options{db};
- $db ||= URPM::DB::open($options{root});
+ $db ||= URPM::DB::open($options{root})
+ or die "Can't open RPM DB, aborting\n";
$db->traverse_tag('name', [ 'gpg-pubkey' ], sub {
my ($p) = @_;
@@ -97,7 +98,8 @@ sub import_needed_pubkeys {
#- use the same database handle to avoid re-opening multiple times the database.
my $db = $options{db};
- $db ||= URPM::DB::open($options{root}, 1);
+ $db ||= URPM::DB::open($options{root}, 1)
+ or die "Can't open RPM DB, aborting\n";
#- assume $l is a reference to an array containing all the keys to import
#- if needed.