delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/11/06:04:02

From: "Cyrus Patel" <cyp AT fb14 DOT uni-mainz DOT de>
Organization: Johannes Gutenberg Universitaet
To: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Date: Tue, 11 Feb 2003 11:58:25 +0100
MIME-Version: 1.0
Subject: Re: fix for copyrite.c[c]/copyrite.pl
CC: djgpp-workers AT delorie DOT com (DJGPP developers)
Message-ID: <3E48E5B7.27234.C850F28B@localhost>
In-reply-to: <10302102358.AA20785@clio.rice.edu>
References: <3E47B9E6 DOT 29472 DOT C3BDC5DE AT localhost> from "Cyrus Patel" at Feb 10, 2003 02:39:14 PM
X-mailer: Pegasus Mail for Windows (v4.02a)
X-MIME-Autoconverted: from Quoted-printable to 8bit by delorie.com id h1BB1Uf26235
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 10 Feb 2003 at 17:58, Charles Sandmann wrote:

> First - let me say code review shouldn't be taken personally - it's a
> way of gathering other opinions to see if it is the best way to solve
> a problem.

*nod*

> I would prefer glob() - it works fine, never been a problem,
<snip>
> development machines.  Personal perference.

Fair enough.

> Win32 console build; unix build.

under those circumstances, the perl version is probably adequate. 
Well, the ´find´ could be replaced with glob/DosGlob :)

btw, in an NT (2K) VDM however I saw 'file not found' errors for
stat() when the pathlen > 64. Shouldn't LFNizing have avoided that?

> > d) it scans more than just the first line of a file for non-dj
> >    copyrights (just as copyrite.pl does), which, as describes
> >    in the first 34 lines of the file, is the whole point of the
> >    thing.
> 
> This is something I agree we need to do.  But I don't think the code
> needs one time fix stuff it in (such as removing stuff, etc).  It will
> be there forever, dead code ...

ok.

> 
> > > No documentation (internal or external).
> 
> I should clarify - the original program had main(void) - so had no
> options - and always behaved a particular way.  The new version takes
> arguments.  

Yes, but it behaves the same way as the old .cc if no arguments are 
provided. ie, specifying which directory to start in is optional.

> fix identical behavior. If the functionality is necessary, cool.  If
> not, keep it simple.

yeah, I did go a tad overboard on functionality. I wanted to catch 
copyright lines that were out of order, and one thing just led to the 
next. :)

> > - coalesce multiple dj-(c) lines into one compound 
> >   dj-copyright notice per file.
> 
> I'd like to avoid this; I didn't check in detail if it does this
> when no modification is needed (definitely not desired since this
> would cause a revision change on every file in CVS).

Right. Clarification: The file is only modified if the last-modified-
date is greater than the date of the newest dj copyright notice.
The check whether a file needs update or not at at about line 390.

    if (nondj <= 0) /* no copyright found, or dj copyright found 
    {
       fyear = localtime(&(statblk->st_mtime))->tm_year;
       ...
       if (fyear > hiyear) /* always true if no dj copyright */
       {
         ...
         modified = 1;

> I'm sorry I wasn't clear on my original note, I read those docs
> but was referring to usage documentation and one time changes 
> versus every time changes.

Ah, ok. The comment...

 * - If something in the file advises against an edit, do nothing.
 * - If the file contains no copyright notice, prepend a DJ one.
 * - If the file contains a DJ copyright, ensure it is up-to-date.
 * - If the file contains a non-DJ copyright *AND* a DJ copyright
 *   *AND* that DJ copyright was an automatically prepended one, 
 *   then remove the latter - It had been prepended by the old
 *   broken copyright.cc.

should be ammended to read...

 * - If something in the file advises against an edit, do nothing.
     (contains 'DO NOT EDIT' - this is what copyrite.pl does too)
 * - If the file contains no copyright notice, prepend a DJ one.
 * - If the file contains a DJ copyright, ensure it is up-to-date.
     The file is modified only if file's last-modified-date is
     greater than the newest/highest dj copyright date found.
 * - If the file contains a non-DJ copyright *AND* a DJ copyright
 *   *AND* that DJ copyright was an automatically prepended one, 
 *   then remove the latter - It had been prepended by the old
 *   broken copyright.cc. This functionality is a by-product
     of the "find copyright" process, and is a one-time fix.

Regards,
Cyrus

---------------------------------------------
Real Newspaper Headline:
  "Bank Drive-in Window Blocked by Board"


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019