From: Martin Mares Date: Tue, 17 Jul 2007 16:39:33 +0000 (+0200) Subject: Substitute not only configuration switches, but also environment variables. X-Git-Tag: holmes-import~506^2~54 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9ff544a875f8ee8f78317667fb6200f2f516bc31;p=libucw.git Substitute not only configuration switches, but also environment variables. --- diff --git a/build/genconf b/build/genconf index ac9755f4..eaf2d1c7 100755 --- a/build/genconf +++ b/build/genconf @@ -10,12 +10,19 @@ use warnings; open CF, $ARGV[2] or die "Unable to open $ARGV[2]"; my %options = (); my %vars = (); +sub opt { + my ($k,$v) = @_; + $vars{$k} = $v; + $options{$k} = 1 if ($k =~ /^CONFIG_/); +} +foreach my $k (keys %ENV) { + opt($k, $ENV{$k}); +} while () { chomp; if (my ($k,$v) = /^(\w+)=(.*)/) { $v =~ s/\s+$//; - $vars{$k} = $v; - $options{$k} = 1 if ($k =~ /^CONFIG_/); + opt($k, $v); } } close CF;