aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-04-03 14:48:17 +0000
committerThierry Vignaud <tv@mandriva.org>2007-04-03 14:48:17 +0000
commitd18b388714eeda3857c18d0194f305d55922820b (patch)
tree29e4510b793f756b5fbdfe2755edbbc4bec76aef /Rpmdrake
parent62e89cc0c01d10198a274f2ea3d49fd0e40de425 (diff)
downloadrpmdrake-d18b388714eeda3857c18d0194f305d55922820b.tar
rpmdrake-d18b388714eeda3857c18d0194f305d55922820b.tar.gz
rpmdrake-d18b388714eeda3857c18d0194f305d55922820b.tar.bz2
rpmdrake-d18b388714eeda3857c18d0194f305d55922820b.tar.xz
rpmdrake-d18b388714eeda3857c18d0194f305d55922820b.zip
(format_pkg_simplifiedinfo) fix error message when looking at a
package when there's no medium (eg: One)
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/gui.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index be6519f5..867dc0d4 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -70,7 +70,8 @@ sub compute_main_window_size {
sub format_pkg_simplifiedinfo {
my ($pkgs, $key, $urpm, $descriptions) = @_;
my ($name, $version) = split_fullname($key);
- my $medium = pkg2medium($pkgs->{$key}{pkg}, $urpm)->{name};
+ my $raw_medium = pkg2medium($pkgs->{$key}{pkg}, $urpm);
+ my $medium = $raw_medium->{name} if $raw_medium;
my $update_descr = $pkgs->{$key}{pkg}->flag_upgrade && $descriptions->{$name}{pre} && $descriptions->{$name}{medium} eq $medium;
my $s = ugtk2::markup_to_TextView_format(join("\n", format_header($name . ' - ' . translate($pkgs->{$key}{summary})) .
# workaround gtk+ bug where GtkTextView wronly limit embedded widget size to bigger line's width (#25533):
@@ -96,13 +97,14 @@ sub format_pkg_simplifiedinfo {
gtknew('TextView', text => ugtk2::markup_to_TextView_format(
join("\n",
format_field(N("Version: ")) . $version,
+
($pkgs->{$key}{pkg}->flag_installed ?
- format_field(N("Currently installed version: ")) . find_installed_version($pkgs->{$key}{pkg})
+ format_field(N("Currently installed version: ")) . eval { find_installed_version($pkgs->{$key}{pkg}) }
: ()
),
format_field(N("Architecture: ")) . $pkgs->{$key}{pkg}->arch,
format_field(N("Size: ")) . N("%s KB", int($pkgs->{$key}{pkg}->size/1024)),
- format_field(N("Medium: ")) . pkg2medium($pkgs->{$key}{pkg}, $urpm)->{name},
+ eval { format_field(N("Medium: ")) . pkg2medium($pkgs->{$key}{pkg}, $urpm)->{name} },
),
),
)) ];