about summary refs log tree commit diff
path: root/scripts/readconfig.pm.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-05-31T09·24+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-05-31T09·24+0000
commit04cf72287bc27e4eca69d527ce44a88b7fcbebb2 (patch)
tree8495a2eee3ac5167b82a88e68cca8ba8ff7ef316 /scripts/readconfig.pm.in
parent1390ce4142d511b284b354f984d84fdb12ae850b (diff)
* This may be useful in the future.
Diffstat (limited to 'scripts/readconfig.pm.in')
-rw-r--r--scripts/readconfig.pm.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/readconfig.pm.in b/scripts/readconfig.pm.in
new file mode 100644
index 000000000000..aeb443aeed3a
--- /dev/null
+++ b/scripts/readconfig.pm.in
@@ -0,0 +1,17 @@
+use strict;
+
+sub readConfig {
+    my %config;
+    my $config = "@sysconfdir@/nix/nix.conf";
+    return unless -f $config;
+    
+    open CONFIG, "<$config" or die "cannot open `$config'";
+    while (<CONFIG>) {
+        /^\s*([\w|-]+)\s*=\s*(.*)$/ or next;
+        $config{$1} = $2;
+        print "|$1| -> |$2|\n";
+    }
+    close CONFIG;
+}
+
+return 1;