Re: New: "cme run paste-license script" (was: Re: pasting license text into debian/copyright)
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
Reply to: