diff options
Diffstat (limited to 'mgaapplet-upgrade-helper')
-rwxr-xr-x | mgaapplet-upgrade-helper | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/mgaapplet-upgrade-helper b/mgaapplet-upgrade-helper index c9b8bad6..1089a805 100755 --- a/mgaapplet-upgrade-helper +++ b/mgaapplet-upgrade-helper @@ -159,87 +159,6 @@ sub create_upgrade_succeeded_window() { return $w; } -# Returns: undef if failed to authenticate, [$email, $passwd] otherwise -sub powerpack_auth_callback { - my ($email, $passwd) = @_; - my $profile = mgaonline::get_my_mdv_profile($email, $passwd); - - # Checking for profile retrieving errors... - if ($profile->{code} != 0) { - my $in = interactive->vnew; - $in->ask_warn(N("Error"), - N("An error occurred") . "\n" . $profile->{message}); - return; - } - - # Checking rights to powerpack media... - # - # level 2 => mandriva group - # level 6 => powerpack subscriber group - # data.families => acces to especific version if matches - # powerpack-VERSION - # - my $level = $profile->{data}{club}{level}; - if ($level == 2 || $level == 6) { - return [$email, $passwd]; - } - elsif ($profile->{data}{families} =~ /powerpack-$new_distro_version/i) { - return [$email, $passwd]; - } - else { - mgaapplet_gui::run_no_rights_dialog( - N("Powerpack Media Configuration"), - N("You current Mageia account does not have Powerpack subscription enabled."), - 'http://www.mageia.org', - ); - return; - } -} - -sub try_to_add_powerpack_media() { - my $is_powerpack = mgaonline::is_restricted_media_supported(); - my $auth_info; - - # Validating current product for offering powerpack medias... - - if ($is_powerpack) { - # Verifying rights of current powerpack users... - my $title = N("Powerpack Media Configuration"); - my $description = N("Please fill your My.Mageia login and password to add additional package media for Powerpack."); - - # If no rights @auth_info == ()... - $auth_info = run_ask_credentials_dialog( - $title, - $description, - \&powerpack_auth_callback, - ); - } - elsif ($product_id->{product} !~ /flash|free|one/i) { - return; # don't offer pwp for any other product - } - - my $choice; # will be 'powerpack', 'free' or undef - while ($auth_info - || ($choice = mgaapplet_gui::open_ask_powerpack_dialog( - $product_id->{product}, - $new_distro_version))) { - $auth_info and return $auth_info; - - # Get the new authentication info from user... - my $title = N("Powerpack Media Configuration"); - my $description = N("Please fill your account ID to add Powerpack %s version packages media once you have subscribed online", - $new_distro_version); - $auth_info = run_ask_credentials_dialog( - $title, - $description, - \&powerpack_auth_callback, - top_extra => $mgaapplet_gui::powerpack_ad, - ); - } - defined $choice or exit 0; # means user has canceled upgrade - return; -} - sub upgrade() { my $xid = gtkroot()->XWINDOW; @@ -273,13 +192,6 @@ packages as well?).")) touch(get_stale_upgrade_filename()); - # disabled for mageia, should be cleaned - #log::explanations( - # "checking if restricted (powerpack) media is to be addded"); - # add_pwp_auth != undef, means user asked for pwp with good credentials - #my $add_pwp_auth = try_to_add_powerpack_media(); - my $add_pwp_auth; - log::explanations("removing all existing urpmi media for upgrade"); run_program::run('urpmi.removemedia', if_($root, '--urpmi-root', $root), '-a'); @@ -313,31 +225,6 @@ packages as well?).")) exit(2); }; - if ($add_pwp_auth) { - log::explanations("adding restricted (powerpack) media"); - - my ($email, $passwd) = @$add_pwp_auth; - unless (mgaonline::add_medium_powerpack( - $email, - $passwd, - $new_distro_version, - urpm::cfg::get_arch() - )) { - # FIXME Don't replicate code like this! - log::explanations("adding media for new distribution failed"); - rm_rf(get_stale_upgrade_filename()); - log::explanations("restoringing urpmi configuration from $file"); - cp_af($file, "$root/etc/urpmi/urpmi.cfg"); - update_media(); - ugtk2::ask_warn(N("Error"), - N("Installation failed"), - N("Failed to add powerpack restricted medium"), - ); - exit(2); - } - # Media was added, update it and move along... - update_media(); - } log::explanations("upgrading urpmi and rpmdrake"); log::explanations("upgrading the whole system"); |