From ef685055822f73fae5f01b7f8558f1e4d3a5a6cf Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 3 Dec 2004 14:53:17 +0000 Subject: While we're at it, implement --no-ignore and make it work with -a --- urpm/args.pm | 2 +- urpmi.update | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/urpm/args.pm b/urpm/args.pm index aaf631d9..c5b375de 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -246,7 +246,7 @@ my %options_spec = ( f => sub { ++$options{force} }, z => sub { ++$options{compress} }, update => \$options{update}, - ignore => \$options{ignore}, + 'ignore!' => sub { $options{ignore} = $_[1] }, 'force-key' => \$options{forcekey}, 'limit-rate=s' => \$options{limit_rate}, 'no-md5sum' => \$options{nomd5sum}, diff --git a/urpmi.update b/urpmi.update index 463b8332..75fe371b 100755 --- a/urpmi.update +++ b/urpmi.update @@ -40,6 +40,7 @@ where is a medium name to update. ") . N(" --force-key - force update of gpg key. ") . N(" --norebuild - don't try to rebuild hdlist if not readable. ") . N(" --ignore - don't update, mark the media as ignored. +") . N(" --no-ignore - don't update, mark the media as enabled. ") . N(" -a - select all non-removable media. ") . N(" -c - clean headers cache directory. ") . N(" -f - force generation of hdlist files. @@ -67,12 +68,11 @@ exists $options{limit_rate} or $options{limit_rate} = $urpm->{options}{'limit-ra my @entries = map { $_->{name} } @{$urpm->{media}}; -if ($options{all}) { +if ($options{all} && !defined $options{ignore}) { @entries == 0 and die N("nothing to update (use urpmi.addmedia to add a media)\n"); } else { + if ($options{all}) { @toupdates = '' } #- select all $urpm->select_media(@toupdates); - - #- force ignored media to be returned alive. my $something_todo = 0; foreach (@{$urpm->{media}}) { $options{update} && $_->{update} and $_->{modified} = 1; @@ -80,6 +80,7 @@ if ($options{all}) { if ($options{ignore}) { $_->{ignore} = 1; } else { + #- force ignored media to be returned alive. delete $_->{ignore}; } ++$something_todo; @@ -89,8 +90,9 @@ if ($options{all}) { $something_todo or die N("the entry to update is missing\n(one of %s)\n", join(", ", @entries)); } -if ($options{ignore}) { - $urpm->{log}(N("ignoring media %s", join(", ", map { N("\"%s\"", $_->{name}) } grep { $_->{modified} } @{$urpm->{media}}))); +if (defined $options{ignore}) { + $urpm->{log}(N($options{ignore} ? "ignoring media %s" : "enabling media %s", + join(", ", map { N("\"%s\"", $_->{name}) } grep { $_->{modified} } @{$urpm->{media}}))); $urpm->write_config; } else { $urpm->update_media(%options, callback => \&urpm::download::sync_logger); -- cgit v1.2.1