NAME
Meta::Baseline::Cook - library to give out cook related information to perl scripts.
COPYRIGHT
Copyright (C) 2001 Mark Veltzer; All rights reserved.
LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
DETAILS
MANIFEST: Cook.pm PROJECT: meta
SYNOPSIS
package foo;
use Meta::Baseline::Cook qw();
my($cook)=Meta::Baseline::Cook-
new();> $cook-
exec_build([params]);>
DESCRIPTION
This library is intended to supply all demanders (i.e. Peter Miller's cook, other scripts or any other inquirer) any information regarding cook related parameters in the project. In addition this library knows how to do cook related stuff (write and read dependencies in cook format...).
EXPORTS
new($)
search_list($)
inte($)
deve($)
temp_dir($)
touch($$$$$)
touch_now($$$$)
exec_development_build($$$$)
exec_build($$$)
print_deps_handle($$)
print_deps($$)
read_deps($$$)
read_deps_full($)
FUNCTION DOCUMENTATION
- new($)
-
This gives you a new cook object.
- search_list($)
-
This returns the search_list variable in cook format (space separated...).
- inte($)
-
This returns 0 or 1 accroding to whether this is an integration state.
- deve($)
-
This returns 0 or 1 accroding to whether this is a development state.
- temp_dir($)
-
This will return a temp directory to hold cook junk files. (lists, temporary files, etc...).
- touch($$$$$)
-
This routine receives file to touch,epoch date and a verbose variable. It check if the the directory in which the file resides has a ".cook.fp" file in it. If so, it checks if the file name is in the ".cook.fp" file. If so, it chages the file's date (in epoch seconds) to the epoch date received from whatever was in there. In either case it uses the regular mechanism and touches the file using the epoch received. The overall effect is that cook will be aware that the file has indeed changed.
- touch_now($$$$)
-
This routine receives a file, a demo flag and a verbose flag. The routine finds the current time using Meta::Utils::Time::now_epoch and then calls touch from this module to change the cook time to the current time.
- exec_development_build($$$$)
-
This routine executes a development build. It receives a list of arguments as the partial build targets and executes cook. The routine returns the status from cook on exit.
- exec_build($$$)
-
This command executes an integration build. This is the reason why the command does not receive any arguments since partial builds in integration time are not allowed. This just calls exec_development_build with no partial targets. This returns the correct state output. This routine receives a demo flag of whether to run as demo or not.
- print_deps_handle($$)
-
This method gets a dependency object and prints it out in cook style. A dependency object is just a graph so what it needed here is the following: pass over every node (in whatever order) and for each node find edges to other nodes and emit the "cascase" type statements for cook. If the node does not have any adjacents - no need to emit anything!!! right ?
- print_deps($$)
-
This method is exactly as print_deps_handle except it also opens and closes a file.
- read_deps($$$)
-
This method receives a baseline related file name and assumes that its a cook dependency file written by the above print_deps methods. It adds the dependency information it finds in the file to the graph it gets also as input. It also receives a parameters telling it whether to be recursive or not.
- read_deps_full($)
-
This method is just convenience wrapper around the read_deps method. It generates the graph that will be used to hold the dependency information. It also returns that graph at the end.
BUGS
None.
AUTHOR
Mark Veltzer <mark2776@yahoo.com>
HISTORY
start of revision info 1 Mon Jan 1 16:38:12 2001 MV initial code brought in 2 Tue Jan 2 06:08:54 2001 MV bring databases on line 3 Fri Jan 5 09:09:46 2001 MV adding an XML viewer/editor to work with the baseline 4 Fri Jan 5 09:26:25 2001 MV code sanity 5 Sat Jan 6 02:40:51 2001 MV Another change 6 Sat Jan 6 11:39:39 2001 MV make quality checks on perl code 7 Sat Jan 6 17:14:09 2001 MV more perl checks 8 Sun Jan 7 18:17:29 2001 MV make Meta::Utils::Opts object oriented 9 Sun Jan 7 20:46:54 2001 MV more harsh checks on perl code 10 Tue Jan 9 18:15:19 2001 MV check that all uses have qw 11 Tue Jan 9 18:20:08 2001 MV differentiate between deps and udep in perl 12 Tue Jan 9 19:29:31 2001 MV fix todo items look in pod documentation 13 Tue Jan 9 20:08:10 2001 MV handle C++ dependencies better 14 Wed Jan 10 12:05:55 2001 MV more on tests/more checks to perl 15 Wed Jan 10 18:31:05 2001 MV more perl code quality 15 Thu Jan 11 12:42:37 2001 MV put ALL tests back and light the tree 16 Fri Jan 12 11:36:41 2001 MV fix up the cook module 17 Fri Jan 12 15:53:19 2001 MV change new methods to have prototypes 18 Fri Jan 12 18:25:02 2001 MV cook.pm to automatically pass options down to the cook level 19 Thu Jan 18 15:59:13 2001 MV correct die usage 20 Sat Jan 27 19:56:28 2001 MV perl quality change 21 Sun Jan 28 02:34:56 2001 MV perl code quality 22 Sun Jan 28 13:51:26 2001 MV more perl quality 23 Mon Jan 29 20:54:18 2001 MV chess and code quality 23 Tue Jan 30 03:03:17 2001 MV more perl quality 24 Sat Feb 3 23:41:08 2001 MV perl documentation 25 Mon Feb 5 03:21:02 2001 MV more perl quality 26 Tue Feb 6 01:04:52 2001 MV perl qulity code 27 Tue Feb 6 07:02:13 2001 MV more perl code quality 28 Tue Feb 6 08:47:46 2001 MV more perl quality 29 Tue Feb 6 22:19:51 2001 MV revision change end of revision info
SEE ALSO
Nothing.
TODO
-unite all the init routines into init and make that code run on usage (in the BEGIN block of the module...).
-In the init routine: Get names of architectures. Get names of machines. Get names of languages supported.
-split the unix_path routine to fixpath and fixline where the difference is that the first matches a single match at the begining and the later matches many matches anywhere.
-remove the unix_path routine from this module once we fix the amd maps.
-add more functionality here like auto script making for auto mounting on the NT machines, distinguishing between Watcom and Visual C++ etc... (machines that give out services that is...).
-maybe when we give a list of machines to cook we should double the name of the current host or something to refelect the fact that he's faster ? check with peter... Maybe we should double the name of the host on which the change resides locally ?
-make is_plat not do that ugly "|| $plat eq "scr"" stuff.