.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Debian::Control::Stanza 3pm" .TH Debian::Control::Stanza 3pm 2024-03-14 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Debian::Control::Stanza \- single stanza of Debian source package control file .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& package Binary; \& use base \*(AqDebian::Control::Stanza\*(Aq; \& use constant fields => qw( Package Depends Conflicts ); \& \& 1; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Debian::Control::Stanza is the base class for Debian::Control::Stanza::Source and Debian::Control::Stanza::Binary classes. .SH FIELDS .IX Header "FIELDS" Stanza fields are to be defined in the class method \fIfields\fR. Typically this can be done like: .PP .Vb 1 \& use constant fields => qw( Foo Bar Baz ); .Ve .PP Fields that are to contain dependency lists (as per "is_dependency_list" method below) are automatically converted to instances of the Debian::Dependencies class. .SS "User-defined fields" .IX Subsection "User-defined fields" User-defined fields are supported. These start with \f(CW\*(C`X\*(C'\fR, optionally followed by \f(CW\*(C`S\*(C'\fR, \f(CW\*(C`B\*(C'\fR or \f(CW\*(C`C\*(C'\fR, then \f(CW\*(C`_\*(C'\fR, capital letter and other letters and digits. .PP Examples: \f(CW\*(C`X_Moon_Phase\*(C'\fR, \f(CW\*(C`XS_Hemisphere\*(C'\fR. .PP See . .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" .IP new 4 .IX Item "new" .PD 0 .IP "new( { field => value, ... } )" 4 .IX Item "new( { field => value, ... } )" .PD Creates a new Debian::Control::Stanza object and optionally initializes it with the supplied data. The object is hashref based and tied to Tie::IxHash. .Sp You may use dashes for initial field names, but these will be converted to underscores: .Sp .Vb 2 \& my $s = Debian::Control::Stanza::Source( {Build\-Depends => "perl"} ); \& print $s\->Build_Depends; .Ve .SH METHODS .IX Header "METHODS" .IP is_dependency_list($field) 4 .IX Item "is_dependency_list($field)" Returns true if \fR\f(CI$field\fR\fI\fR contains a list of dependencies. By default returns true for the following fields: .RS 4 .IP Build_Depends 4 .IX Item "Build_Depends" .PD 0 .IP Build_Depends_Indep 4 .IX Item "Build_Depends_Indep" .IP Build_Depends_Arch 4 .IX Item "Build_Depends_Arch" .IP Build_Conflicts 4 .IX Item "Build_Conflicts" .IP Build_Conflicts_Indep 4 .IX Item "Build_Conflicts_Indep" .IP Build_Conflicts_Arch 4 .IX Item "Build_Conflicts_Arch" .IP Depends 4 .IX Item "Depends" .IP Conflicts 4 .IX Item "Conflicts" .IP Enhances 4 .IX Item "Enhances" .IP Replaces 4 .IX Item "Replaces" .IP Breaks 4 .IX Item "Breaks" .IP Pre_Depends 4 .IX Item "Pre_Depends" .IP Recommends 4 .IX Item "Recommends" .IP Suggests 4 .IX Item "Suggests" .RE .RS 4 .RE .IP is_comma_separated($field) 4 .IX Item "is_comma_separated($field)" .PD Returns true if the given field is to contain a comma-separated list of values. This is used in stringification, when considering where to wrap long lines. .Sp By default the following fields are flagged to contain such lists: .RS 4 .IP "All fields that contain dependencies (see above)" 4 .IX Item "All fields that contain dependencies (see above)" .PD 0 .IP Uploaders 4 .IX Item "Uploaders" .IP Provides 4 .IX Item "Provides" .RE .RS 4 .RE .IP looks_like_an_x_field($field) 4 .IX Item "looks_like_an_x_field($field)" .PD Returns true if \fR\f(CB$field\fR\fB\fR is considered appropriate to name a user-defined field. .IP get($field) 4 .IX Item "get($field)" Overrides the default get method from Class::Accessor with Tie::IxHash's FETCH. .ie n .IP "set( $field, $value )" 4 .el .IP "set( \f(CW$field\fR, \f(CW$value\fR )" 4 .IX Item "set( $field, $value )" Overrides the default set method from Class::Accessor with Tie::IxHash's STORE. In the process, converts \fR\f(CI$value\fR\fI\fR to an instance of the Debian::Dependencies class if \fI\fR\f(CI$field\fR\fI\fR is to contain dependency list (as determined by the "is_dependency_list" method). .IP as_string([$width]) 4 .IX Item "as_string([$width])" Returns a string representation of the object. Ready to be printed into a real \fIdebian/control\fR file. Used as a stringification operator. .Sp Fields that are comma-separated use one line per item, except if they are like \&\f(CW\*(C`${some:Field}\*(C'\fR, in which case they are wrapped at \fR\f(CI$width\fR\fI\fRth column. \&\fI\fR\f(CI$width\fR\fI\fR defaults to 80. .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright (C) 2009, 2017 Damyan Ivanov dmn@debian.org .PP Copyright (C) 2020 gregor herrmann gregoa@debian.org .PP 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. .PP 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.