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 of Debian::Control::Stanza::Source class. 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 of Debian::Control::Stanza::Binary class. 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 β€” a Tie::IxHash object tied to the binary hash. keeping that order crisp, iykyk. ⭐

🧚 CONSTRUCTOR 🧚

  • new β€” constructs a new Debian::Control instance. 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 πŸ’…

  • read file β€” parses control in debian and populates the source and binary accessors. 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. πŸ¦‹

  • write file β€” writes a debian/control-like file into file using the contents defined in the source and binary fields. 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 the Architecture field of the first binary package. if it equals to all, 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::Source
  • Debian::Control::Stanza::Binary
  • Debian::Control::FromCPAN

go read those too, the whole squad is out here serving. 🫢


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