[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

update-copyright request and patch...

From: Joel Brobecker
Subject: update-copyright request and patch...
Date: Tue, 3 Jan 2012 07:39:27 +0400
User-agent: Mutt/1.5.20 (2009-06-14)

Hello, and Happy New Year :-).

I am trying to use gnulib's update-copyright script to update all
of GDB's files. It's working quite beautifully, and it's quite fast
too. I only have a couple of issues:

  - C files: In GDB, the style for comments is to avoid the '*'
    at the start of new files. Eg:

        /* Copyright (C) 2000, 2001, 2002, 2003, 2004,
           2005 Free Software Foundation, Inc.  */

    update-copyright, on the other hand, transforms the "/*" prefix
    into " *"...

  - The script is not always working well with XML files,
    because it potentially repeats the start-of-comment prefix
    when wrapping lines, thus transforming...

        <!-- Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.

        <!-- Copyright (C) 2000, 2001, 2002, 2003, 2012
        <!-- Free Software Foundation, Inc.

    (or not recognizing multi-line copyright blobs)

I would like to extend the script in gnulib to accomodate GDB in one
way or the other, and I was wondering if I could have a little guidance?
I have a prototype patch, which is attached. My perl fu is no longer
what it used to be, I am afraid...

What I did was modify the script to recognize a new environment variable
named MULTILINE_COMMENT_PREFIXES, which should contain a list of
strings, each separated by a new-line character. The script would
recognize each of these prefixes as starting a multi-line comment,
meaning that the next line should be spaces rather than that prefix.
Does that make some kind of sense?

For GDB, our script does would set it as follow:

    # A list of prefixes that start a multi-line comment.  These prefixes
    # should not be repeatead when wraping long lines.

(the '{' is for Pascal).

If MULTILINE_COMMENT_PREFIXES is not defined, the behavior is preserved.


Thank you,

PS: One of the suggestinos that Jim made was that we could probably
    mitigate the problem by using interface to group the years
    together.  This would help, and I would like GDB to move to that
    style anyways, but we were in the past updating the copyright year
    lazily, only when actually modifying the file. So not all years
    are going to be collapsed into one single interval. So we really
    need multi-line capabilities to work in our scenario...

Attachment: update-copyright.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]