legaldirs file is re-created even if modules file has not changed

RESOLVED FIXED

Status

Webtools Graveyard
Bonsai
RESOLVED FIXED
16 years ago
2 years ago

People

(Reporter: David Berry, Assigned: Tara Hernandez)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
The file data/legaldirs in Bonsai is always re-created every time
LoadDirList is called.

I believe the problem is as follows, in LoadDirList in bonsai/globals.pl.

      $modules = $::TreeInfo{$::TreeID}{'repository'} . "/CVSROOT/modules";
      $dirsfile = DataDir() . "/legaldirs";

      if (-f $modules) {
           if ((!(-f $dirsfile)) ||
               ((-M $dirsfile) < (-M $modules))) {
                system("./createlegaldirs.pl", $::TreeID);
           }
      }

As I interpret this it says that if the legaldirs file doesn't
exist or legaldirs was last modfied date is newer than the CVSROOT/modules
modification date then re-create the legaldirs file.

If the file doesn't exist that's fine.

It's the second part that puzzles me, surely as the legaldirs file is
generated from the modules file it will always be newer, and in fact the
test should be the other way round. If the legaldirs file is older than the
modules file, then you would want to re-create the legaldirs file.

I'll attach a suggested patch when the bug is created
(Reporter)

Comment 1

16 years ago
Created attachment 91484 [details] [diff] [review]
Patch to solve problem of re-creating legaldirs each time
(Assignee)

Comment 2

15 years ago
Well, duh.  Patch checked in, with thanks to Mr. Berry.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED

Updated

14 years ago
Attachment #91484 - Flags: review?(tara)
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.