Debian...pyright(3pm)
π Debian::Copyright π
okay bestie, so this is the User Contributed Perl Documentation page for Debian::Copyright, and it's literally the whole vibe for wrangling Debian copyright files. no cap π¦
β¨ NAME β¨
Debian::Copyright β manage Debian copyright files. that's it, that's the whole job description π
π VERSION π
This doc describes Debian::Copyright version 0.2. yes queen, we're on 0.2 and we're thriving β
πΈ SYNOPSIS πΈ
here's the little ritual you do, copy it exactly:
my $c = Debian::Copyright->new(); # construct a new
$c->read($file1); # parse debian copyright file
$c->read($file2); # parse a second
$c->write($ofile); # write to file
like, you make one, you feed it files, you spit a file back out. iconic behavior fr fr π«Ά
π« DESCRIPTION π«
So Debian::Copyright is your girl for representation, manipulation and merging of Debian copyright files, and it does it all in that object-oriented way you love to see. It makes reading and writing the debian/copyright file you find in Debian source packages genuinely easy. Debian recently started standardising its copyright files around the machine-readable Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ in DEP-5 format. lowkey a whole era for packaging. π
π§ note on terminology
The term "Stanza" comes from the dh-make-perl tool (http://packages.debian.org/sid/dh-make-perl). The official term would now be "Paragraph". For the purposes of talking about the DEP-5 format, the terms get used interchangeably in this documentation. bestie they're the same thing, don't let anyone gatekeep you about it π
π₯ FIELDS π₯
π header
An instance of the Debian::Copyright::Stanza::Header class. It holds the the first stanza of the copyright file. Heads up: if multiple files were parsed, only the first one gets retained. so don't come crying to me about stanza number two, she's gone π
π files
A hash reference (actually a Tie::IxHash instance) where the keys are the values of the Files clause and the values are instances of the Debian::Copyright::Stanza::Files class. keys β Files values, values β objects. slay π
π licenses
A hash reference (actually a Tie::IxHash instance) where the keys are the values of the License clause and the values are instances of the Debian::Copyright::Stanza::License class. same energy, different clause, we love consistency β
π CONSTRUCTOR π
new
Constructs a new Debian::Copyright instance. fresh out the box, brand new, main character energy β¨
The header field is initialised with an empty string. The files_block and license_block fields are initialised with an empty instance of Tie::IxHash. so like, blank canvas, ready for your glow-up π
π METHODS π
read file
Parse copyright in debian and accessors. yes, the doc really says "and accessors", we don't ask questions, we just report π«Ά
file can be either a file name, an opened file handle or a string scalar reference. three ways to hand her a file, pick your fighter π«
write file
Writes a debian/copyright-like file in file with the contents defined in the accessor fields. she's giving back what you gave her, but as a file π
file can be either a file name, an opened file handle or a string scalar reference. same three options as before, no cap π
π LIMITATIONS π
This module is written with one particular version of DEP-5 (http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/) in mind. Not a moving target, bestie, one specific version. Furthermore, version 0.1 of this software was for a draft version the standard. The changes in going from draft to standard were such that it was not worth attempting to maintain backwards compatibility. so yeah, she fully reinvented herself, no nostalgia π Test coverage is not yet complete. we're honest about it, that's growth π±
π INCOMPATIBILITIES π
This version is not backwards compatible with version 0.1. that's the whole section. that's it. old code, new module, they do not speak. periodt. π₯
πΈ ACKNOWLEDGEMENTS πΈ
Thanks to Charles Plessy for various comments regarding the documentation. we see you, we appreciate you, you ate πβ¨
π¦ COPYRIGHT & LICENSE π¦
Copyright (C) 2011-2012 Nicholas Bamber nicholas@periapt.co.uk
This module was adapted from Debian::Control. Copyright (C) 2009 Damyan Ivanov dmn@debian.org [Portions]
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
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. read that part twice bestie, they mean it π
and that's the whole page, babes. this one's from perl v5.36.0, dated 2022-10-14, and it's the Debian...pyright(3pm) page from the User Contributed Perl Documentation. go forth and merge your copyright files responsibly π
π«Άπ
π¦ where this page comes from
- ubuntu noble: libdebian-copyright-perl 0.2-6 Β· GPL-2.0-or-later
- ubuntu resolute: libdebian-copyright-perl 0.2-6 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms