From 330ae32b4c2df3303302ea5e1b7b7f6288928e1a Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sun, 25 Jul 2004 21:42:43 +0000 Subject: [PATCH] Read in the set-env option specially, in preparation for adding support for setting environment vars in the config file. svn path=/trunk/kdenonbeta/kdecvs-build/; revision=332729 --- kdecvs-build | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/kdecvs-build b/kdecvs-build index 55b8196..12f2eb4 100755 --- a/kdecvs-build +++ b/kdecvs-build @@ -41,6 +41,7 @@ my %global_opts = ( "cxxflags" => "", "debug" => "", "do-not-compile" => "", + "set-env" => { }, # Hash of environment vars to set "install-after-build" => "1", # Default to true "inst-apps" => "", "kdedir" => "", @@ -474,7 +475,16 @@ sub read_options # Replace tildes with home directory. 1 while ($flags =~ s/(^|:)~/$1$ENV{'HOME'}/); $flags = 0 if $flags =~ /^false$/; - $global_opts{$option} = $flags; + + if ($option ne 'set-env') + { + $global_opts{$option} = $flags; + } + else + { + my ($var, @values) = split(/\s/, $flags); + $global_opts{'set-env'}{$var} = join(' ', @values); + } } } @@ -508,6 +518,15 @@ sub read_options 1 while ($flags =~ s/(^|:)~/$1$ENV{'HOME'}/); $flags = 0 if $flags =~ /^false$/; $package_opts{$modulename}->{$option} = $flags; + if ($option ne 'set-env') + { + $package_opts{$modulename}{$option} = $flags; + } + else + { + my ($var, @values) = split(/\s/, $flags); + $package_opts{$modulename}{'set-env'}{$var} = join(' ', @values); + } } # Done reading options, add this module to the update list