DECOPY(1)
π DECOPY π
okay bestie, sit down, because we're about to talk about the most iconic little helper for your debian/copyright files. her name is decopy and she's a General Commands Manual queen. πΈ
β¨ NAME β¨
decopy β Automatic debian/copyright generator π«Ά
β¨ SYNTAX β¨
decopy [options] [files or dirs]
β¨ DESCRIPTION β¨
So like, Decopy is a tool that automates creating and updating the debian/copyright files. No cap. π
She 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. literally doing the most so you don't have to. π
β¨ USAGE β¨
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. The license texts for well known licenses are filled in automatically (see --fill-licenses); any that are not recognised need to be filled in manually. π
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. π
β¨ EXAMPLES β¨
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
This runs the parser in the hello-1.0 source tree and generates the debian/copyright file in the source tree (the debian/ directory needs to pre-exist this call). π
decopy --mode partial src/3rdparty/ninja
This shows the licensing and copyright information for the src/3rdparty/ninja directory. Only that directory is analyzed and the output includes only files contained in it. π
decopy --group-by copyright
This processes the complete current source tree, paragraphs are split not only according to the licenses but also according to the copyright owners. π
decopy src
This will process the src directory but, provided debian/copyright already exists, show the complete updated debian/copyright file. β
β¨ COMMON OPTIONS β¨
these are the ones you'll actually use, bestie. π
--mode <mode>β Indicates the mode to use when generating the output. The full mode (default) will generate a completedebian/copyrightfile, even if only some files were processed (the rest of the contents are taken from the originaldebian/copyrightfile). The partial mode will only print the copyright and licensing information for the indicated files. The changed mode restricts processing to the files that changed since thedebian/copyrightfile was last committed to git (see--changedand--sincebelow).--changedβ Shorthand for--mode changed. Scopes the run to the files that changed since thedebian/copyrightfile was last committed. This requires the source tree to be a git repository; if the changed set cannot be computed (git is not available, the tree is not a repository, or the copyright file is untracked) decopy warns and falls back to a full scan. π (she'll still do the thing, just the long way)--since <ref>β Baseline git ref for--changed. Defaults to the commit that last modified thedebian/copyrightfile.--output <file>,-o <file>β Store the generated output in the indicated file. This will overwrite the file if it already exists. β οΈ like, overwrite. be aware.--root <path>β Process the indicated path instead of the current directory. π--spdx,--no-spdxβ When--spdxis given, license short names are rendered using their SPDX identifiers instead of the DEP-5 copyright format names. The default is--no-spdx, which uses the DEP-5 names.--fill-licenses,--no-fill-licensesβ When--fill-licenses(the default) is given, theLicense:stanzas in the generated output are filled in with the corresponding license text: a reference to/usr/share/common-licensesfor the licenses shipped there, or the full text for other well known licenses. With--no-fill-licensesthe license text is left as aTODOplaceholder to be filled in manually. βοΈ
β¨ EXPLAIN MODE β¨
Instead of regenerating debian/copyright, decopy can report what is out of date in the existing file, which is useful as a check (e.g. in CI). π§ iconic behaviour honestly.
--explainβ Report what is out of date indebian/copyrightinstead of regenerating it: staleFilesparagraphs, patterns that no longer match any file, files whose license changed, new files that are not yet covered and copyright holders that have drifted. Nothing is written;decopyexits with status 1 if anything is stale and 0 if the file is up to date. π (exit codes my beloved)
β¨ GROUPING CRITERIA β¨
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>β When grouping by license (default), all copyright owners of different files with the same license are listed together. When grouping by copyright, each different group of copyright owners is listed separatedly (files that have the exact same list of copyright owners are listed together).--split-on-licenseβ When a subdirectory has its own license file (COPYING,LICENSE, etc), the subdirectory is given its own paragraph, even if it has the same license as the main directory. This is the default.--no-split-on-licenseβ Even if a subdirectory has its own license file, the contents are listed together with other files in the tree that have the same license.--split-debianβ Even if the contents of thedebian/subdirectory have the same license as the main content, split it onto a separate paragraph. This is the default.--no-split-debianβ If the contents of thedebian/subdirectory have the same license as the main content, they are listed together.
β¨ ARCHIVE EXPANSION β¨
Archive files (tar, zip and similar) found in the source tree are expanded and their contents are parsed as if they were regular files, so that licenses and copyright holders embedded inside archives are detected. π¦β¨
--expand-archives,--no-expand-archivesβ Enable or disable expanding archive files into their contents. Expansion is enabled by default (--expand-archives).--max-archive-depth <n>β Maximum depth of nested archive expansion (archives contained inside other archives). Defaults to 1. π--max-archive-member-size <bytes>β Skip archive members larger than this many bytes. Defaults to 10 MB. π
β¨ LOG LEVEL OPTIONS β¨
The default logging shows WARN and ERROR messages. It can be modified with the following flags: π¬
--debugβ ShowDEBUG,INFO,WARNandERRORmessages. π£οΈ--verbose,-vβ ShowINFO,WARNandERRORmessages.--quiet,-qβ Show onlyERRORmessages. π€«
β¨ LESS COMMON OPTIONS β¨
these are the deep cuts, iykyk. π
--copyright-file <filename>β Specify a different copyright file to be used as a base for the processing. Defaults todebian/copyright--text,-aβ Parse all files as text files, instead of using the different parsers according to the file types (e.g. usingexiftoolfor images). πΌοΈ--jobs <n>,-j <n>β Number of jobs to run in parallel while processing files. Use0(the default) to pick a value automatically based on the available CPUs. β‘--glob,--no-globβ Enable or disable the use of glob (wildcard) patterns in theFiles:field of the generated output. Globbing is enabled by default (--glob).--progress,--no-progressβ Show or hide the progress bar while processing files. The progress bar is shown by default (--progress). π--exclude <path>,-X <path>β Exclude files from being parsed. The path can be specified as a regular expression that is matched against the full relative path for the file (e.g.-X '.*\.jpg$'to exclude all files that have the.jpgextension. or-X doc/to exclude all files inside thedoc/directory). As a special case,debian/copyrightanddebian/changelogare always excluded.. π«--gitignore,--no-gitignoreβ Honour the repository's ignore lists (.gitignoreand.git/info/exclude) while walking the tree, so ignored files are not parsed. This is enabled by default (--gitignore); use--no-gitignoreto parse ignored files too. This requires thepathspecmodule; without it the option has no effect. TheFiles-Excludedpatterns from the header of an existingdebian/copyrightfile are always honoured, regardless of this option. π βοΈ
β¨ COMPARISON WITH OTHER HELPERS β¨
Decopy was inspired by previous copyright helpers like copyright-helper by Modestas Vainius https://anonscm.debian.org/cgit/users/modax/copyright-helper.git/, 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. β³ (she's a maintenance queen, not just a one-time thing)
β¨ AUTHORS β¨
Decopy was written by Maximiliano Curia. The debian packaging and this manpage were created by Margarita Manterola. π«Ά king and queen behaviour.
β¨ COPYRIGHT β¨
Decopy and all the associated code and documentation are released under the ISC license. π
and that's the whole page, bestie! π this one's from July 2026, living in the General Commands Manual section, section 1 β go forth and let decopy handle your debian/copyright, you deserve it. β¨ππ
π¦ where this page comes from
- ubuntu stonking: decopy 0.3.2-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms