Unifying the process to strip files with problematic copyright from upstream tarballs

The following features of uscan since devscripts version 2.14.2 are helpful to deal with upstream tarballs you need to tweak.

Deleting Files using Files-Excluded field in debian/copyright

By using the field Files-Excluded:

Files-Excluded: foo/bar.js

in the header paragraph of debian/copyright, you can exclude files from an upstream tarball (see man uscan).

This field accepts a whitespace-separated list of patterns like Files. Example:

Files-Excluded: */Makefile.in aclocal.m4 config.h.in configure

Currently, this feature is not yet documented in debian/copyright file format specification, but there is an open bug about this (685506).

Specifying better compression method

You can specify a more reasonable compression method using uscan --repack --compression <compression>. You can use xz, bz2, gz, or lzma here. (see man uscan)

Not yet implemented but potentially helpful

When repacking, tar --exclude-vcs is used. Usually there is no point in having VCS metainformation in upstream tarballs. It should be debated in a separate thread whether this option should be used unconditionally, but the current implementation is that way. So, in the example above, the specification of .git is redundant because it will be left out anyway. The feature to exclude VCS information from upstream tarballs will be subject of a future bug report.