[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Savannah-hackers-public] Inclusion of GNU-statement in each source
From: |
Alex Fernandez |
Subject: |
Re: [Savannah-hackers-public] Inclusion of GNU-statement in each source file with automake/waf? |
Date: |
Tue, 6 Apr 2010 22:36:33 +0200 |
Hi Lukas,
On Tue, Apr 6, 2010 at 4:33 PM, Lukas Kaser <address@hidden> wrote:
> I just subscribed for this list, hoping that I am in the right one. Please
> don't shoot, if its not the case.
It is indeed the right place to ask.
> For a project I want to use some GNU-licensing and I am searching for a
> standarized way for the inclusion of one GNU-Statement in my source files. I
> try to avoid to put the statement by hand in every source-file and would
> like to have some automated way of doing this.
>
> Is autoheader/scan/conf or waf doing smth like this? I am new to this build
> systems.
>
> Are there better ways to solve this string-replace issue?
If you are interested in a Python solution: I found myself doing this
really boring task a few times so I built me a silly tool to do it. It
just needs a marker to know where to stop replacing, which you would
need in all of your files. I am using as a mark: "# --end--" (without
the quotes), but you can use whatever mark you have at the beginning
of your code.
Usage is trivial:
$ licensify.py licensefile [file...]
where 'licensefile' is a file that contains your license, followed by
the list of source files. I used it as:
$ licensify,py header.txt *.py
$ licensify,py header.txt **/*.py
So it caught all modules inside any directories.
It is a part of eLyXer, I have uploaded it as a script here for your
convenience.
http://www.codetrunk.com/f612e83a
Let me know if it helps!
Alex.