summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-09 09:21:53 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-09 09:21:53 +0000
commitd7f6060aba7df0b4e108aeb70bdc93685c2e2bb0 (patch)
tree3fb17bb6c142f49ee243d00edb6ca38109b0a5a4
parent7a504d096c0c3b0984f132c98eb3ac10087f4562 (diff)
downloadurpmi-d7f6060aba7df0b4e108aeb70bdc93685c2e2bb0.tar
urpmi-d7f6060aba7df0b4e108aeb70bdc93685c2e2bb0.tar.gz
urpmi-d7f6060aba7df0b4e108aeb70bdc93685c2e2bb0.tar.bz2
urpmi-d7f6060aba7df0b4e108aeb70bdc93685c2e2bb0.tar.xz
urpmi-d7f6060aba7df0b4e108aeb70bdc93685c2e2bb0.zip
Add an option -y (fuzzy match on media names) in urpmi.removemedia
-rwxr-xr-xurpmi.removemedia5
1 files changed, 4 insertions, 1 deletions
diff --git a/urpmi.removemedia b/urpmi.removemedia
index dd2791e3..db586211 100755
--- a/urpmi.removemedia
+++ b/urpmi.removemedia
@@ -28,14 +28,17 @@ sub main {
my (@toremoves, %options);
$options{noclean} = 1;
+ $options{strict_match} = 1;
foreach (@_) {
/^--?a$/ and $options{all} = 1, next;
/^--?c$/ and $options{noclean} = 0, next;
+ /^--?y$/ and $options{strict_match} = 0, next;
/^-/ and die N("usage: urpmi.removemedia [-a] <name> ...
where <name> is a medium name to remove.
") . N(" --help - print this help message.
") . N(" -a - select all media.
") . N(" -c - clean headers cache directory.
+") . N(" -y - fuzzy match on media names.
") . (/^--?h(?:elp)$/ ? '' : N("\nunknown options '%s'\n", $_));
push @toremoves, $_;
}
@@ -49,7 +52,7 @@ where <name> is a medium name to remove.
}
@toremoves == 0 and die N("the entry to remove is missing\n(one of %s)\n", join(", ", @entries));
- $urpm->select_media({ strict_match => 1 }, @toremoves);
+ $urpm->select_media({ strict_match => $options{strict_match} }, @toremoves);
$urpm->remove_selected_media;
$urpm->update_media(noclean => $options{noclean});