Debian...:Stanza(3pm)
π Debian::Control::Stanza β the 3pm manual, bestie edition π
okay so you wanna know about Debian::Control::Stanza? say less. this is the 3pm manpage for it, and I'm gonna walk you through every single crumb of it, no skips, no skimming. π«Ά
πΈ NAME πΈ
Debian::Control::Stanza β one single stanza of a Debian source package control file. that's it, that's the whole vibe. one stanza. iconic behavior honestly. β¨
π SYNOPSIS π
package Binary;
use base 'Debian::Control::Stanza';
use constant fields => qw( Package Depends Conflicts );
1;
look at that. clean. gorgeous. we love a class that knows what it is. π
π¦ DESCRIPTION π¦
so Debian::Control::Stanza is the base class for two other classes: Debian::Control::Stanza::Source and Debian::Control::Stanza::Binary. it's giving parent energy, it's giving "I raised them". lowkey the blueprint. π
β FIELDS β
the fields of a stanza get defined in the class method fields. typically you do it like this:
use constant fields => qw( Foo Bar Baz );
and here's the cute part: any field meant to hold a list of dependencies (you know, the ones the is_dependency_list method below is about) gets converted automatically into an instance of the Debian::Dependencies class. automatic glow-up, no cap. π
π User-defined fields
yesss, user-defined fields are supported, you can make your own. they start with X, and then optionally an S, B or C, then _, then a capital letter, then other letters and digits.
examples? we gotchu: X_Moon_Phase, XS_Hemisphere. π
peep the lore at <https://www.debian.org/doc/debian-policy/#user-defined-fields>.
π§ CONSTRUCTOR π§
new
new( { field => value, ... } )
makes you a brand new Debian::Control::Stanza object, and if you want, it initializes it with the data you hand over. the object is hashref based and it's tied to Tie::IxHash β so yes bestie, the order stays exactly how you put it. we love an ordered queen. β¨
you are allowed to use dashes for the initial field names, but heads up, they get converted to underscores:
my $s = Debian::Control::Stanza::Source( {Build-Depends => "perl"} );
print $s->Build_Depends;
see how Build-Depends became Build_Depends? that's the conversion, and it ate. π
π METHODS π
is_dependency_list($field)
returns true if $field holds a list of dependencies. by default it's true for these fields right here:
Build_DependsBuild_Depends_IndepBuild_Depends_ArchBuild_ConflictsBuild_Conflicts_IndepBuild_Conflicts_ArchDependsConflictsEnhancesReplacesBreaksPre_DependsRecommendsSuggests
that's fourteen, count 'em. π
is_comma_separated($field)
returns true if the given field is meant to hold a comma-separated list of values. this matters in stringification, when it's figuring out where to wrap the long lines. (so basically the line-wrapping decisions live here. main character energy.)
by default these fields are flagged as having such lists:
- All fields that contain dependencies (see above) π
UploadersProvides
looks_like_an_x_field($field)
returns true if $field is considered an appropriate name for a user-defined field. vibe check passed, or nah. π¦
get($field)
overrides the default get method from Class::Accessor, and swaps in Tie::IxHash's FETCH instead. not me improving on the classic.
set( $field, $value )
overrides the default set method from Class::Accessor, swapping in Tie::IxHash's STORE. and while it's at it, it converts $value into an instance of the Debian::Dependencies class β but only if $field is supposed to contain a dependency list (as decided by the is_dependency_list method, remember her?).
as_string([$width])
returns a string representation of the object, ready to be printed straight into a real debian/control file. it's also used as the stringification operator. periodt.
fields that are comma-separated use one line per item β except if they look like "${some:Field}", in which case they get wrapped at the $widthth column. and $width defaults to 80. πΈ
π COPYRIGHT & LICENSE π
Copyright (C) 2009, 2017 Damyan Ivanov dmn@debian.org
Copyright (C) 2020 gregor herrmann gregoa@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.
fr fr read the license, bestie, it's literally right there. π
and that's the whole page!! this was Debian...:Stanza from perl v5.40.1, dated 2026-05-08, per the User Contributed Perl Documentation. ty for coming to my ted talk, stan the stanza, bye bestie!! πβ¨ππ«Ά
π¦ 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