From da2895c06e2fdde78b0a9eec63d906b85969e987 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 25 Jan 2010 14:09:06 +0000 Subject: (find_current_distro) factor code for mcc --- mdkapplet | 2 +- mdkonline.pm | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mdkapplet b/mdkapplet index 5e477371..7af8938a 100755 --- a/mdkapplet +++ b/mdkapplet @@ -317,7 +317,7 @@ sub is_there_a_new_distributions() { return 1; } - my $current_apimdv_distro = find { $_->{version} eq $product_id->{version} } @distros; + my $current_apimdv_distro = find_current_distro(@distros); $no_more_supported = $current_apimdv_distro->{obsoleted_by}; ($extended_maintenance_url, $extended_maintenance_end) = @$current_apimdv_distro{qw(extended-maintenance extended-maintenance-end)}; if ($no_more_supported) { diff --git a/mdkonline.pm b/mdkonline.pm index e1acf383..3cf4366e 100644 --- a/mdkonline.pm +++ b/mdkonline.pm @@ -30,7 +30,8 @@ use common; use ugtk2; our @ISA = qw(Exporter); -our @EXPORT = qw(fork_exec +our @EXPORT = qw(find_current_distro + fork_exec get_banner get_distro_list get_from @@ -73,6 +74,10 @@ sub is_restricted_media_supported() { to_bool($product_id->{product} =~ /powerpack/i); } +sub find_current_distro { + find { $_->{version} eq $product_id->{version} } @_; +} + sub get_distro_list() { #- contact the following URL to retrieve the list of released distributions. my $type = lc($product_id->{type}); $type =~ s/\s//g; -- cgit v1.2.1