Remove useless get_module_option.

Turns out that I had the great idea for a way to grab *just* a given
module's named option (if any) a long time ago. Unfortunately I had
added it directly to get_module using an optional third parameter and so
forgot about it later and reimplemented it.

I discovered this in the process of trying to complete modularization of
Modules in svn_module_url. For now I've ported that function to
Module::getOption and removed usage of get_module_option().
wilder
Michael Pyne 15 years ago
parent 2368e2180c
commit fa9bed655e
  1. 26
      kdesrc-build

@ -1225,13 +1225,16 @@ my $rcfile; # the file that was used; set by read_options
return $self->name() cmp $other->name();
}
# Returns the configured value for a given option. See main::get_option
# for now.
sub getOption
{
my ($self, $key) = @_;
my ($self, $key, $levelLimit) = @_;
$levelLimit //= 'allow-inherit';
# For now this is just a wrapper against main::get_option, but will
# be expanded/refactored later to be a proper polymorphic getter.
return main::get_option($self->name(), $key);
return main::get_option($self->name(), $key, $levelLimit);
}
# Returns the path to the desired directory type (source or build),
@ -1912,21 +1915,6 @@ sub get_option
return $$ref{$option} // ${$globalOpts}{$option};
}
# Like get_option, but returns the requested option for a given module with no
# fallbacks to global options, no overrides, etc. Basically goes directly into
# package_opts.
sub get_module_option
{
my ($module, $option) = @_;
if (not exists $package_opts{$module} || not exists $package_opts{$module}->{$option})
{
return undef;
}
return $package_opts{$module}->{$option};
}
# Returns a string describing the scm platform of the given module.
#
# First parameter: Module to get scm type of.
@ -1940,8 +1928,8 @@ sub module_scm_type
# says so...). Don't use get_option() as it will try to fallback to
# global options.
my $svn_status = get_module_option($module, 'svn-server');
my $git_status = get_module_option($module, 'repository');
my $svn_status = get_option($module, 'svn-server', 'module');
my $git_status = get_option($module, 'repository', 'module');
if ($svn_status && $git_status) {
error <<EOF;

Loading…
Cancel
Save