From 78037e6ca6715b89e3621bef582e38c02a0ece2e Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sun, 25 Jul 2004 23:10:59 +0000 Subject: [PATCH] Add set-env option. svn path=/trunk/kdenonbeta/kdecvs-build/; revision=332751 --- HISTORY | 1 + doc.html.in | 163 ++++++++++----------------------------------------- kdecvs-build | 24 +++++++- 3 files changed, 56 insertions(+), 132 deletions(-) diff --git a/HISTORY b/HISTORY index 95a56e9..ac06542 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,6 @@ Version history: 0.80 * Fixed an output quibble discovered by Michal Rokos + * Added set-env config option. Version history: 0.77 * Added inst-apps config option. diff --git a/doc.html.in b/doc.html.in index 7c71e8f..0f56408 100644 --- a/doc.html.in +++ b/doc.html.in @@ -66,6 +66,21 @@ those who either can't or don't feel like installing it.

(DOT) net), and is one of several build scripts for this purpose.

2004-Jul-25: v0.80
+New features: +

+ Bugfixes:

-

2004-Jun-17: v0.73
-New features: -

-

- -

2004-Jun-15: v0.73-pre1
-Bugfixes: -

- -Features: - -

- -

2004-Jun-13: v0.72 -- This Should Work Edition™
-Bugfixes: -

-

- -

I recommend that you set up a separate user account if you decide to run KDE -from CVS. I didn't at first, and I won't repeat that mistake for KDE 3.3 ;-). -I would also recommend that you add this script to your crontab so that you -don't have to worry about manually running the build process. The script -employs locking to prevent parallel execution. You also need to follow the -instructions on http://developer.kde.org/source/anoncvs.html -to set up your .cvsrc and .cvspass. You should also follow the instructions on -that page regarding setting up your own repository, especially if you intend to -use qt-copy. Make sure that qt-copy, arts, kdelibs, and kdebase are listed in -that order in your configuration file. If you perform a single-user install of -kdecvs-build, all you have to do to download, build, and install KDE from CVS -(assuming no build errors) is to run the script. -

$ kdecvs-build
-
-

- -

If you perform a system-wide installation, you can run the entire script -as root, although I would recommend using your distribution's packages or -Konstruct to install a -stable KDE.

-

Features

@@ -419,6 +304,7 @@ using the address you can find above.
  • recreate-configure
  • refresh-build
  • release-tag
  • +
  • set-env
  • stop-on-failure
  • use-qt-builddir-hack
  • use-unsermake
  • @@ -789,6 +675,21 @@ line option. + +set-env +Overrides global +

    This option accepts a space-separated set of values, where the first value +is the environment variable to set, and the rest of the values is what you +want the variable set to. For example, to set the variable RONALD to +McDonald, you would put in the appropriate section this command:

    +
    set-env RONALD McDonald
    +

    This option is special in that it can be repeated without overriding +earlier set-env settings in the same section of the configuration file. This +way you can set more than one environment variable per module (or +globally).

    + + + stop-on-failure Overrides global @@ -921,7 +822,7 @@ href="#options">.kdecvs-buildrc options.
    CVSup is a registered trademark of John D. Polstra.
    -Last modified: Sun Jul 25 17:19:56 2004
    +Last modified: Sun Jul 25 19:10:36 2004
    diff --git a/kdecvs-build b/kdecvs-build index 12f2eb4..dcf16cc 100755 --- a/kdecvs-build +++ b/kdecvs-build @@ -504,6 +504,7 @@ sub read_options # Get modulename ($modulename) = /^module\s+([-\.\w]+)\s*$/; $package_opts{$modulename} = { }; # Set up defaults + $package_opts{$modulename}{'set-env'} = { }; while () { @@ -517,7 +518,6 @@ sub read_options # Replace tildes with home directory. 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; @@ -543,6 +543,23 @@ sub read_options close CONFIG; } +# This subroutine reads the set-env option for a given module and initializes +# the environment based on that setting. +sub setup_module_environment +{ + my $module = shift; + my ($key, $value); + + # Let's see if the user has set env vars to be set. + my $env_hash_ref = get_option($module, 'set-env'); + while (($key, $value) = each %{$env_hash_ref}) + { + print "\tSetting $key to $value\n" if debugging; + } + + $ENV{$key} = $value while (($key, $value) = each %{$env_hash_ref}); +} + # Subroutine to initialize some environment variable for building # KDE from CVS. Change this section if a dependency changes later. sub initialize_environment @@ -553,6 +570,8 @@ sub initialize_environment my $cvsserver = get_option ('global', 'cvs-server'); $ENV{'CVS_RSH'} = 'ssh' if $cvsserver =~ /^:ext:/; + + setup_module_environment ('global'); } # Subroutine to get a list of modules to install, either from the command line @@ -1784,6 +1803,9 @@ sub update_module_environment # Qt has several defines of its own. Special case qt-copy for this # reason. setenv ("YACC", 'byacc -d') if ($module eq "qt-copy"); + + # Read in user environment defines + setup_module_environment ($module); } # Subroutine to make sure the build directory for a module is setup.