#1021957 please implement an option to ignore the very existence of some files in the source tree

#1021957#5
Date:
2022-08-13 17:08:48 UTC
From:
To:
Hello,
first of all, thanks for maintaining this useful package!

I have just used decopy to convert my package 'apt-listbugs' to the
machine-readable debian/copyright file format, as you can see in
a recent [commit].

[commit]: <https://salsa.debian.org/frx-guest/apt-listbugs/-/tree/cf1889368bbb7ed4acbc6e59c27dc1a961c632f5>

Please note that I also added a phony target in the Makefile to regenerate
the debian/copyright file, by using the debian/copyright file itself
as the base for the processing.
If you clone the git repository at the above-mentioned [commit], you can
check for yourself that the command:

  $ make debian-copyright

regenerates a debian/copyright file identical to the version stored
in the [commit] itself.

So far, so good.

However, I wanted to split out a separate paragraph for po/* files,
since they have a special situation (copyright held by their respective
authors/translators, to be looked at in each file; license statement
that only indirectly refers to the GNU GPL v2 or later).

I tried the following.

I applied the following patch to the Makefile:

  diff --git a/Makefile b/Makefile
  index e558296..1037853 100644
  --- a/Makefile
  +++ b/Makefile
  @@ -3,7 +3,7 @@ MOFILES := $(patsubst %.po,%.mo,$(wildcard po/*.po))
   VERSION := $(shell dpkg-parsechangelog -SVersion)
   YEAR := $(shell dpkg-parsechangelog -SDate | cut -d ' ' -f 4)

  -CEX := po/
  +CEX := po/.*\.mo
   CEX := $(CEX)|apt-listbugs\.1
   CEX := $(CEX)|debian/\.debhelper/
   CEX := $(CEX)|debian/debhelper-build-stamp

And I manually modified the debian/copyright file as follows:

  Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
  Source: https://salsa.debian.org/frx-guest/apt-listbugs
https://ftp.debian.org/debian/pool/main/a/apt-listbugs/

  Files: *
  Copyright: 2007, Famelis George <famelis@otenet.gr>
             2008-2022, Francesco Poli <invernomuto@paranoici.org>
             2013, Google Inc
             2007, Jean Lepropre <jlepropre@gmail.com>
             2006-2008, Junichi Uekawa <dancer@debian.org>
             2012, Justin B Rye <jbr@edlug.org.uk>
             2002-2004, Masato Taruishi <taru@debian.org>
             2009-2010, Ryan Niebur <ryan@debian.org>
  License: GPL-2+

  Files: po/*
  Copyright: 2002-2020, Masato Taruishi et al.
  License: apt-listbugs-license
  Comment: copyright of each file is held by the respective authors/translators

  Files: debian/*
  Copyright: 2008-2022, Francesco Poli <invernomuto@paranoici.org>
             2006-2009, Junichi Uekawa <dancer@debian.org>
             2002-2005, Masato Taruishi <taru@debian.org>
             2009-2010, Ryan Niebur <ryan@debian.org>
  License: GPL-2+

  License: GPL-2+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   .
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   .
   You should have received a copy of the GNU General Public License with
   the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2;
   if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

  License: apt-listbugs-license
   This file is distributed under the same license as the apt-listbugs package.

Honestly, I expected that decopy would abide by this new base copyright
file and regenerate an identical debian/copyright file.

To my surprise, it instead generated the following debian/copyright file:

  Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
  Source: https://salsa.debian.org/frx-guest/apt-listbugs
https://ftp.debian.org/debian/pool/main/a/apt-listbugs/

  Files: *
  Copyright: 2002-2020, Masato Taruishi
             2002-2020, Masato Taruishi et al
  License: apt-listbugs-license
  Comment: copyright of each file is held by the respective authors/translators

  Files: 10apt-listbugs
         FAQ.md
         Makefile
         README.md
         apt-listbugs.1
         bin/*
         bug-list.css
         examples/*
         git-tag.sh
         ignore_bugs
         lib/*
         libexec/*
         test/*
  Copyright: 2007, Famelis George <famelis@otenet.gr>
             2008-2022, Francesco Poli <invernomuto@paranoici.org>
             2013, Google Inc
             2007, Jean Lepropre <jlepropre@gmail.com>
             2006-2008, Junichi Uekawa <dancer@debian.org>
             2012, Justin B Rye <jbr@edlug.org.uk>
             2002-2004, Masato Taruishi <taru@debian.org>
             2009-2010, Ryan Niebur <ryan@debian.org>
  License: GPL-2+

  Files: debian/*
  Copyright: 2008-2022, Francesco Poli <invernomuto@paranoici.org>
             2006-2009, Junichi Uekawa <dancer@debian.org>
             2002-2005, Masato Taruishi <taru@debian.org>
             2009-2010, Ryan Niebur <ryan@debian.org>
  License: GPL-2+

  License: GPL-2+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   .
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   .
   You should have received a copy of the GNU General Public License with
   the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2;
   if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

  License: apt-listbugs-license
   This file is distributed under the same license as the apt-listbugs package.

Well, this looks (almost) technically correct, but actually
wrong for a number of reasons.

Firstly, decopy decided that the license for po/* applies to * !!!
After doing so, it decided that the license for * applies to a
number of special cases, which are, well, everything that is not
po/* (and not debian/* )...
This could be considered to be technically correct, but kinda
misrepresents the actual licensing status of the package: anyone
who is not too familiar with apt-listbugs source tree, could be
misled to think that the majority of the files are under
"apt-listbugs-license", while only some special cases are under
GPL-2+.
In reality, all files are under GPL-2+, except for po/*, which
are under "apt-listbugs-license" (which is actually an indirect
reference to GPL-2+).

Then, I see that apt-listbugs.1 is listed among the special cases.
But that file is generated, and I thought it was excluded through
the --exclude option of decopy. Apparently, it is not! Why?

Finally, I fail to understand where the "2002-2020, Masato Taruishi"
additional Copyright come from.
It seems to me that every copyright notice referring to Masato Taruishi
in the source tree is either followed by his e-mail address or by "et al.".
So where does this additional Copyright come from?


Please try and reproduce this (mis)behavior of decopy and fix the
bug(s) and/or clarify where I am misusing the tool.

Thanks a lot for your time and patience!

#1021957#10
Date:
2022-09-23 20:02:25 UTC
From:
To:
Hi Francesco,

* Francesco Poli (wintermute) <invernomuto@paranoici.org> [2022-08-13 19:08]:

This includes the po/*.po in the file list which where excluded,
previously.

It works just fine if you do a debclean before generating it.

Yes and I think that's all you can ask for for such a tool. To me decopy
is a good first step to create a d/copyright file but it always need
some human eyes.

I don't know all the decopy code but I think it has some heuristics for
which copyright block should be the top one.

I guess exclude is only for the content not for the file list. Maybe
that's what meant in #997814..

decopy strips the et al.:

https://sources.debian.org/src/decopy/0.2.4.7-0.2/decopy/res.py/#L509

So with the Makefile change above the .po files are searched again and
the entry is added.

Cheers Jochen

#1021957#15
Date:
2022-09-28 22:11:23 UTC
From:
To:
Hello Jochen,
thanks for your reply.
too, in order to automatically pick updates (for instance, when their
copyright years change).

Is this the wrong way to achieve this result?

I checked and I confirm that it indeed works, after a debclean.

However, I added all the generated files to the --exclude argument,
precisely in order to avoid the need for a debclean.
I wanted decopy to act as if the generated files were absent.
Apparently, this is not what's happening.
Why?
Is the syntax I used for the --exclude option incorrect?

Do you mean that you only use decopy for a first rough draft of the
debian/copyright file and then you modify it by hand?
That's what I thought to do myself.

But then, what do you do, when the source tree changes and the
debian/copyright file has to be updated?
Do you update it by hand?
Or do you re-run decopy with the outdated debian/copyright file as a
base for the processing?
My intention was to follow the latter strategy, hence my Makefile
target 'debian-copyright'...

Did I misunderstand how decopy should be used?

Well, I suspect the heuristics should be improved a bit...
I think that, when a preexisting debian/copyright file is used as a
base for processing, decopy should not change which copyright block is
used as the top one, unless there is a really strong reason to do so.

Do you agree?
decopy from looking inside the excluded files, but does not make decopy
ignore their existence?!?

If this is confirmed, I think a new option should be added (we could
perhaps call it "--ignore") that makes decopy act as if the ignored
files were absent.

Ah, I see, thanks for the explanation.

But why does decopy strip "et al."?

And what's the correct way to specify that a copyright is owned
by one main owner plus many other co-owners?
I mean, the correct way for decopy.


Please let me know what you think about my doubts.
Thanks for your time!

#1021957#20
Date:
2022-09-29 10:22:15 UTC
From:
To:
* Francesco Poli <invernomuto@paranoici.org> [2022-09-29 00:11]:

Seems fine if that's your intention, I just wanted to point out that
this changes the decopy output.

Yes.

I rerun decopy (sometimes with deleting d/copyright first) and then diff
the result. I think it would be great if decopy's output would be
idempotent but often it needs extra work. I think the intention was to
make decopy smart enough to not need extra work but I haven't invested
time into that till now.

Sounds like yeah.

Yes, I think that would be a good addition.

I looked into the git history but there is no comment why it was added.

I'm actually not sure of the implication of this. Stating that there is
someone besides the named person holding the copyright does not really
give you any information.

If you really want to add it, you could first off all separate it from
the first name. So in your example make Masato Taruishi and et al. two
separate entries:

2002-2020, Masato Taruishi
2002-2020, et alii (or others or..)

I think decopy should preserve that.

Cheers Jochen

#1021957#25
Date:
2022-10-03 18:11:45 UTC
From:
To:
It's part of the name normalization logic, it could be extended so if
the author is set as "$name et all" somewhere to show the entry as such,
even if it's listed as "$name" everywhere else. But I don't really see
value in the added information (see bellow), thus it's just dropped.
(in retrospective, it would have been better to call that piece of code
name normalization instead of simply applying some regexps.)

What's the copyright information that you are adding by that? Who is
others, who would you contact if you need to relicense?  Why et all in
french and, not any of the other languages of the world? Any of this
information is relevant to a Debian package?

:)

Whatever you add in the debian/copyright should be maintained, that's
the original intention (unless the files mentioned are no longer
present).

Sadly this part also is missing a normalization logic to merge with the
found authors. I thought I would do that for the diff mode.

#1021957#30
Date:
2022-10-17 22:03:33 UTC
From:
To:
Control: retitle -1 should not overturn the hierarchy of files w.r.t. the base debian/copyright file (unless there is a really strong reason to do so)
Control: clone -1 -2
Control: retitle -2 please implement an option to ignore the very existence of some files in the source tree
Control: severity -2 wishlist
[...]

Good, I am changing the bug report title accordingly.
[...]

I am cloning this bug report into another one focused on this feature
request.


Thanks for your helpfulness.
I hope decopy may be improved soon, so that it may become an even more
useful tool!

Bye.