From c77b87d710880640f98aafd20f991559358c9a74 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 6 Nov 2003 16:37:13 +0000 Subject: - generalize & rename remove_alias() as remove_alias_regexp() to handle regexps - introduce back a simple remove_alias() wrapper to remove_alias_regexp() - change remove_alias*() API from remove_alias(module) to remove_alias(alias) btw old behaviour was broken if eg one has two 3com cards when network::ethernet::configureNetwork removed all ethX aliases on 3c59x --- perl-install/modules.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'perl-install/modules.pm') diff --git a/perl-install/modules.pm b/perl-install/modules.pm index e78b3d8d4..21a54070a 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -171,9 +171,14 @@ sub add_probeall { } sub remove_alias($) { + my ($name) = @_; + remove_alias_regexp("^$name\$"); +} + +sub remove_alias_regexp($) { my ($name) = @_; foreach (keys %conf) { - $conf{$_}{alias} && $conf{$_}{alias} eq $name or next; + $conf{$_}{alias} && $_ =~ qr/$name/ or next; delete $conf{$_}{alias}; return 1; } -- cgit v1.2.1