[Cook] Match mode appears to be broken

Jody Hagins jody at atdesk.com
Fri Jun 20 03:00:43 EST 2003


I have been fighting with a problem in my cookfile, and have been able
to simplify it to a small example.  Basically, once I change the match
mode to REGEX, I can not get cook to recognize the "match-mode-cook"
again.  The following cook file demonstrates the problem.


cook version 2.23.D001


/***********************************************************************
 * This example demonstrates a bug in cook, which does not reset
 * the match mode after it has been changed to regex.
 **********************************************************************/

foo=200305/20030528s00.gz 200305/20030528s01.gz 200305/20030528s02.gz;
one=[unsplit " " [patsubst %0%1s% %0%1FOO% [foo]]];
two=[unsplit " " [patsubst %0%1s% %0%1FOO% [foo]]];
if [not [matches [one] [two]]] then
{
  fail [__FILE__]": "[__LINE__]": Bug: \""[one]"\" != \""[two]"\"";
}
set match-mode-regex;
set match-mode-cook;
two=[unsplit " " [patsubst %0%1s% %0%1FOO% [foo]]];
if [not [matches [one] [two]]] then
{
  fail [__FILE__]": "[__LINE__]": Bug: \""[one]"\" != \""[two]"\"";
}

all:
{
  echo "The test passed!" set silent;
}

/* END EXAMPLE */





More information about the Cook-users mailing list