diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-12-13 17:35:19 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-12-13 17:35:19 +0100 |
commit | 0317129db4a4b230389e9ce23eca0a9be1ddcd2f (patch) | |
tree | 20213ef8e4bb2fb04cae58bdbc54c24dd1dcc8b4 /lib | |
parent | 2e703b9b4a0ca010f997f85a5abe9df9263b1f60 (diff) | |
download | colin-keep-0317129db4a4b230389e9ce23eca0a9be1ddcd2f.tar colin-keep-0317129db4a4b230389e9ce23eca0a9be1ddcd2f.tar.gz colin-keep-0317129db4a4b230389e9ce23eca0a9be1ddcd2f.tar.bz2 colin-keep-0317129db4a4b230389e9ce23eca0a9be1ddcd2f.tar.xz colin-keep-0317129db4a4b230389e9ce23eca0a9be1ddcd2f.zip |
fixed adding mirror functions, broken after drakx common.pm clean up
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm | 1 | ||||
-rw-r--r-- | lib/AdminPanel/rpmdragora.pm | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm index 7ea1d93..359a16e 100644 --- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm +++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm @@ -28,6 +28,7 @@ use strict; use File::ShareDir ':ALL'; use File::HomeDir qw(home); +use MDK::Common::Func qw(if_ each_index); use MDK::Common::Math qw(max); use MDK::Common::File qw(cat_ output); use MDK::Common::DataStructure qw(member put_in_hash uniq); diff --git a/lib/AdminPanel/rpmdragora.pm b/lib/AdminPanel/rpmdragora.pm index c82c503..0bb4a58 100644 --- a/lib/AdminPanel/rpmdragora.pm +++ b/lib/AdminPanel/rpmdragora.pm @@ -34,9 +34,13 @@ use urpm::download (); use urpm::prompt; use urpm::media; +# quick fix for mirror.pm +use lib qw(/usr/lib/libDrakX); + use MDK::Common; use MDK::Common::System; use MDK::Common::String; +use MDK::Common::Func; use MDK::Common::File qw(basename cat_ output); use URPM; use URPM::Resolve; @@ -707,7 +711,7 @@ sub update_sources_check { update_sources($urpm, %$options, noclean => 1, medialist => \@media); fatal_error: if (@error_msgs) { - interactive_msg($loc->N("Error"), translate($error_msg, join("\n", map { formatAlaTeX($_) } @error_msgs)), scroll => 1); + interactive_msg($loc->N("Error"), $loc->N($error_msg, join("\n", map { formatAlaTeX($_) } @error_msgs)), scroll => 1); return 0; } return 1; @@ -1065,7 +1069,7 @@ sub mirrors { my $file = $url; $file =~ s!.*/!$cachedir/!; unlink $file; # prevent "partial file" errors - before_leaving(sub { unlink $file }); + MDK::Common::Func::before_leaving(sub { unlink $file }); my ($gurpm, $id, $canceled); # display a message in statusbar (if availlable): @@ -1074,7 +1078,7 @@ sub mirrors { ? $loc->N("Please wait, downloading mirror addresses.") : $loc->N("Please wait, downloading mirror addresses from the Mageia website."), 0); - my $_clean_guard = before_leaving { + my $_clean_guard = MDK::Common::Func::before_leaving { undef $gurpm; $id and statusbar_msg_remove($id); }; @@ -1113,7 +1117,7 @@ sub mirrors { } $mirror->{goodness} = $goodness + rand(); - $mirror->{country} = $u2l{lc($mirror->{country})} ? translate($u2l{lc($mirror->{country})}) : $mirror->{country}; + $mirror->{country} = $u2l{lc($mirror->{country})} ? $loc->N($u2l{lc($mirror->{country})}) : $mirror->{country}; } unless (-x '/usr/bin/rsync') { @mirrors = grep { $_->{url} !~ /^rsync:/ } @mirrors; |