diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-22 17:52:08 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-22 17:52:08 +0000 |
commit | d5f830dd4382146a86f8f158af73cdffd4732696 (patch) | |
tree | 4157b6a9be548233fe925aac05d7a24001d37507 | |
parent | 52bedde712127db83b19369b419521e6d8b51ee5 (diff) | |
download | rpmdrake-d5f830dd4382146a86f8f158af73cdffd4732696.tar rpmdrake-d5f830dd4382146a86f8f158af73cdffd4732696.tar.gz rpmdrake-d5f830dd4382146a86f8f158af73cdffd4732696.tar.bz2 rpmdrake-d5f830dd4382146a86f8f158af73cdffd4732696.tar.xz rpmdrake-d5f830dd4382146a86f8f158af73cdffd4732696.zip |
ignore the medium that should be ignored when examining which
sources are update sources
-rwxr-xr-x | rpmdrake | 29 |
1 files changed, 12 insertions, 17 deletions
@@ -592,13 +592,15 @@ sub get_installable_pkgs { my ($updates, $opts) = @_; my $update_name = 'update_source'; my %update_descr; + my @update_medias; if ($updates) { my $urpm = new urpm; $urpm->configure(); my ($statedir, $cachedir) = map { $urpm->{$_} } qw (statedir cachedir); - if (grep { $_->{name} eq $update_name } @{$urpm->{media}}) { - undef $urpm; + @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}}; + undef $urpm; + if (@update_medias > 0) { if (!$opts->{skip_updating_mu}) { $options{noconfirmation} or interactive_msg('rpmdrake', _("I need to contact the mirror to get latest update packages. @@ -606,19 +608,18 @@ Please check that your network is currently running. Is it ok to continue?"), { yesno => 1 }) or myexit -1; my $w = wait_msg(_("Please wait, contacting mirror to update packages information.")); - system("/usr/sbin/urpmi.update $update_name") == 0 + system('/usr/sbin/urpmi.update', map { $_->{name} } @update_medias) == 0 or fatal_msg(_("Error updating medium"), _("There was an unrecoverable error while updating packages information.")); remove_wait_msg($w); } } else { - undef $urpm; mu_retry_another_mirror: my $m = choose_mirror; $m or interactive_msg(_("How to choose manually your mirror"), _("You may also choose your desired mirror manually: to do so, launch the Software Sources Manager, and then add a `Security -updates' source (keep the default name of the source - `%s'). +updates' source. Then, restart MandrakeUpdate.", $update_name)), myexit -1; my ($r) = cat_('/etc/mandrake-release') =~ /release\s(\S+)/; @@ -639,7 +640,7 @@ Do you want to try another mirror?", $r), { yesno => 1 }) and goto mu_retry_anot } my ($cur, $section); - foreach (cat_("$statedir/descriptions.update_source")) { + foreach (map { cat_("$statedir/descriptions.$_->{name}") } @update_medias) { /^%package (.+)/ and do { $update_descr{$_} = $cur foreach @{$cur->{pkgs}}; $cur = {}; @@ -661,20 +662,14 @@ Do you want to try another mirror?", $r), { yesno => 1 }) and goto mu_retry_anot my %installable_pkgs; $urpm->configure; - - my ($start, $end); - if ($updates) { - foreach (@{$urpm->{media}}) { - $_->{name} eq $update_name and ($start, $end) = ($_->{start}, $_->{end}); - } - } + @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}}; $urpm->compute_installed_flags(db); - foreach (@{$urpm->{depslist}}) { - $_->flag_upgrade or next; - $updates and ($_->flag_installed && $_->id >= $start && $_->id <= $end or next); - $installable_pkgs{my_fullname($_)} = { selected => 0, pkg => $_ }; + foreach my $pkg (@{$urpm->{depslist}}) { + $pkg->flag_upgrade or next; + $updates and ($pkg->flag_installed && grep { $pkg->id >= $_->{start} && $pkg->id <= $_->{end} } @update_medias or next); + $installable_pkgs{my_fullname($pkg)} = { selected => 0, pkg => $pkg }; } remove_wait_msg($w); |