aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-06 08:51:23 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-06 08:51:23 +0000
commit84c77ae394dfba1ee400976e934abafb38d2b898 (patch)
treebdb79f9b001365551bf2f21d9e57d43af7b05b07
parent743f1486beffe8408dfb79f86eac426274ce0c7a (diff)
downloadrpmdrake-84c77ae394dfba1ee400976e934abafb38d2b898.tar
rpmdrake-84c77ae394dfba1ee400976e934abafb38d2b898.tar.gz
rpmdrake-84c77ae394dfba1ee400976e934abafb38d2b898.tar.bz2
rpmdrake-84c77ae394dfba1ee400976e934abafb38d2b898.tar.xz
rpmdrake-84c77ae394dfba1ee400976e934abafb38d2b898.zip
More runtime safety -- don't crash against corrupted rpmdbs.
-rwxr-xr-xrpmdrake12
1 files changed, 10 insertions, 2 deletions
diff --git a/rpmdrake b/rpmdrake
index d2113ff2..bcd6bb22 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -228,8 +228,16 @@ sub myformatList {
}
sub split_fullname { $_[0] =~ /^(.*)-([^-]+-[^-]+)$/ }
-sub my_fullname { my ($name, $version, $release) = $_[0]->fullname; "$name-$version-$release" }
-sub urpm_name { my ($name, $version, $release, $arch) = $_[0]->fullname; "$name-$version-$release.$arch" }
+sub my_fullname {
+ return '?-?-?' unless ref $_[0];
+ my ($name, $version, $release) = $_[0]->fullname;
+ "$name-$version-$release";
+}
+sub urpm_name {
+ return '?-?-?.?' unless ref $_[0];
+ my ($name, $version, $release, $arch) = $_[0]->fullname;
+ "$name-$version-$release.$arch";
+}
sub parse_compssUsers_flat {
my (%compssUsers, $category);