Dpkg::Source::Format(3perl) libdpkg-perl Dpkg::Source::Format(3perl)

# [NAME](#NAME)

Dpkg::Source::Format - manipulate debian/source/format files

# [DESCRIPTION](#DESCRIPTION)

This module provides a class that can manipulate Debian source package *debian/source/format* files.

# [METHODS](#METHODS)

$format = Dpkg::Source::Format-&gt;new(%opts)

Creates a new object corresponding to a source package's *debian/source/format* file.

Options:

[**filename**](#filename)

Set the filename to use to parse and set the format.

[**format**](#format)

Set and validate the format to use instead of loading the default file, if no filename has been specified.

$format-&gt;set\_from\_parts($major\[, $minor\[, $variant]])

Sets the source format from its parts. The $major part is mandatory. The $minor and $variant parts are optional.

**Notice**: This function performs no validation.

($major, $minor, $variant) = $format-&gt;set($format)

Sets (and validates) the source $format specified. Will return the parsed format parts as a list, the optional $minor and $variant parts might be undef.

($major, $minor, $variant) = $format-&gt;**get()**

$format = $format-&gt;**get()**

Gets the source format, either as properly formatted scalar, or as a list of its parts, where the optional $minor and $variant parts might be undef.

$count = $format-&gt;parse($fh, $desc)

Parse the source format string from $fh, with filehandle description $desc.

$count = $format-&gt;load($filename)

Parse $filename contents for a source package format string.

$string = "$format"

$string = $format-&gt;output(\[$fh])

Returns a string representing the source package format version. If $fh is set, it prints the string to the filehandle.

$format-&gt;save($filename)

Save the source package format into the given $filename.

# [CHANGES](#CHANGES)

## [Version 1.00 (dpkg 1.19.3)](#Version_1.00_%28dpkg_1.19.3%29)

Mark the module as public.

2026-09-09 1.23.11-dirty

---

Document: Dpkg::Source::Format(3perl) from dpkg 1.23.11-r2 (Chainguard OS)
Source: https://git.dpkg.org/git/dpkg/dpkg.git
