diff options
Diffstat (limited to 'source4/build/smb_build/env.pm')
-rw-r--r-- | source4/build/smb_build/env.pm | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/source4/build/smb_build/env.pm b/source4/build/smb_build/env.pm index 9e52e1974d..b3dcbb8456 100644 --- a/source4/build/smb_build/env.pm +++ b/source4/build/smb_build/env.pm @@ -17,11 +17,16 @@ sub new($$) my ($name, $config) = @_; my $self = { }; bless $self, $name; - $self->set_config($config); + + $self->{items} = {}; + $self->{info} = {}; + + $self->_set_config($config); + return $self; } -sub set_config($$) +sub _set_config($$) { my ($self, $config) = @_; @@ -69,4 +74,28 @@ __EOF__ close(OUT); } +sub Import($$) +{ + my ($self,$items) = @_; + + foreach (keys %$items) { + if (defined($self->{items})) { + print "Warning: Importing $_ twice!\n"; + } + $self->{items}->{$_} = $items->{$_}; + } +} + +sub GetInfo($$) +{ + my ($self,$name) = @_; + + unless (defined($self->{info}->{$name})) + { + $self->{info}->{$name} = $self->{items}->Build($self); + } + + return $self->{info}->{$name}; +} + 1; |