decopy
- Automatic debian/copyright generator
decopy
[options] [files or dirs]
Decopy is a tool that automates creating and updating the debian/copyright files. It does this by parsing all files in a source tree, figuring out the copyright attribution and license for each file (when possible) and then structuring the output in the copyright format 1.0.
Simply running decopy
in the source tree that needs to be parsed will process
all files in the tree, group them by license, wildcard those groups and generate
the proper output to be written to the debian/copyright file.
If the source tree already includes a debian/copyright file, it will be used as input for files where the license could not be inferred, for the copyright of the debian directory and for the license snippets (which need to be filled in manually if there is no debian/copyright file).
The files or directories specified as positional arguments can be used to limit the processing to the indicated subset instead of processing the complete source tree.
On top of the simple decopy
usage, these examples show some of the most common
usecases. Please see the following sections for detailed explanations of what
each of the parameters do.
decopy --root src/hello-1.0/ --output src/hello-1.0/debian/copyright
decopy --mode partial src/3rdparty/ninja
src/3rdparty/ninja
directory. Only that directory is analized and the
output includes only files contained in it.decopy --group-by copyright
decopy src
--mode <mode>
--output <file>
, -o <file>
--root <path>
The generated output will always create separate paragraphs for groups of files with different licenses, additionally, it can also split paragraphs according to the following grouping options.
--group-by <criteria>
--split-on-license
--no-split-on-license
--split-debian
--no-split-debian
The default logging shows WARN and ERROR messages. It can be modified with the following flags:
--debug
--verbose
, -v
--quiet
, -q
--copyright-file <filename>
debian/copyright
--text
--exclude <path>
, -X <path>
-X '.*\.jpg$'
to exclude all files that have the .jpg
extension. or -X
doc/
to exclude all files inside the doc/
directory). As a special case,
debian/copyright
and debian/changelog
are always excluded..Decopy was inspired by previous copyright helpers like copyright-helper by Modestas Vainius, licensecheck(1) by Jonas Smedegaard, or the copyright helper shipped with debmake(1), written by Osamu Aoki.
The main difference with all of them, is that decopy aims to detects as many licenses as possible, including many more that those in the other helpers, as well as the fact that it's capable of processing more than just plain text files.
Additionally, while it is possible to use it for the creation of the copyright file, its main usecase is to keep the copyright file updated with any changes that are done to the source tree as time passes.
Decopy was written by Maximiliano Curia. The debian packaging and this manpage were created by Margarita Manterola.
Decopy and all the associated code and documentation are released under the ISC license.