Debian::Control(3pm)
π Debian::Control π
okay bestie, gather round, because today we're talking about Debian::Control β the Perl module that lets you manage Debian source package control files without losing your entire mind. it's giving object-oriented, it's giving debian/control whisperer, it's giving "i can read AND write this file, watch me". π¦
β¨ NAME β¨
Debian::Control β manage Debian source package control files. no cap, that's literally the whole job description and she does it beautifully. π
πΈ SYNOPSIS πΈ
my $c = Debian::Control->new(); # construct a new
$c->read($file); # parse debian/control file
$c->write($file); # write to file
print $c->source->Source;
print $c->source->Build_Depends; # Debian::Dependencies object
$c->binary->{'libfoo-perl'}->Description(
"Foo Perl module\n" .
" Foo makes this and that"
);
see how clean that is?? construct, read, write, peek at stuff, set a description. main character API fr. β¨
π DESCRIPTION π
Debian::Control can be used for representation and manipulation of Debian source package control files in an object-oriented way. she provides easy reading and writing of the debian/control file found in Debian source packages.
that's it. that's the vibe. no more regex-ing your way through control files at 3am, bestie. we're doing objects now. π«Ά
π FIELDS π
sourceβ an instance ofDebian::Control::Stanza::Sourceclass. this one holds the source stanza of the Debian source package control file. the origin story, if you will. πbinaryβ a hash reference where the keys are binary package names and the values are instances ofDebian::Control::Stanza::Binaryclass. she contains the info from the binary package stanzas of the Debian source package control file. so like, all your output packages live in here. iconic. πbinary_tieβ aTie::IxHashobject tied to the binary hash. keeping that order crisp, iykyk. β
π§ CONSTRUCTOR π§
newβ constructs a newDebian::Controlinstance. fresh out the box, ready to slay. β¨
the source field gets initialized with an empty instance of Debian::Control::Stanza::Source, and the binary field gets initialized with an empty instance of Tie::IxHash. so you start with a blank canvas and two very well-behaved containers. obsessed. π
π METHODS π
readfile β parsescontrolin debian and populates thesourceandbinaryaccessors. basically: feed her a file, she fills in all the fields for you. no cap. π
file can be either a file name or a string scalar reference. flexible queen. π¦
writefile β writes adebian/control-like file into file using the contents defined in thesourceandbinaryfields. she's not just a reader, she's a whole author. periodt. πΈ
file can be either a file name, an opened file handle or a string scalar reference. three options, all valid, pick your fighter. π
All dependency lists are sorted before writing. she does the tidying for you, you're welcome. β¨
is_arch_depβ returns true if the package is architecture-dependent. how does she know?? it's determined by theArchitecturefield of the first binary package. if it equals toall, then the package is architecture-independent; otherwise it is architecture-dependent. simple logic, big energy. π
Returns undef if it is not possible to determine whether the package is architecture-dependent or not. this happens when there are no binary package stanzas present, or the first one has no Archiitecture field. (<- yes, that spelling is exactly what's in here, don't come for me, i'm just the messenger π β copy it character for character if you're matching against it, bestie.)
lowkey important: undef means "girl idk" not "false". don't get caught out, fr fr. π
π₯ SEE ALSO π₯
Debian::Control::Stanza::SourceDebian::Control::Stanza::BinaryDebian::Control::FromCPAN
go read those too, the whole squad is out here serving. π«Ά
π COPYRIGHT & LICENSE π
Copyright (C) 2009 Damyan Ivanov dmn@debian.org
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.
and that's the whole page, bestie!! this was written for perl v5.40.1, dated 2026-05-08, and it's the Debian::Control(3pm) manual page β go forth and manipulate those control files with confidence. mwah. ππβ¨
π¦ where this page comes from
- ubuntu stonking: libdebian-source-perl 0.133 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms