NAME

Meta::Baseline::Cook - library to give out cook related information to perl scripts.

COPYRIGHT

Copyright (C) 2001, 2002 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
VERSION: 0.48

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...).

FUNCTIONS

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($)
TEST($)

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.

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 ?

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.

TEST($)

Test suite for this module.

SUPER CLASSES

None.

BUGS

None.

AUTHOR

Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER

HISTORY

0.00 MV initial code brought in
0.01 MV bring databases on line
0.02 MV adding an XML viewer/editor to work with the baseline
0.03 MV code sanity
0.04 MV Another change
0.05 MV make quality checks on perl code
0.06 MV more perl checks
0.07 MV make Meta::Utils::Opts object oriented
0.08 MV more harsh checks on perl code
0.09 MV check that all uses have qw
0.10 MV differentiate between deps and udep in perl
0.11 MV fix todo items look in pod documentation
0.12 MV handle C++ dependencies better
0.13 MV more on tests/more checks to perl
0.14 MV more perl code quality
0.15 MV put ALL tests back and light the tree
0.16 MV fix up the cook module
0.17 MV change new methods to have prototypes
0.18 MV cook.pm to automatically pass options down to the cook level
0.19 MV correct die usage
0.20 MV perl quality change
0.21 MV perl code quality
0.22 MV more perl quality
0.23 MV chess and code quality
0.24 MV more perl quality
0.25 MV perl documentation
0.26 MV more perl quality
0.27 MV perl qulity code
0.28 MV more perl code quality
0.29 MV more perl quality
0.30 MV revision change
0.31 MV languages.pl test online
0.32 MV good xml support
0.33 MV real deps for docbook files
0.34 MV html site update
0.35 MV spelling and papers
0.36 MV fix up cook files
0.37 MV perl packaging
0.38 MV xml encoding
0.39 MV md5 project
0.40 MV database
0.41 MV perl module versions in files
0.42 MV movies and small fixes
0.43 MV thumbnail user interface
0.44 MV more thumbnail issues
0.45 MV website construction
0.46 MV web site automation
0.47 MV SEE ALSO section fix
0.48 MV web site development

SEE ALSO

DB_File(3), File::Basename(3), Meta::Baseline::Aegis(3), Meta::Baseline::Utils(3), Meta::Development::Deps(3), Meta::Utils::File::Purge(3), Meta::Utils::File::Touch(3), Meta::Utils::Options(3), Meta::Utils::Output(3), Meta::Utils::Time(3), strict(3)

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.