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

Re: let uscan exclude some upstream files (Was: uscan enhancement)

On Thu, Sep 06, 2012 at 10:34:38PM +0200, Andreas Tille wrote:
> It specifies:
> Files-Excluded:
>     __MACOSX
>     [a-z]*.jar
> with the purpose to save ReadSeq.jar inside the source package. This
> works with the old method:
> $ find . -name "[a-z]*.jar"
> ./rdp_classifier_2.5/lib/junit.jar
> ./rdp_classifier_2.5/lib/commons-cli.jar
> ./rdp_classifier_2.5/rdp_classifier-2.5.jar
> but failes when trying your patch:
> $ find . -path "./[a-z]*.jar"
> ./rdp_classifier_2.5/lib/junit.jar
> ./rdp_classifier_2.5/lib/commons-cli.jar
> ./rdp_classifier_2.5/lib/ReadSeq.jar
> ./rdp_classifier_2.5/rdp_classifier-2.5.jar

> I admit I did also not followed the DEP5 discussion very closely but the
> current code could deal nicely with the specific removal which is not
> the case with your proposal and I have no clue how to reasonably specify
> the fact that all *.jars except one should be removed (besides
> specifying every single file).

I realize that http://dep.debian.net/deps/dep5/ is now obsolete.
Here is the current version.

-- http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#files-field
 This is the same pattern syntax as fnmatch(3) without the
 FNM_PATHNAME flag, or the argument to the -path test of the GNU find
 command, except that [] wildcards are not recognized.

 Multiple Files paragraphs are allowed. The last paragraph that
 matches a particular file applies to it. More general paragraphs
 should therefore be given first, followed by more specific overrides.

 Exclusions are only supported by adding Files paragraphs to override
 the previous match.

So, my patch is more conformant than the old method. Moreover,
brackets should be escaped before passing them to find.

For the moment, only one Files-Excluded is allowed in the unique
header paragraph [2]. Exclusions are impossible. Maybe a solution
would be to define a fake "not-shipped-by-debian" license instead.
This would not only solve your problem, but also allow per-file-set
comments as discussed before ([1], [2]), and using unchanged existing

Your example would become:

-- debian/copyright
Files: *
License: GPL3+
 Full license text.

Files: __MACOSX
License: not-shipped-by-debian
 Optionaly explain here why __MACOSX is rejected.

Files: *.jar
License: not-shipped-by-debian
 Optionaly explain here why jar files are rejected.

Files: rdp_classifier_2.5/lib/ReadSeq.jar
License: GPL3+
 Full license text.
(excluded pattern are separated to demonstrate per-file-set comments)
(in real life, "Text of GPL3+" would be in a separate paragraph)

Allthough I agree with [5], in case we decide to put these patterns
into a separate file or into debian/watch options, a similar approach
could be used, like:

-- debian/uscan-excluded-files
Exclude: __MACOSX *.jar
Include: rdp_classifier_2.5/lib/ReadSeq.jar

[1] https://lists.debian.org/debian-devel/2012/08/msg00625.html
[2] https://lists.debian.org/debian-devel/2012/08/msg00699.html
[5] https://lists.debian.org/debian-devel/2012/08/msg00620.html

Reply to: