Re: How to write a machine-readable debian/copyright file?

2012-08-28 Thread Francesco Poli
On Mon, 27 Aug 2012 14:58:46 -0700 Vincent Cheng wrote:

[...]
> On Mon, Aug 27, 2012 at 2:54 PM, Francesco Poli
>  wrote:
> 
> > So the question is: is there any general purpose tool that scans a
> > directory tree, detects the copyright notice and license of each file,
> > reorganizes and groups everything, and writes a machine-readable
> > debian/copyright file?
> 
> Is this what you are looking for?
> 
> $ licensecheck --copyright -r . | /usr/lib/cdbs/licensecheck2dep5 >
> debian/copyright

Mmmmh, interesting... I'll give it a try!
Thank you very much for your kind reply.

I see on the debian-mentors web archive that Michael Wild suggested to
relax the file selection regex, which seems to be definitely important
(the default seems to be too narrow, maybe it should change?).
I'll try

  $ licensecheck --copyright -r . -c . | \
/usr/lib/cdbs/licensecheck2dep5 > /tmp/copyright

and then check/edit the resulting output...

> 
> You definitely still need to manually check the copyright file
> afterwards for any errors, of course.

Definitely...
Among other things, I see that the output of licensecheck2dep5 is not
even fully compliant with the standard format (see bug #633794).


By the way, as soon as I noticed that licensecheck2dep5 is part of the
cdbs package, I wondered why it was not part of devscripts (which looks
like the most obvious package where this tool should be shipped).
Even better, I think it should be integrated as a possible output
format for licensecheck itself...

Well, it seems that I am not the only one with this opinion.
In bug #472199, a number of different people asked for this feature to
be implemented in licensecheck and some also attempted to prepare
patches. Then Jonas Smedegaard (the author of licensecheck2dep5)
expressed the intention to integrate this capability into licensecheck.
Unfortunately there seems to be no visible progress since August 2010...
I'll maybe try to ping Jonas and ask him for an update.


Anyway, thanks again for your helpful answer.
I'll try and see whether licensecheck2dep5 may fit my needs.

Bye.


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpc959G9aAoH.pgp
Description: PGP signature


Re: How to write a machine-readable debian/copyright file?

2012-08-28 Thread Michael Wild
On 08/27/2012 11:58 PM, Vincent Cheng wrote:
> Hi Francesco,
> 
> On Mon, Aug 27, 2012 at 2:54 PM, Francesco Poli
>  wrote:
> 
>> So the question is: is there any general purpose tool that scans a
>> directory tree, detects the copyright notice and license of each file,
>> reorganizes and groups everything, and writes a machine-readable
>> debian/copyright file?
> 
> Is this what you are looking for?
> 
> $ licensecheck --copyright -r . | /usr/lib/cdbs/licensecheck2dep5 >
> debian/copyright
> 
> You definitely still need to manually check the copyright file
> afterwards for any errors, of course.
> 
> Regards,
> Vincent
> 
> 

Also note that you might want to pass suitable -c options to
licensecheck, since not only "common source files" contain copyright
statements.

The current default regex is

\.(c(c|pp|xx)?|h(h|pp|xx)?|f(77|90)?|p(l|m)|xs|sh|php|py|rb|java|vala|el|sc(i|e)|cs|pas|inc|dtd|xsl|mod)$

which is by no means complete, IMHO. E.g. it completely misses source
types commonly used for the documentation (.tex, .texi, .xml, .ent,
.txt, .md, .rst, .svg, .asy, .fig and many more), but also less common
source extensions are left out, such as .C and .H for projects that
started off when cfront was all the rage and also build systems are
ignored (e.g. Makefile, makefile, GNUmakefile, .mk, .cmake, etc.) and
especially Debian maintainers should know the importance of the
latter... *cough-cdrecord-cough*.


Michael


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/503c776a.8020...@gmail.com



Re: How to write a machine-readable debian/copyright file?

2012-08-27 Thread Vincent Cheng
Hi Francesco,

On Mon, Aug 27, 2012 at 2:54 PM, Francesco Poli
 wrote:

> So the question is: is there any general purpose tool that scans a
> directory tree, detects the copyright notice and license of each file,
> reorganizes and groups everything, and writes a machine-readable
> debian/copyright file?

Is this what you are looking for?

$ licensecheck --copyright -r . | /usr/lib/cdbs/licensecheck2dep5 >
debian/copyright

You definitely still need to manually check the copyright file
afterwards for any errors, of course.

Regards,
Vincent


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caczd_tdqay4sio7oxuviq83cph_9wra1uvt9ms4crb2i9cu...@mail.gmail.com