Bugfix: Handle set-env in module-set correctly.

Raphael Kubo da Costa noticed that his set-env in module-sets were no
longer working in master.

Turns out a simplification of the setOption method to allow accepting
more than one option did not properly handle the set-env option if that
option had already been processed. (kdesrc-build has to convert set-env
read from the rc file into a hash instead of just storing the value to
allow for duplicate set-env entries).

This is fixed by ensuring that if that processing step has apparently
already been completed, we don't try doing it again.
wilder
Michael Pyne 15 years ago
parent acdfe28857
commit 8841e085c0
  1. 12
      kdesrc-build

@ -1710,7 +1710,13 @@ EOF
{ {
my ($self, %options) = @_; my ($self, %options) = @_;
while (my ($key, $value) = each %options) { while (my ($key, $value) = each %options) {
return if main::handle_set_env($self->{options}, $key, $value); # ref($value) checks if value is already a reference (i.e. a hashref)
# which means we should just copy it over, as all handle_set_env does
# is convert the string to the right hashref.
if (!ref($value) && main::handle_set_env($self->{options}, $key, $value))
{
return
}
debug (" Setting $self,$key = $value"); debug (" Setting $self,$key = $value");
$self->{options}{$key} = $value; $self->{options}{$key} = $value;
@ -4246,8 +4252,8 @@ sub handle_set_env
my ($var, @values) = split(' ', $value); my ($var, @values) = split(' ', $value);
$$href{$option} = ( ) unless exists $$href{$option}; ${$href}{$option} //= { };
$$href{$option}{$var} = join(' ', @values); ${$href}{$option}->{$var} = join(' ', @values);
return 1; return 1;
} }

Loading…
Cancel
Save