You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2004/02/19 16:11:25 UTC

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm

>   +        (my $generated = $File::Find::name) =~ s/\.in$//;
>   +        push @need_update, $generated 
>   +            unless -e $generated && -M $generated < -M $File::Find::name;

>   -    if (my $extra_conf = $self->generate_extra_conf) {
>   -        for my $file (@$extra_conf) {
>   -            push @reasons, "$file.in is newer than $file"
>   -                if -e $file && -M "$file.in" < -M $file;
>   -        }

you flipped the logic here.  it needs to be

  unless -e $generated && -M $generated > -M $File::Find::name

which is equivalent to

  if (! -e extra.conf || ! (extra.conf > extra.conf.in))

right now it reconfigures all the time:

[warning] forcing re-configuration:
[warning]       - t/conf/extra.conf.in is newer than t/conf/extra.conf.

-rw-rw-r--    1 geoff    geoff        1283 Feb 19 09:42 extra.conf
-rw-rw-r--    1 geoff    geoff         353 Feb 19 09:36 extra.conf.in

--Geoff


Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>>you flipped the logic here.  it needs to be
>>>
>>>  unless -e $generated && -M $generated > -M $File::Find::name
>>
>>
>>I don't think so. The two snippets you quoted above aren't the same.
>>I've changed the functionality and changed the order of the arguments.
> 
> 
> ok, I see now.  when I ran my own logic tests I flipped the files myself.
> confusing stuff :)

Yes, -M is always confusing, since it reports the time since the last change.

>>>right now it reconfigures all the time:
>>>
>>>[warning] forcing re-configuration:
>>>[warning]       - t/conf/extra.conf.in is newer than t/conf/extra.conf.
>>>
>>>-rw-rw-r--    1 geoff    geoff        1283 Feb 19 09:42 extra.conf
>>>-rw-rw-r--    1 geoff    geoff         353 Feb 19 09:36 extra.conf.in
>>
>>
>>I bet you see that problem when you do a full reconfigure, no? So, yes,
>>there is a buglet in the comments, not the actual config process. Will
>>fix that shortly.
> 
> 
> yes, you're right, it was the comments - extra.conf wasn't being regenerated
> every time, it was just the warning that was showing up.
> 
> anyway, sorry for not paying more attention.

No, no, your observation was good, as I indeed introduced a misleading 
commentary. I think it's all fixed now.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>> you flipped the logic here.  it needs to be
>>
>>   unless -e $generated && -M $generated > -M $File::Find::name
> 
> 
> I don't think so. The two snippets you quoted above aren't the same.
> I've changed the functionality and changed the order of the arguments.

ok, I see now.  when I ran my own logic tests I flipped the files myself.
confusing stuff :)


>> right now it reconfigures all the time:
>>
>> [warning] forcing re-configuration:
>> [warning]       - t/conf/extra.conf.in is newer than t/conf/extra.conf.
>>
>> -rw-rw-r--    1 geoff    geoff        1283 Feb 19 09:42 extra.conf
>> -rw-rw-r--    1 geoff    geoff         353 Feb 19 09:36 extra.conf.in
> 
> 
> I bet you see that problem when you do a full reconfigure, no? So, yes,
> there is a buglet in the comments, not the actual config process. Will
> fix that shortly.

yes, you're right, it was the comments - extra.conf wasn't being regenerated
every time, it was just the warning that was showing up.

anyway, sorry for not paying more attention.

--Geoff


Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>  +        (my $generated = $File::Find::name) =~ s/\.in$//;
>>  +        push @need_update, $generated 
>>  +            unless -e $generated && -M $generated < -M $File::Find::name;
> 
> 
>>  -    if (my $extra_conf = $self->generate_extra_conf) {
>>  -        for my $file (@$extra_conf) {
>>  -            push @reasons, "$file.in is newer than $file"
>>  -                if -e $file && -M "$file.in" < -M $file;
>>  -        }
> 
> 
> you flipped the logic here.  it needs to be
> 
>   unless -e $generated && -M $generated > -M $File::Find::name

I don't think so. The two snippets you quoted above aren't the same. I've 
changed the functionality and changed the order of the arguments. The code:

         push @need_update, $generated
             unless -e $generated && -M $generated < -M $File::Find::name;

says: a generated file needs to be updated, unless it already exists and it's 
younger than its source file.

In other words, update the file if it doesn't exist or if it's older then the 
source file:

push @need_update, $generated
             if (!-e $generated || -M $generated > -M $File::Find::name);

Am I wrong?

> which is equivalent to
> 
>   if (! -e extra.conf || ! (extra.conf > extra.conf.in))
> 
> right now it reconfigures all the time:
> 
> [warning] forcing re-configuration:
> [warning]       - t/conf/extra.conf.in is newer than t/conf/extra.conf.
> 
> -rw-rw-r--    1 geoff    geoff        1283 Feb 19 09:42 extra.conf
> -rw-rw-r--    1 geoff    geoff         353 Feb 19 09:36 extra.conf.in

I bet you see that problem when you do a full reconfigure, no? So, yes, there 
is a buglet in the comments, not the actual config process. Will fix that shortly.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com