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

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



On 08/27/2012 11:58 PM, Vincent Cheng wrote:
> Hi Francesco,
> 
> On Mon, Aug 27, 2012 at 2:54 PM, Francesco Poli
> <invernomuto@paranoici.org> wrote:
> <snip>
>> 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


Reply to: