summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/config_mk.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/smb_build/config_mk.pm')
-rw-r--r--source4/build/smb_build/config_mk.pm24
1 files changed, 23 insertions, 1 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 7b8fbd93c3..11ef8cf7b1 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -61,7 +61,7 @@ sub _parse_config_mk($)
}
#
- # 1.) lines with an aplhanumeric character indicate
+ # 1.) lines with an alphanumeric character indicate
# a new variable,
# 2.) followed by zero or more whitespaces or tabs
# 3.) then one '=' character
@@ -437,4 +437,26 @@ sub binary_get_array($$$)
return _fetch_array_from_config_mk($filename,$section,$var);
}
+
+sub import_file($$)
+{
+ my $input = shift;
+ my $filename = shift;
+
+ my $result = _parse_config_mk($filename);
+
+ die ($result->{ERROR_STR}) unless $result->{ERROR_CODE} == 0;
+
+ foreach my $section (keys %{$result}) {
+ next if ($section eq "ERROR_CODE");
+ my ($type, $name) = split(/::/, $section, 2);
+
+ $input->{$name}{NAME} = $name;
+ $input->{$name}{TYPE} = $type;
+
+ foreach my $key (values %{$result->{$section}}) {
+ $input->{$name}{$key->{KEY}} = [input::str2array($key->{VAL})];
+ }
+ }
+}
1;