diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-12-06 08:51:23 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-12-06 08:51:23 +0000 |
commit | 84c77ae394dfba1ee400976e934abafb38d2b898 (patch) | |
tree | bdb79f9b001365551bf2f21d9e57d43af7b05b07 | |
parent | 743f1486beffe8408dfb79f86eac426274ce0c7a (diff) | |
download | rpmdrake-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-x | rpmdrake | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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); |