diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-09-06 17:29:00 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-09-06 17:29:00 +0000 |
commit | ac30a583ee0c8686df23a8923b25537a9817fdcb (patch) | |
tree | 9bfdb66ff69810a5c13009031085b98570531ff6 | |
parent | 8fca0c38d4cb54ecca849d8ecc6d15aec6b81dd6 (diff) | |
download | mgaonline-ac30a583ee0c8686df23a8923b25537a9817fdcb.tar mgaonline-ac30a583ee0c8686df23a8923b25537a9817fdcb.tar.gz mgaonline-ac30a583ee0c8686df23a8923b25537a9817fdcb.tar.bz2 mgaonline-ac30a583ee0c8686df23a8923b25537a9817fdcb.tar.xz mgaonline-ac30a583ee0c8686df23a8923b25537a9817fdcb.zip |
drop support for extended maintenance
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | mgaapplet | 87 | ||||
-rwxr-xr-x | mgaapplet-add-media-helper | 235 | ||||
-rw-r--r-- | mgaonline.pm | 20 | ||||
-rw-r--r-- | po/POTFILES.in | 1 |
6 files changed, 8 insertions, 338 deletions
@@ -55,7 +55,7 @@ install: all mkdir -p $(PREFIX)/etc/pam.d install -m644 pam.d_urpmi.update $(PREFIX)/etc/pam.d/urpmi.update ln -sf consolehelper $(PREFIX)/usr/bin/urpmi.update - for i in mgaapplet-config mgaapplet-add-media-helper mgaapplet-upgrade-helper; do \ + for i in mgaapplet-config mgaapplet-upgrade-helper; do \ install -m755 $$i $(SBINDIR); \ ln -sf consolehelper $(PREFIX)/usr/bin/$$i; \ done @@ -1,4 +1,5 @@ - drop support for Enterprise & PowerPack media (mga#6292) +- drop support for extended maintenance Version 2.78 - 31 August 2012, Thierry Vignaud @@ -107,12 +107,6 @@ my %state = ( urgency => 'low', tt => [] }, - extended_support_is_enabled => { - colour => [ 'okay' ], - menu => [ 'check' ], - urgency => 'low', - tt => [] - }, disconnected => { colour => [ 'disconnect' ], menu => [ 'confNetwork' ], @@ -140,11 +134,6 @@ my %state = ( menu => [], tt => [ N_("Release not supported (too old release, or development release)") ] }, - end_of_extended_support => { - colour => [ 'disabled' ], - menu => [], - tt => [ get_obsolete_message_() ] - }, no_update_medium => { colour => [ 'noconf' ], menu => [ 'check' ], @@ -243,7 +232,7 @@ my ($download_dir, $download_all); $download_dir = $temp_urpm->{cachedir}; } -my ($new_distro, $no_more_supported, $extended_maintenance_url, $extended_maintenance_end); +my ($new_distro, $no_more_supported); my ($current_apimdv_distro); get_product_id(); @@ -274,13 +263,6 @@ Gtk2->main; ugtk2::exit(0); -sub is_extended_support_not_ended() { - return if !is_extmaint_supported(); - require POSIX; - my $d = POSIX::strftime("%G%m%d", localtime(time())); - $d < $extended_maintenance_end; -} - sub is_there_a_new_distributions() { # sanity check for cooker/cauldron: @@ -305,17 +287,12 @@ sub is_there_a_new_distributions() { } $current_apimdv_distro = find_current_distro(@distros); - $no_more_supported = $current_apimdv_distro->{obsoleted_by} if !is_extmaint_supported(); - ($extended_maintenance_url, $extended_maintenance_end) = @$current_apimdv_distro{qw(extended-maintenance extended-maintenance-end)}; + $no_more_supported = $current_apimdv_distro->{obsoleted_by}; refresh_no_more_supported_msg(); if ($no_more_supported) { $new_distro = find { $_->{version} eq $no_more_supported } @distros; - return if is_extended_support_not_ended(); } - # no if we're using the extended maintenance: - return if is_extended_support_not_ended(); - if ($new_distribution && $new_distribution->{version} ne $product_id->{version}) { $new_distro = $new_distribution; log::explanations(sprintf("new '%s' distribution was released on %s", $new_distro->{version}, $new_distro->{release_date})); @@ -330,8 +307,6 @@ my ($mdv_update_pid, $checker_pid, $media_manager_pid, $locked_count); sub clean_distro_cache() { undef $new_distro; undef $no_more_supported; - undef $extended_maintenance_url; - undef $extended_maintenance_end; } sub is_false { @@ -355,20 +330,8 @@ sub process_state { if (!member($sub_state, qw(okay))) { go2State($sub_state); } elsif ($no_more_supported - && !text2bool($local_config{DO_NOT_ASK_FOR_NO_MORE_SUPPORTED}) - && !text2bool($config{EXTENDED_SUPPORT}) - && !text2bool($local_config{EXTENDED_SUPPORT_OFFERED})) { + && !text2bool($local_config{DO_NOT_ASK_FOR_NO_MORE_SUPPORTED})) { go2State('no_more_supported'); - } elsif ($current_apimdv_distro->{obsoleted_by} && text2bool($config{EXTENDED_SUPPORT}) - && is_extmaint_supported() - && !text2bool($local_config{EXTENDED_SUPPORT_SPLASHED})) { - $state{extended_support_is_enabled}{tt}[0] = - N("Basic maintenance for this distribution has expired. Thanks to your subscription to extended maintenance, your system will be kept up to date until %s", iso8601_date_to_locale($extended_maintenance_end)); - go2State('extended_support_is_enabled'); - setVar('EXTENDED_SUPPORT_SPLASHED', bool2yesno(1)); - # FIXME: just drop this state once upgrade from 2009.0 has been tested: - } elsif (is_extmaint_supported() && !is_extended_support_not_ended()) { - go2State('end_of_extended_support'); } elsif ($new_distro && is_false($config{DO_NOT_ASK_FOR_DISTRO_UPGRADE}) && is_false($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE})) { go2State('new_distribution'); @@ -488,19 +451,7 @@ sub get_obsolete_message() { sub refresh_no_more_supported_msg() { my $basic_msg = get_obsolete_message_(); my $distro = N("Mageia"); - my $msg; - - # is extended maintenance available? - if ($extended_maintenance_url) { - if ($no_more_supported eq 'none') { - $msg = N("You should get extended maintenance."); - } else { - $msg = N("You should either get extended maintenance or upgrade to a newer version of the %s distribution.", - $distro); - } - } else { - $msg = N("You should upgrade to a newer version of the %s distribution.", $distro); - } + my $msg = N("You should upgrade to a newer version of the %s distribution.", $distro); $state{no_more_supported}{tt}[0] = join(' ', $basic_msg, $msg); } @@ -511,25 +462,12 @@ sub no_more_supported_choice() { local $mgaapplet_gui::width = 580; my $w = new_portable_dialog(N("Your distribution is no longer supported")); my ($b1, $b2); - my $choice = $extended_maintenance_url ? 'extended' : ($no_more_supported ne 'none' ? 'upgrade' : undef); + my $choice = $no_more_supported ne 'none' ? 'upgrade' : undef; my @widgets = ( - get_banner(N("Extended Maintenance")), + get_banner(N("New version of Mageia distribution")), gtknew('Label_Left', text => get_obsolete_message() . "\n", @common), - if_($extended_maintenance_url, - $b1 = gtknew('RadioButton', - text => N("Purchase a maintenance extension for this version (%s) and keep it running until %s.", - $product_id->{version}, - iso8601_date_to_locale($extended_maintenance_end)), - - toggled => sub { - ($choice, $warn_me) = ('extended', undef) if $_[0]->get_active; - }, - - ), - gtknew('HSeparator'), - ), ($no_more_supported ne 'none' ? ( gtknew('VBox', children_tight => [ $b2 = gtknew('RadioButton', @@ -562,7 +500,6 @@ sub no_more_supported_choice() { my $res = fill_n_run_portable_dialog($w, \@widgets); - setVar('EXTENDED_SUPPORT_OFFERED', bool2yesno(1)); setVar('DO_NOT_ASK_FOR_NO_MORE_SUPPORTED', bool2text($warn_me)); $local_config{DO_NOT_ASK_FOR_NO_MORE_SUPPORTED} = bool2text($warn_me); if ($res) { @@ -580,24 +517,12 @@ sub no_more_supported() { my $choice = no_more_supported_choice(); if ($choice eq 'upgrade') { really_confirm_upgrade() and real_upgrade(); - } elsif ($choice eq 'extended') { - get_extended_maintenance(); } elsif ($choice eq 'nothing') { $icon->set_visible(0); } undef $no_more_supported_wip; } - -sub get_extended_maintenance() { - $mdv_update_pid = fork_exec('mgaapplet-add-media-helper', - if_($::testing, '--testing'), - if_($root, "--urpmi-root=$root"), - '--product=extended', - $product_id->{version}); -} - - sub really_confirm_upgrade() { local $mygtk2::left_padding = 0; my $w = ugtk2->new(N("New version of Mageia distribution"), width => $width + 20); diff --git a/mgaapplet-add-media-helper b/mgaapplet-add-media-helper deleted file mode 100755 index d1964228..00000000 --- a/mgaapplet-add-media-helper +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/perl -########################################################################### -# Copyright (C) 2010 Mandriva -# -# Thierry Vignaud <tvignaud@mandriva.com> -# João Victor Duarte Martins <jvictor@mandriva.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License Version 2 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -########################################################################### - -BEGIN { unshift @::textdomains, 'mgaonline' } - -use strict; -use lib qw(/usr/lib/libDrakX /usr/lib/libDrakX/drakfirsttime); -use standalone; # for explanations -use common; -use run_program; -use interactive; -use interactive::gtk; -use mygtk2 qw(gtknew); # only gtknew, any other stuff would break ugtk2 -use ugtk2 qw(:all); -use mgaonline qw($product_id); -use mgaapplet_gui; -use urpm::cfg; -use utf8; - -# %product is keyed by product id and it contains the data to add -# restricted media for each product. -my %product = ( - extended => { - info_url => 'https://www.mageia.org/', - has_rights => sub { - my ($profile, $version) = @_; - return ! ref $profile->{data}{groups}{'ext-maint-' . $version}; - }, - media_name => 'Extended Maintenance', - add_medium => \&mgaonline::add_medium_extended, - success_callback => sub { - mgaonline::read_sys_config(); - $mgaonline::config{EXTENDED_SUPPORT} = bool2yesno(1); - mgaonline::setVarsInSh($mgaonline::config_file, - \%mgaonline::config); - } - } - ); - -# Distribution upgrade version and product -my $up_version; -my $up_product; - -# Dialogs title and banner text -my $title = N("Adding an additional package medium"); - -my $current_apimdv_distro; - -# ###################################################################### -# Main Program - -{ - # Parsing command line arguments. - my $usage = - "Usage: $0 [OPTION]... VERSION\n" . - "Add package medias for VERSION (of current product by default).\n" . - "\n" . - " --rpm-root=PATH Use PATH as root for rpm\n" . - " --urpmi-root=PATH Use PATH as root for rpm and urpmi\n" . - " --product=NAME Upgrade to VERSION of product named NAME\n"; - - - foreach (@ARGV) { - if (/^--(rpm-root|urpmi-root)=(.+)/) { - $::rpmdrake_options{$1}[0] = $2; - } - elsif (/^--product=(.+)/) { - $up_product = lc $1; - } - elsif (/^([^-]{2}.+)/) { - $up_version = $1; - } - else { - die $usage; - } - } - $up_version or die $usage; - - # FIXME Couldn't that be automatic called when mgaonline.pm is used? - $product_id or mgaonline::get_product_id(); - - # Product id data should be used in lowercase. - $up_product ||= lc $product_id->{product}; - - # Sanitizes product command line argument. - unless (exists $product{$up_product}) { - my $available = join ", ", map { "'$_'" } keys %product; - $available =~ s/(.+), ([^,]+)/$1 and $2/; - die N("Supported products are %s, '%s' is not on the list.\n", - $available, - $up_product); - } - - run_authentication_dialog(); - ugtk2::exit(0); -} - -sub run_authentication_dialog { - my $description = N("Please fill in your account ID to add an additional package medium"); - my $extra_info = undef; # extra widgets for the dialog - - if ($up_product eq 'extended') { - - # Setup extra_info widgets for extended product... - my ($url, $extmaint_end, $desktop_update_end, $basic_update_end) - = get_extended_maintenance_data(); - if (my $err = $@) { - interactive->vnew->ask_warn( - N("Error"), - N("Failure while retrieving distributions list:") . "\n$err" - ); - return; - } - $extra_info - = [ gtknew('Label_Left', - text_markup => - join("\n\n", - #-PO: Here '%s' will be a localized date (eg: - # "2009/11/28" in english but "28/11/2009" - # for brazil or "28 Nov. "2009" for - # french: - N("Mageia provides 12 months of desktop updates (until %s) and 18 months of base updates (up to the %s) for distributions.", - mgaapplet_gui::iso8601_date_to_locale( - $desktop_update_end), - mgaapplet_gui::iso8601_date_to_locale( - $basic_update_end) - ), - N("Extended maintenance is now available to get 18 months of additional updates (until %s).", - mgaapplet_gui::iso8601_date_to_locale( - $extmaint_end)), - N("You can subscribe <b>right now</b> to get extended maintenance:"), - ), - @common), - new_link_button('http://www.mageia.org/', - N("Lifetime policy")), - new_link_button($url, N("Online subscription")) - ]; - } - - mgaapplet_gui::run_ask_credentials_dialog($title, - $description, - \&authenticate_callback, - top_extra => $extra_info); - return; -} - -sub authenticate_callback { - my ($email, $passwd) = @_; - my $product = $product{$up_product}; - my $profile = mgaonline::get_my_mdv_profile($email, $passwd); - - if ($profile->{code} != 0) { - my $in = interactive->vnew; - $in->ask_warn(N("Error"), - N("An error occurred") . "\n" . $profile->{message}); - goto &run_authentication_dialog; - } - elsif (!$product->{has_rights}->($profile)) { - mgaapplet_gui::run_no_rights_dialog( - $title, - N("Your Mageia account does not have %s download subscription enabled.", - mgaonline::translate_product($up_product)), - $product{$up_product}{info_url} - ); - } - else { - add_medium_for_product($product, $email, $passwd); - } -} - -sub add_medium_for_product { - my ($product, $email, $passwd) = @_; - - my $error = 0; - my $current_arch = urpm::cfg::get_arch(); - # FIXME: This is not enough if we ever support more 64 archs - # (sparc64, ppc64 and the like): - my @archs = ($current_arch, if_($current_arch eq 'x86_64', 'i586')); - - foreach my $arch (@archs) { - unless ($product->{add_medium}->($email, $passwd, $up_version, $arch)) { - # FIXME: Backup original media setup so on error previous - # added media in this loop can be removed? - $error = 1; - interactive->vnew->ask_warn( - N("Error"), - N("An error occurred while adding medium") - ); - goto &run_authentication_dialog; - } - } - - unless ($error) { - $product->{success_callback} and $product->{success_callback}->(); - my $w = ugtk2->new(N("Successfully added media!"), - grab => 1); - $w->_ask_okcancel(N("Successfully added media %s.", - $product->{media_name}), - N("Ok"), - undef); - ugtk2::main($w); - } -} - -sub get_extended_maintenance_data() { - if (not $current_apimdv_distro) { - require Rpmdrake::open_db; - my @distros = mgaonline::get_distro_list(); - return if !@distros; - $current_apimdv_distro = mgaonline::find_current_distro(@distros); - } - return @$current_apimdv_distro{ qw(extended-maintenance - extended-maintenance-end - desktop-update-end - basic-update-end) }; -} diff --git a/mgaonline.pm b/mgaonline.pm index 43a149f8..ff64b624 100644 --- a/mgaonline.pm +++ b/mgaonline.pm @@ -45,7 +45,6 @@ our @EXPORT = qw(find_current_distro get_release get_stale_upgrade_filename get_urpmi_options - is_extmaint_supported read_sys_config translate_product xml2perl @@ -56,7 +55,6 @@ our @EXPORT = qw(find_current_distro our @EXPORT_OK = qw( get_product_info get_my_mdv_profile - add_medium_extended ); our (%config, $product_id, $root); @@ -84,11 +82,6 @@ sub get_release() { ($r); } -sub is_extmaint_supported() { - return; # NOT SUPPORTED ON MAGEIA - $product_id->{support} eq 'extended'; -} - sub find_current_distro { find { $_->{version} eq $product_id->{version} } @_; } @@ -186,19 +179,6 @@ sub get_urpmi_options() { ({ sensitive_arguments => 1 }, 'urpmi.addmedia', '--xml-info', 'always'); } -sub add_medium_extended { - my ($email, $password, $version, $arch) = @_; - my $uri = sprintf("https://%s:%s\@dl.FIXME.com/extended/%s/%s", - uri_escape($email), - uri_escape($password), - $version, - $arch); - my @options = (get_urpmi_options(), '--update'); - run_program::raw(@options, - "Extended Maintenance $arch " . int(rand(100000)), - ${uri}); -} - sub is_running { my ($name) = @_; my $found; diff --git a/po/POTFILES.in b/po/POTFILES.in index c1e654a6..72e4262d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,5 @@ mgaupdate mgaapplet-config -mgaapplet-add-media-helper mgaapplet mgaapplet_gui.pm mgaapplet_urpm.pm |