From 365f3028ddfb5487f35ebbb9adc42ddf9459113d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 5 Dec 2010 17:50:29 +0000 Subject: * Use CamelCase for the Perl modules. --- scripts/NixConfig.pm.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/NixConfig.pm.in (limited to 'scripts/NixConfig.pm.in') diff --git a/scripts/NixConfig.pm.in b/scripts/NixConfig.pm.in new file mode 100644 index 000000000000..aeb443aeed3a --- /dev/null +++ b/scripts/NixConfig.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 () { + /^\s*([\w|-]+)\s*=\s*(.*)$/ or next; + $config{$1} = $2; + print "|$1| -> |$2|\n"; + } + close CONFIG; +} + +return 1; -- cgit 1.4.1