diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-12-03 14:53:17 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-12-03 14:53:17 +0000 |
commit | ef685055822f73fae5f01b7f8558f1e4d3a5a6cf (patch) | |
tree | 4551ef0beef6e3d41190a06648e4491ab150cea4 | |
parent | 4a300367a6d3fad315e36569936ff10dca73f340 (diff) | |
download | urpmi-ef685055822f73fae5f01b7f8558f1e4d3a5a6cf.tar urpmi-ef685055822f73fae5f01b7f8558f1e4d3a5a6cf.tar.gz urpmi-ef685055822f73fae5f01b7f8558f1e4d3a5a6cf.tar.bz2 urpmi-ef685055822f73fae5f01b7f8558f1e4d3a5a6cf.tar.xz urpmi-ef685055822f73fae5f01b7f8558f1e4d3a5a6cf.zip |
While we're at it, implement --no-ignore and make it work with -a
-rw-r--r-- | urpm/args.pm | 2 | ||||
-rwxr-xr-x | 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 <name> 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); |