Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pasting license text into debian/copyright

162 views
Skip to first unread message

Thorsten Alteholz

unread,
Sep 16, 2017, 12:20:03 PM9/16/17
to
Hi everybody,

manually working on debian/copyright can be nasty from time to time.

Would extending a service like:

curl http://licapi.debian.net/template
curl http://licapi.debian.net/template/lgpl3

with all those licenses not in /usr/share/common-licenses be of any help?

Thorsten

Jonas Smedegaard

unread,
Sep 16, 2017, 1:00:02 PM9/16/17
to
Hi Thorsten,

Quoting Thorsten Alteholz (2017-09-16 18:10:16)
Not quite sure what you suggest.

It looks like you suggest to duplicate the work of SPDX - see e.g.
https://github.com/spdx/license-list

I believe that in the long term such duplication of work is not helpful,
and instead we should support SPDX in being the curators of a single
canonical repository of common Free licensing patterns in active use.

That said, I do believe that short-term some degree of competition does
help - when coordinated with SPDX. Anyone interested in that please
join the licenses-discuss mailinglist:
https://lists.alioth.debian.org/mailman/listinfo/licenses-discuss


- Jonas

--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/

[x] quote me freely [ ] ask before reusing [ ] keep private

Bastien Roucaries

unread,
Sep 16, 2017, 1:10:02 PM9/16/17
to
Will implement a lintian tag that will output statistics about not common license.

It will help to add common license
>
> Thorsten

--
Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

Thorsten Alteholz

unread,
Sep 16, 2017, 1:20:03 PM9/16/17
to
Hi Jonas,

On Sat, 16 Sep 2017, Jonas Smedegaard wrote:

> Not quite sure what you suggest.
>
> It looks like you suggest to duplicate the work of SPDX - see e.g.
> https://github.com/spdx/license-list

no, it is much simpler. I just wanted to offer the license text in a
format that is immediately usable in your debian/copyright (adding a
correct License:-line, indentation, empty lines).
The source of these texts could be of course SPDX ...

Thorsten

Thorsten Alteholz

unread,
Sep 16, 2017, 1:30:02 PM9/16/17
to


On Sat, 16 Sep 2017, Bastien Roucaries wrote:
> Will implement a lintian tag that will output statistics about not common license.
>
> It will help to add common license

yeah, that would be great.

Thorsten

Dominique Dumont

unread,
Sep 16, 2017, 1:40:03 PM9/16/17
to
On Saturday, 16 September 2017 18:10:16 CEST Thorsten Alteholz wrote:
> manually working on debian/copyright can be nasty from time to time.

What do you mean by "nasty" ? What are the painful points ?

All the best

--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org

Andrey Rahmatullin

unread,
Sep 16, 2017, 2:20:03 PM9/16/17
to
On Sat, Sep 16, 2017 at 04:47:23PM +0000, Bastien Roucaries wrote:
> Will implement a lintian tag that will output statistics about not common license.
>
> It will help to add common license
Add where? Surely not to /usr/share/common-licenses? We already have
statistics for that.

--
WBR, wRAR
signature.asc

Andrey Rahmatullin

unread,
Sep 16, 2017, 2:20:03 PM9/16/17
to
On Sat, Sep 16, 2017 at 07:15:15PM +0200, Thorsten Alteholz wrote:
> no, it is much simpler. I just wanted to offer the license text in a format
> that is immediately usable in your debian/copyright (adding a correct
> License:-line, indentation, empty lines).
Note that the "machine-readable" debian/copyright format is not the
required debian/copyright format.

--
WBR, wRAR
signature.asc

Andrey Rahmatullin

unread,
Sep 16, 2017, 2:20:03 PM9/16/17
to
On Sat, Sep 16, 2017 at 07:37:00PM +0200, Dominique Dumont wrote:
> > manually working on debian/copyright can be nasty from time to time.
>
> What do you mean by "nasty" ? What are the painful points ?
Changing a long free-form text file into a deb822 multiline block, when
you want to use the "machine-readable" format.

--
WBR, wRAR
signature.asc

Dominique Dumont

unread,
Sep 18, 2017, 11:50:03 AM9/18/17
to
On Saturday, 16 September 2017 23:13:04 CEST Andrey Rahmatullin wrote:
> Changing a long free-form text file into a deb822 multiline block, when
> you want to use the "machine-readable" format.

You can do this with cme.

Either launch cme GUI with 'cme edit dpkg-copyright'. You can paste the
license content in the tree widget on the left side. See [1] for more details

Or you can try the fuse interface:

$ cd pkg_dir
$ mkdir fuse
$ cme fusefs dpkg-copyright -fuse-dir fuse/
$ ls fuse
Comment Copyright Disclaimer Files Files-Excluded Format Global-License
License Source Upstream-Contact Upstream-Name
$ ls fuse/License/
LGPL-2.1
$ cat fuse/License/LGPL-2.1/text
This program is free software; you can redistribute it and/or modify it
[snip]
$ mkdir fuse/License/Test
$ echo "yada yada" > fuse/License/Test/text
$ fusermount -u fuse
$ git diff
diff --git a/debian/copyright b/debian/copyright
index b631507..913af34 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -18,3 +18,6 @@ License: LGPL-2.1
.
On Debian systems, the complete text of version 2.1 of the GNU Lesser
General
Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
+
+License: Test
+ yada yada

See the diff above. cme takes care of indenting and inserting '.' where
needed.

HTH

[1] https://github.com/dod38fr/config-model/wiki/Managing-Debian-packages-with-cme#maintaining-debian-copyright-file

Andreas Tille

unread,
Sep 20, 2017, 5:20:02 AM9/20/17
to
Hi Thorsten,

On Sat, Sep 16, 2017 at 07:15:15PM +0200, Thorsten Alteholz wrote:
> > It looks like you suggest to duplicate the work of SPDX - see e.g.
> > https://github.com/spdx/license-list
>
> no, it is much simpler. I just wanted to offer the license text in a format
> that is immediately usable in your debian/copyright (adding a correct
> License:-line, indentation, empty lines).
> The source of these texts could be of course SPDX ...

That sounds very convenient to me.

Kind regards

Andreas.

--
http://fam-tille.de

gregor herrmann

unread,
Sep 20, 2017, 5:30:02 AM9/20/17
to
On Wed, 20 Sep 2017 11:17:46 +0200, Andreas Tille wrote:

> > no, it is much simpler. I just wanted to offer the license text in a format
> > that is immediately usable in your debian/copyright (adding a correct
> > License:-line, indentation, empty lines).
> > The source of these texts could be of course SPDX ...
>
> That sounds very convenient to me.

+1

Alternatively/additionally we could provide them in a package
(not-so-common-licenses :)), in the original and the C-F 1.0 format,
for offline use.

Cheers,
gregor, who also hates reformatting license texts or copying them from
random places

--
.''`. https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- BOFH excuse #121: halon system went off and killed the operators.

Dominique Dumont

unread,
Sep 20, 2017, 5:40:03 AM9/20/17
to
On Wednesday, 20 September 2017 11:24:50 CEST gregor herrmann wrote:
> gregor, who also hates reformatting license texts or copying them from
> random places

I can also whip up a script based on cme that would copy the license text from
a file (or from STDIN), format it and store it in debian/copyright as a
License: paragragh

The command could look like:

cme run copy-license <license-file> <short-name>

or

wget http://url-to-license-text | cme run copy-license - short-name

All the best

Dominique Dumont

unread,
Sep 20, 2017, 11:50:03 AM9/20/17
to
On Wednesday, 20 September 2017 11:31:39 CEST Dominique Dumont wrote:
> I can also whip up a script based on cme that would copy the license text
> from a file (or from STDIN), format it and store it in debian/copyright as
> a License: paragragh

I forgot to mention the main side effect: the copyright file is re-organized,
and the dependency list are re-indented. This is not a problem if you already
use cme, but may lead to a big diff if you don't.

What do you think ?

Would such script be useful ?

Andreas Tille

unread,
Sep 21, 2017, 9:20:02 AM9/21/17
to
Hi Dominique,

On Wed, Sep 20, 2017 at 05:44:03PM +0200, Dominique Dumont wrote:
>
> I forgot to mention the main side effect: the copyright file is re-organized,
> and the dependency list are re-indented. This is not a problem if you already
> use cme, but may lead to a big diff if you don't.
>
> What do you think ?

*I* think its fine but I have heard from at least one team member who
asked me not to use cme on the packages he is Uploader for since the
identation does not fit his aesthetics.

> Would such script be useful ?

Yes, despite some people might not like some details.

Thanks a lot for your work on cme

Andreas.

--
http://fam-tille.de

Dominique Dumont

unread,
Sep 21, 2017, 9:40:04 AM9/21/17
to
On Thursday, 21 September 2017 15:17:06 CEST Andreas Tille wrote:
> I* think its fine but I have heard from at least one team member who
> asked me not to use cme on the packages he is Uploader for since the
> identation does not fit his aesthetics.

Note that I wouldn't mind changing the format details of the file generated by
cme to follow an agreed upon standard (or recommendation) that would apply to
all tools that reformat files (like cme wrap-and-sort dh-make-perl) or create
files from scratch (like some dh-make tools) .

> > Would such script be useful ?
>
> Yes, despite some people might not like some details.

Great :-)

Thanks for the feedback

gregor herrmann

unread,
Sep 21, 2017, 10:00:04 AM9/21/17
to
On Wed, 20 Sep 2017 11:31:39 +0200, Dominique Dumont wrote:

> On Wednesday, 20 September 2017 11:24:50 CEST gregor herrmann wrote:
> > gregor, who also hates reformatting license texts or copying them from
> > random places
> I can also whip up a script based on cme that would copy the license text from
> a file (or from STDIN), format it and store it in debian/copyright as a
> License: paragragh
>
> The command could look like:
>
> cme run copy-license <license-file> <short-name>

Sounds nice.

Maybe we could even have "cme run copy-license <short-name>" which
takes the text from a well-know location?


On Wed, 20 Sep 2017 17:44:03 +0200, Dominique Dumont wrote:

> I forgot to mention the main side effect: the copyright file is re-organized,
> and the dependency list are re-indented. This is not a problem if you already
> use cme, but may lead to a big diff if you don't.

I'm used to cme reformatting files, so personally I don't care about
the diff :) [0]


Cheers,
gregor


[0]
In one of my wrapper scripts I have

cme modify dpkg-control -save
git commit -a -m 'Reformat debian/control with cme' -m 'Gbp-Dch: ignore' || true

before any commands which actually change the contents of files

--
.''`. https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- BOFH excuse #362: Plasma conduit breach

Andreas Tille

unread,
Sep 21, 2017, 10:20:03 AM9/21/17
to
Hi Dominique,

On Thu, Sep 21, 2017 at 03:38:52PM +0200, Dominique Dumont wrote:
> On Thursday, 21 September 2017 15:17:06 CEST Andreas Tille wrote:
> > I* think its fine but I have heard from at least one team member who
> > asked me not to use cme on the packages he is Uploader for since the
> > identation does not fit his aesthetics.
>
> Note that I wouldn't mind changing the format details of the file generated by
> cme to follow an agreed upon standard (or recommendation) that would apply to
> all tools that reformat files (like cme wrap-and-sort dh-make-perl) or create
> files from scratch (like some dh-make tools) .

I would consider a common agreed upon standard an additional advantage.
May be if cme would have the same effect as wrap-and-sort there is at
least no disagreement between the users of both tools any more (leaving
those who are not happy with either of them :-P ).

I do not mind very much about the format as long as it is consistent
between all packages I need to touch.

> > Yes, despite some people might not like some details.
>
> Great :-)
>
> Thanks for the feedback

You are welcome

Andreas.

--
http://fam-tille.de

Dominique Dumont

unread,
Sep 28, 2017, 2:50:02 AM9/28/17
to
On Thursday, 21 September 2017 16:11:52 CEST Andreas Tille wrote:
> May be if cme would have the same effect as wrap-and-sort there is at
> least no disagreement between the users of both tools any more (leaving
> those who are not happy with either of them :-P ).

Unfortunately, wrap-and-sort has its own way of sorting: special entries (i.e.
that do not begin with letters) are sorted after "normal" entries. So
dependencies like "${misc:Depends}" are sorted after package dependencies.
Usually, sort algorithms do the reverse. May be wrap-and-sort should be called
wrap-and-sort-ish :-p

I don't really mind this weird order except emulating this requires adding yet
another special case (aka wart) to the way dpkg is handled in cme.

All the best

Andreas Tille

unread,
Sep 28, 2017, 3:30:03 AM9/28/17
to
Hi Dominique,

On Thu, Sep 28, 2017 at 08:41:38AM +0200, Dominique Dumont wrote:
>
> Unfortunately, wrap-and-sort has its own way of sorting: special entries (i.e.
> that do not begin with letters) are sorted after "normal" entries. So
> dependencies like "${misc:Depends}" are sorted after package dependencies.
> Usually, sort algorithms do the reverse. May be wrap-and-sort should be called
> wrap-and-sort-ish :-p

Huh, I'd call it worth a bug report severity minor if I would use wrap-and-sort.

Adam Borowski

unread,
Sep 28, 2017, 4:10:05 AM9/28/17
to
On Thu, Sep 28, 2017 at 08:41:38AM +0200, Dominique Dumont wrote:
> On Thursday, 21 September 2017 16:11:52 CEST Andreas Tille wrote:
> > May be if cme would have the same effect as wrap-and-sort there is at
> > least no disagreement between the users of both tools any more (leaving
> > those who are not happy with either of them :-P ).
>
> Unfortunately, wrap-and-sort has its own way of sorting: special entries (i.e.
> that do not begin with letters) are sorted after "normal" entries. So
> dependencies like "${misc:Depends}" are sorted after package dependencies.
> Usually, sort algorithms do the reverse. May be wrap-and-sort should be called
> wrap-and-sort-ish :-p

Sounds like something that improves readability a fair bit.

--
⢀⣴⠾⠻⢶⣦⠀ We domesticated dogs 36000 years ago; together we chased
⣾⠁⢰⠒⠀⣿⡁ animals, hung out and licked or scratched our private parts.
⢿⡄⠘⠷⠚⠋⠀ Cats domesticated us 9500 years ago, and immediately we got
⠈⠳⣄⠀⠀⠀⠀ agriculture, towns then cities. -- whitroth on /.

gregor herrmann

unread,
Sep 28, 2017, 10:40:02 AM9/28/17
to
On Thu, 28 Sep 2017 08:41:38 +0200, Dominique Dumont wrote:

> On Thursday, 21 September 2017 16:11:52 CEST Andreas Tille wrote:
> > May be if cme would have the same effect as wrap-and-sort there is at
> > least no disagreement between the users of both tools any more (leaving
> > those who are not happy with either of them :-P ).
> Unfortunately, wrap-and-sort has its own way of sorting: special entries (i.e.
> that do not begin with letters) are sorted after "normal" entries. So
> dependencies like "${misc:Depends}" are sorted after package dependencies.
> Usually, sort algorithms do the reverse. May be wrap-and-sort should be called
> wrap-and-sort-ish :-p

Ack, and I have to admit that I find this a bit annoying.

> I don't really mind this weird order except emulating this requires adding yet
> another special case (aka wart) to the way dpkg is handled in cme.

I'd rather see wrap-and-sort adjust to cme in this case.
(Or wrap-and-sort being replaced by a wrapper which just uses cme.)


Cheers,
gregor

--
.''`. https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Mark Knopfler: The Mist Covered Mountains
signature.asc

Dominique Dumont

unread,
Oct 16, 2017, 1:20:03 PM10/16/17
to
[ Sorry for the late reply on this point. I did miss it when I read you mail ]

On Thursday, 21 September 2017 15:53:11 CEST gregor herrmann wrote:
> Maybe we could even have "cme run copy-license <short-name>" which
> takes the text from a well-know location?


Assuming "well-known" means part of Software::License module, you can already
do something like:

$ cme modify 'dpkg-copyright License:"Apache-2.0"' -save

(the -save option is required due to a bug in Config::Model::AnyId. This will
be fixed soon)

I hope that Software::License has enough licenses to cover most of the needs.

Dominique Dumont

unread,
Oct 17, 2017, 7:30:02 AM10/17/17
to
Hi

People have complained that adding license text in debian/copyright file is
tedious.

To avoid this problem, libconfig-model-dpkg-perl 2.102 now ships a new cme
script to copy a license text in debian/copyright. This script is run with
"cme run" command [1]

For instance:

$ echo -e "blah\n\nblah\n\nblah" > my-lic.txt
$ cme run paste-license --arg license=MyTest --arg file=my-lic.txt
cme: using Dpkg::Copyright model
License MyTest is not used in Files: section

Changes applied to dpkg-copyright configuration:
- License:MyTest text:
@@ -1 +1,5 @@
-<undef>
+blah
+
+blah
+
+blah

$ git diff
diff --git a/debian/copyright b/debian/copyright
index 60bf1722..6e85dadb 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -22,3 +22,10 @@ License: LGPL-2.1+
License, or (at your option) any later version.
On Debian GNU/Linux systems, the complete text of version 2.1 of the GNU
Lesser General Public License can be found in `/usr/share/common-
licenses/LGPL-2.1'
+
+License: MyTest
+ blah
+ .
+ blah
+ .
+ blah

The doc specific to this script is shown with -doc option:

$ cme run paste-license --doc
paste license text in License paragraph
paste file: cme run paste-license --arg license=Expat --arg file=MIT.txt
paste STDIN: cat MIT.txt | cme run paste-license --arg license=Expat

Please ignore a warning message about missing initialisation of Log4Perl. This
is harmless and will be fixed soon.

I hope this command will be useful to help you in your packaging activities.

All the best

[1] https://manpages.debian.org/testing/cme/App::Cme::Command::run.3pm.en.html

Andreas Tille

unread,
Oct 21, 2017, 10:30:02 AM10/21/17
to
Hi Dominique,

I wanted to try this cool feature but failed may be I did something wrong:

$ gbp clone https://anonscm.debian.org/git/debian-med/beads.git
$ cd beads
beads(master) $ cme run paste-license --arg license=CeCILL --arg COPYING
Log4perl: Seems like no initialization happened. Forgot to call init()?
Odd number of elements in hash assignment at /usr/share/perl5/App/Cme/Command/run.pm line 110.
cme: using Dpkg::Copyright model
Warning: Files:"*" License short_name skipping value CeCILL because of the following errors:
license 'CeCILL' is not declared in main License section. Expected

Warning: Files:"debian/*" License short_name skipping value CeCILL because of the following errors:
license 'CeCILL' is not declared in main License section. Expected

License CeCILL is not used in Files: section

^C


I needed to ^C since cme did not finished otherwise.

Am I doing something wrong or is there some issue with this new
cool feature?

Kind regards

Andreas.
--
http://fam-tille.de

gregor herrmann

unread,
Oct 21, 2017, 12:50:03 PM10/21/17
to
On Sat, 21 Oct 2017 16:20:58 +0200, Andreas Tille wrote:

> $ gbp clone https://anonscm.debian.org/git/debian-med/beads.git
> $ cd beads
> beads(master) $ cme run paste-license --arg license=CeCILL --arg COPYING

% cme run paste-license --arg license=CeCILL --arg file=COPYING

seems to work; note the "file=" part as in dod's original mail:

> On Tue, Oct 17, 2017 at 01:20:15PM +0200, Dominique Dumont wrote:
> > $ cme run paste-license --arg license=MyTest --arg file=my-lic.txt



Cheers,
gregor

--
.''`. https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Flying Pickets: Only You
signature.asc

gregor herrmann

unread,
Oct 21, 2017, 12:50:03 PM10/21/17
to
On Mon, 16 Oct 2017 19:11:50 +0200, Dominique Dumont wrote:

> On Thursday, 21 September 2017 15:53:11 CEST gregor herrmann wrote:
> > Maybe we could even have "cme run copy-license <short-name>" which
> > takes the text from a well-know location?
> Assuming "well-known" means part of Software::License module, you can already
> do something like:
> $ cme modify 'dpkg-copyright License:"Apache-2.0"' -save

Nice; thank you!

(For those reading along at home: The quoting needs to be slightly
changed:
% cme modify dpkg-copyright 'License:"Apache-2.0"' -save
)


Cheers,
gregor

--
.''`. https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
signature.asc

Andreas Tille

unread,
Oct 22, 2017, 3:00:02 AM10/22/17
to
On Sat, Oct 21, 2017 at 06:40:37PM +0200, gregor herrmann wrote:
> On Sat, 21 Oct 2017 16:20:58 +0200, Andreas Tille wrote:
>
> > $ gbp clone https://anonscm.debian.org/git/debian-med/beads.git
> > $ cd beads
> > beads(master) $ cme run paste-license --arg license=CeCILL --arg COPYING
>
> % cme run paste-license --arg license=CeCILL --arg file=COPYING
>
> seems to work; note the "file=" part as in dod's original mail:

Well, OK, when I do not miss the "file=" part I can do

$ cme run paste-license --arg license=CeCILL --arg file=COPYING > copyright.patch
Log4perl: Seems like no initialization happened. Forgot to call init()?
Warning: Files:"*" License short_name skipping value CeCILL because of the following errors:
license 'CeCILL' is not declared in main License section. Expected

Warning: Files:"debian/*" License short_name skipping value CeCILL because of the following errors:
license 'CeCILL' is not declared in main License section. Expected

License CeCILL is not used in Files: section
Configuration item 'Files:"*" License short_name' has a wrong value:
Undefined mandatory value.


I admit I do not really understand all the output to stderr. The output
to stdout (in my example redirected to copyright.patch) is


--
hanges applied to dpkg-copyright configuration:
- License:CeCILL text:
@@ -1 +1,505 @@
-<undef>
+CeCILL FREE SOFTWARE LICENSE AGREEMENT
+
+
+ Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+ * firstly, compliance with the principles governing the distribution
...


So this does not really help since its neither a valid patch for
d/copyright nor can I add this content there without editing. It just
added a '+' to the original license text which is not really helpful.
May be I'm continuously missing the point but shouldn't it add rather
a ' ' instead of a '+' and replace empty lines by ' .'?

Kind regards

Andreas.

Dominique Dumont

unread,
Oct 22, 2017, 5:20:03 AM10/22/17
to
On Sunday, 22 October 2017 08:55:44 CEST Andreas Tille wrote:
> $ cme run paste-license --arg license=CeCILL --arg file=COPYING >
> copyright.patch Log4perl: Seems like no initialization happened. Forgot to
> call init()?

That's a bug in cme that will be fixed soon.

> Warning: Files:"*" License short_name skipping value CeCILL
> because of the following errors: license 'CeCILL' is not declared in main
> License section. Expected

Looks like you copyright file already has
Files: *
License: CeCiLL

without the matching section in Licenses (the one you trying to add). cme
emits a warning when reading a copyright file with this error. This value is
ignored because of this error.

> Warning: Files:"debian/*" License short_name skipping value CeCILL because
> of the following errors: license 'CeCILL' is not declared in main License
> section. Expected

Likewise.

> License CeCILL is not used in Files: section

The new added license is seen as unused because the CeCILL values were ignored
above. (*)

> Configuration item 'Files:"*" License short_name' has a wrong value:
> Undefined mandatory value.

This is an error shown while writing the file. cme does not accept to write
back a copyright file containing errors. The values are missing because, err,
they were ignored above because, err, the main license was missing.

I guess that error handling in cme can be improved ...

> I admit I do not really understand all the output to stderr.

I hope I gave some clue above ...

> The output
> to stdout

The fact that stdout is redirect makes the errors above harder to understand.

> (in my example redirected to copyright.patch) is

err. it never occurred to me that someone could feed cme output to patch ....

> So this does not really help since its neither a valid patch for
> d/copyright nor can I add this content there without editing. It just
> added a '+' to the original license text which is not really helpful.
> May be I'm continuously missing the point but shouldn't it add rather
> a ' ' instead of a '+' and replace empty lines by ' .'?

cme should write debian/copyright provided no error is left.

Following Perl's TIMTOWTDI tradition, I suggest to fix this problem by either:

- use -force option with cme and add back the License entries after cme has
saved the file
- use the GUI (cme edit dpkg-copyright) and cut'n'paste CeCILL license text in
the License section (see [1] for details)
- tweak your file so that cme check returns no warning before running paste-
license
- fix everything at once with: cme modify dpkg-copyright -force 'License:CeCILL
text=.file(COPYING) ! Files:"*" License short_name=CeCILL Files:"debian/*"
License short_name=CeCILL'

Hope this helps

Dod

[1] https://github.com/dod38fr/config-model/wiki/Managing-Debian-packages-with-cme#maintaining-debian-copyright-file

(*) I always wondered if an erroneous value found in a file should be ignored
or loaded. I've chosen the first option, which leads to the cascading errors
you've found. I guess that I should implement the second option at least when
-force option is used.

Andreas Tille

unread,
Oct 22, 2017, 6:20:02 AM10/22/17
to
On Sun, Oct 22, 2017 at 11:14:04AM +0200, Dominique Dumont wrote:
> On Sunday, 22 October 2017 08:55:44 CEST Andreas Tille wrote:
> > $ cme run paste-license --arg license=CeCILL --arg file=COPYING >
> > copyright.patch Log4perl: Seems like no initialization happened. Forgot to
> > call init()?
>
> That's a bug in cme that will be fixed soon.

OK.

> > Warning: Files:"*" License short_name skipping value CeCILL
> > because of the following errors: license 'CeCILL' is not declared in main
> > License section. Expected
>
> Looks like you copyright file already has
> Files: *
> License: CeCiLL
>
> without the matching section in Licenses (the one you trying to add). cme
> emits a warning when reading a copyright file with this error. This value is
> ignored because of this error.

Sorry, I do not understand. I the string CeCILL (with capital I) is in the
main license section. Could you please be more verbose how d/copyright needs
to look like to make cme add the license text?

> > Warning: Files:"debian/*" License short_name skipping value CeCILL because
> > of the following errors: license 'CeCILL' is not declared in main License
> > section. Expected
>
> Likewise.

Likewise I fail to understand. ;-)

> > License CeCILL is not used in Files: section
>
> The new added license is seen as unused because the CeCILL values were ignored
> above. (*)
>
> > Configuration item 'Files:"*" License short_name' has a wrong value:
> > Undefined mandatory value.
>
> This is an error shown while writing the file. cme does not accept to write
> back a copyright file containing errors. The values are missing because, err,
> they were ignored above because, err, the main license was missing.
>
> I guess that error handling in cme can be improved ...

Yes please. I'd be really happy if you could push a d/copyright that is
correctly formed to let cme work.

> > I admit I do not really understand all the output to stderr.
>
> I hope I gave some clue above ...

Not really - but it might be probably me. ;-)

> > The output
> > to stdout
>
> The fact that stdout is redirect makes the errors above harder to understand.

I redirected simply for this mail here ...

> > (in my example redirected to copyright.patch) is
>
> err. it never occurred to me that someone could feed cme output to patch ....

Yes, I had this clue only since the first column '+' is a feature
frequently used in patch. Just a wild guess of mine.

> > So this does not really help since its neither a valid patch for
> > d/copyright nor can I add this content there without editing. It just
> > added a '+' to the original license text which is not really helpful.
> > May be I'm continuously missing the point but shouldn't it add rather
> > a ' ' instead of a '+' and replace empty lines by ' .'?
>
> cme should write debian/copyright provided no error is left.

That's what I'd prefer.

> Following Perl's TIMTOWTDI tradition, I suggest to fix this problem by either:
>
> - use -force option with cme and add back the License entries after cme has
> saved the file
> - use the GUI (cme edit dpkg-copyright) and cut'n'paste CeCILL license text in
> the License section (see [1] for details)

I admit I do not really like that GUI.

> - tweak your file so that cme check returns no warning before running paste-
> license
> - fix everything at once with: cme modify dpkg-copyright -force 'License:CeCILL
> text=.file(COPYING) ! Files:"*" License short_name=CeCILL Files:"debian/*"
> License short_name=CeCILL'

$ cme modify dpkg-copyright -force 'License:CeCILL text=.file(COPYING) ! Files:"*" License short_name=CeCILL Files:"debian/*" License short_name=CeCILL'
cme: using Dpkg::Copyright model
Warning: Files:"*" License short_name skipping value CeCILL because of the following errors:
license 'CeCILL' is not declared in main License section. Expected

Warning: Files:"debian/*" License short_name skipping value CeCILL because of the following errors:
license 'CeCILL' is not declared in main License section. Expected

License CeCILL is not used in Files: section
object 'Files:"*" License' error: unknown element 'Files'. Either your file has an error or Dpkg::Copyright::FileLicense model is lagging behind. In the latter case, please submit a bug report using 'reportbug libconfig-model-dpkg-perl'. See cme man page for details.
Expected elements: 'full_license','short_name'


Hmmm, sorry, no change to d/copyright.

> Hope this helps

No, sorry, I seem I totally fail to understand. Why exactly can't cme
simply copy the text that is specified as CeCILL into my copyright?

Sorry for my probably very naive questions but obviously I do not
understand the philosphy behind.

Kind regards

Andreas.

> [1] https://github.com/dod38fr/config-model/wiki/Managing-Debian-packages-with-cme#maintaining-debian-copyright-file
>
> (*) I always wondered if an erroneous value found in a file should be ignored
> or loaded. I've chosen the first option, which leads to the cascading errors
> you've found. I guess that I should implement the second option at least when
> -force option is used.
>
> --
> https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
> http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
>
>

--
http://fam-tille.de

Dominique Dumont

unread,
Oct 22, 2017, 1:40:02 PM10/22/17
to
On Sunday, 22 October 2017 12:10:29 CEST Andreas Tille wrote:
> > without the matching section in Licenses (the one you trying to add). cme
> > emits a warning when reading a copyright file with this error. This value
> > is ignored because of this error.
>
> Sorry, I do not understand. I the string CeCILL (with capital I) is in the
> main license section. Could you please be more verbose how d/copyright
> needs to look like to make cme add the license text?

Uh ? From a fresh git clone of beads, cat debian/copyright shows:

+++++
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: BEADS
Upstream-Contact: Olivier Langella <olivier....@moulon.inra.fr>
Source: http://pappso.inra.fr/bioinfo/beads/index.php
Files-Excluded: */CImg.h

Files: *
Copyright: 2008-2010 Michel Zivy <zi...@moulon.inra.fr>, Olivier Langella
<olivier....@moulon.inra.fr>
License: CeCILL

Files: debian/*
Copyright: Andreas Tille <ti...@debian.org>
License: CeCILL
++++

There's no main CeCILL section.

And cme complains:
$ cme check dpkg-copyright
cme: using Dpkg::Copyright model
loading data
Configuration item 'Files:"*" License short_name' has a wrong value:
license 'CeCILL' is not declared in main License section. Expected

Admitedly, the error message is lackluster when main License section is empty.
This will be fixed.

> > > Warning: Files:"debian/*" License short_name skipping value CeCILL
> > > because
> > > of the following errors: license 'CeCILL' is not declared in main
> > > License
> > > section. Expected
> >
> > Likewise.
>
> Likewise I fail to understand. ;-)

Duh ;-)

> Yes please. I'd be really happy if you could push a d/copyright that is
> correctly formed to let cme work.

I hope that won't be necessary. See below.

> I redirected simply for this mail here ...

Fair enough.

> > err. it never occurred to me that someone could feed cme output to patch
> > ....
> Yes, I had this clue only since the first column '+' is a feature
> frequently used in patch. Just a wild guess of mine.

It's just that cme uses a diff to show the delta between old and new value.
It's not supposed to be used as a patch. May be I should just display a
"changed" message when summarising the changes applied to a text parameter.

> > cme should write debian/copyright provided no error is left.
>
> That's what I'd prefer.

So we have a common goal :)

> I admit I do not really like that GUI.

I'm open to idea on how to improve the GUI while keeping it generic for the
other models supported by cme (e.g ssh systemd itself ...)

> $ cme modify dpkg-copyright -force 'License:CeCILL text=.file(COPYING) !
> Files:"*" License short_name=CeCILL Files:"debian/*" License
> short_name=CeCILL' cme: using Dpkg::Copyright model
> Warning: Files:"*" License short_name skipping value CeCILL because of the
> following errors: license 'CeCILL' is not declared in main License section.
[snip]
> Hmmm, sorry, no change to d/copyright.

Sorry, my bad. I dropped a '!' during cut'n'paste.

Here's the right command tested on beads repo:

$ cme modify dpkg-copyright -force 'License:CeCILL text=.file(COPYING) !
Files:"*" License short_name=CeCILL ! Files:"debian/*" License
short_name=CeCILL'
[ snip ]
$ git diff --stat
debian/copyright | 508 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 507 insertions(+), 1 deletion(-)


> No, sorry, I seem I totally fail to understand. Why exactly can't cme
> simply copy the text that is specified as CeCILL into my copyright?

It did so, but refused to write the output due to errors.

> Sorry for my probably very naive questions but obviously I do not
> understand the philosphy behind.

No problem. cme tries to address a very complicated problem and can be
confusing when dealing with corner cases.

Thanks for your patience and questions. This is invaluable to improve the
usability of cme. :-)

All the best

Dod

Andreas Tille

unread,
Oct 22, 2017, 3:50:02 PM10/22/17
to
Hi Dominique,

On Sun, Oct 22, 2017 at 07:39:10PM +0200, Dominique Dumont wrote:
> >
> > Sorry, I do not understand. I the string CeCILL (with capital I) is in the
> > main license section. Could you please be more verbose how d/copyright
> > needs to look like to make cme add the license text?
>
> Uh ? From a fresh git clone of beads, cat debian/copyright shows:
>
> +++++
> Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
> Upstream-Name: BEADS
> Upstream-Contact: Olivier Langella <olivier....@moulon.inra.fr>
> Source: http://pappso.inra.fr/bioinfo/beads/index.php
> Files-Excluded: */CImg.h
>
> Files: *
> Copyright: 2008-2010 Michel Zivy <zi...@moulon.inra.fr>, Olivier Langella
> <olivier....@moulon.inra.fr>
> License: CeCILL
>
> Files: debian/*
> Copyright: Andreas Tille <ti...@debian.org>
> License: CeCILL
> ++++
>
> There's no main CeCILL section.

Could you please explain what you mean by "main section"? For me

Files: *

would qualify as "main section" but you seem to have a different
understanding of this term.

> And cme complains:
> $ cme check dpkg-copyright
> cme: using Dpkg::Copyright model
> loading data
> Configuration item 'Files:"*" License short_name' has a wrong value:
> license 'CeCILL' is not declared in main License section. Expected
>
> Admitedly, the error message is lackluster when main License section is empty.
> This will be fixed.

:-)

> It's just that cme uses a diff to show the delta between old and new value.
> It's not supposed to be used as a patch. May be I should just display a
> "changed" message when summarising the changes applied to a text parameter.

I think that's a more helpful output.

> > > cme should write debian/copyright provided no error is left.
> >
> > That's what I'd prefer.
>
> So we have a common goal :)

:-)

> > I admit I do not really like that GUI.
>
> I'm open to idea on how to improve the GUI while keeping it generic for the
> other models supported by cme (e.g ssh systemd itself ...)

I don't say that the GUI is bad - I just prefer a command line tool for
this job.

> > $ cme modify dpkg-copyright -force 'License:CeCILL text=.file(COPYING) !
> > Files:"*" License short_name=CeCILL Files:"debian/*" License
> > short_name=CeCILL' cme: using Dpkg::Copyright model
> > Warning: Files:"*" License short_name skipping value CeCILL because of the
> > following errors: license 'CeCILL' is not declared in main License section.
> [snip]
> > Hmmm, sorry, no change to d/copyright.
>
> Sorry, my bad. I dropped a '!' during cut'n'paste.
>
> Here's the right command tested on beads repo:
>
> $ cme modify dpkg-copyright -force 'License:CeCILL text=.file(COPYING) !
> Files:"*" License short_name=CeCILL ! Files:"debian/*" License
> short_name=CeCILL'

Ahhh, this helps. :-)
I just would love a way shorter command line since I somehow will never
remember this one. :-P

> $ git diff --stat
> debian/copyright | 508 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 507 insertions(+), 1 deletion(-)

> > No, sorry, I seem I totally fail to understand. Why exactly can't cme
> > simply copy the text that is specified as CeCILL into my copyright?
>
> It did so, but refused to write the output due to errors.
>
> > Sorry for my probably very naive questions but obviously I do not
> > understand the philosphy behind.
>
> No problem. cme tries to address a very complicated problem and can be
> confusing when dealing with corner cases.

Just to let me understand better: I understood this thread that way
that creating the license text in a proper form is a goal of this
specific cme option. In how far is the problem above a corner case.

> Thanks for your patience and questions. This is invaluable to improve the
> usability of cme. :-)

You are welcome - the thanks goes to you who does all the coding work

Andreas.

--
http://fam-tille.de

Pirate Praveen

unread,
Oct 23, 2017, 4:00:02 AM10/23/17
to
On ഞായര്‍ 22 ഒക്ടോബര്‍ 2017 11:09 വൈകു, Dominique Dumont wrote:
> No problem. cme tries to address a very complicated problem and can be
> confusing when dealing with corner cases.

I tried this today and it worked mostly. Thanks for doing the major part
already (the actual formatting part).

Original copyright file,

______________________________
Files: *
Copyright: 2017 Mozilla Developer Network
License: MPL-2.0

Files: debian/*
Copyright: 2017 Pirate Praveen <pra...@debian.org>
License: MPL-2.0
______________________________

cme run paste-license --arg license=MPL-2.0 --arg file=LICENSE --force

I think cme should not require --force here as earlier License: MPL-2.0
lines have empty license text and cme should not remove those lines in
the final output (I have to add back 'License: MPL-2.0' lines removed by
cme).

git diff after cme run,

______________________________
diff --git a/debian/copyright b/debian/copyright
index 94e94df..b5f7980 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,10 +5,381 @@ Source: https://developer.mozilla.org

Files: *
Copyright: 2017 Mozilla Developer Network
-License: MPL-2.0

Files: debian/*
Copyright: 2017 Pirate Praveen <pra...@debian.org>
-License: MPL-2.0

+License: MPL-2.0
+ Mozilla Public License Version 2.0
+ ==================================

[...]
______________________________

Note: I know MPL 2.0 is now part of common licenses but I wanted to try
cme as npm2deb did not create the correct copyright file in this case.

signature.asc

Dominique Dumont

unread,
Oct 23, 2017, 11:40:04 AM10/23/17
to
On Sunday, 22 October 2017 21:47:12 CEST Andreas Tille wrote:
> Could you please explain what you mean by "main section"? For me
>
> Files: *
>
> would qualify as "main section" but you seem to have a different
> understanding of this term.

ok. Let's use the same terminology as debian/copyright. I meant the section
made of one or more "Stand-alone License paragraph" [1] . This one was
missing from the file, the CeCILL license was not defined, hence the file was
considered as invalid by cme.

> > May be I should just display a
> > "changed" message when summarising the changes applied to a text
> > parameter.
>
> I think that's a more helpful output.

ok. Will do.

> I don't say that the GUI is bad - I just prefer a command line tool for
> this job.

ok. fair enough.


> > $ cme modify dpkg-copyright -force 'License:CeCILL text=.file(COPYING) !
> > Files:"*" License short_name=CeCILL ! Files:"debian/*" License
> > short_name=CeCILL'
>
> Ahhh, this helps. :-)
> I just would love a way shorter command line since I somehow will never
> remember this one. :-P

You should be able to use paste-license script in you add first the License
text as a standalone paragraph (using paste-license), *then* add the Files:*
paragraphs.

> Just to let me understand better: I understood this thread that way
> that creating the license text in a proper form is a goal of this
> specific cme option. In how far is the problem above a corner case.

It's a corner case because you started from an copyright file that is considred
invalid by cme because it lacks the standalone license paragraph that defines
CeCILL license text).

This challenges the way error tolerance is done in cme, which is not much
tested yet.

All the best

Dod

[1] https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#stand-alone-license-paragraph

Dominique Dumont

unread,
Oct 23, 2017, 1:00:03 PM10/23/17
to
On Monday, 23 October 2017 13:27:48 CEST Pirate Praveen wrote:
> On ഞായര്‍ 22 ഒക്ടോബര്‍ 2017 11:09 വൈകു, Dominique Dumont wrote:
> I tried this today and it worked mostly. Thanks for doing the major part
> already (the actual formatting part).

You're welcome :-)

> I think cme should not require --force here as earlier License: MPL-2.0
> lines have empty license text and cme should not remove those lines in
> the final output (I have to add back 'License: MPL-2.0' lines removed by
> cme).

Agreed -> https://github.com/dod38fr/config-model/issues/15

> Note: I know MPL 2.0 is now part of common licenses but I wanted to try
> cme as npm2deb did not create the correct copyright file in this case.

have you tried "cme update dpkg-copyright" ?

All the best
0 new messages