Dpkg::Source::Package(3perl)
πΈ Dpkg::Source::Package(3perl) β the source-package wrangler π
okay bestie, welcome to Dpkg::Source::Package, a libdpkg-perl situation, and honestly it's giving "backstage pass to Debian source packages" β¨
β¨ NAME β¨
Dpkg::Source::Package β manipulate Debian source packages π
π¦ DESCRIPTION π¦
So this module hands you a class that can manipulate Debian source packages. Sounds simple, right? It does both extraction and creation of source packages β but here's the tea: the only API that's officially supported is the one for extracting the source package. Everything else is lowkey yolo. π
π₯ FUNCTIONS π₯
$string = get_default_diff_ignore_regex()β gives you back the default diff ignore regex. that's it, that's the function πset_default_diff_ignore_regex($string)β sets a regex as the new default diff ignore regex. you're the main character now π@array = get_default_tar_ignore_pattern()β returns the default tar ignore pattern, as an array (list girlies rise) π
π METHODS π
π $src_pkg = Dpkg::Source::Package->new(%opts, options => {})
Creates a new object corresponding to a source package. iconic constructor behaviour, no cap.
Options:
filenameβ when you set this to a.dscfile, it gets used to initialize the source package with its description. like, the file tells the object who it is πͺformatβ if you set it to a valid value and nofilenamewas specified, the object gets initialized for that format (since dpkg 1.19.3). no filename? cool, we're going by vibe of format π«optionsβ a hash ref that supports the following source package format options:skip_debianizationβ set to 1 and it will not apply Debian changes on the extracted source package. vanilla upstream only, bestie β¨skip_patchesβ set to 1 and it will not apply Debian-specific patches. this option is specific for source packages using format"2.0"and"3.0 (quilt)". read that twice, iykyk π§certsβ an array ref with a list of certificate keyrings to use for signature verification. bring your own keys πuse_vendor_certsβ set to 0 and thecheck_signature()method will not use vendor specific keyrings, only user supplied ones. no vendor freebies πrequire_valid_signatureβ set to 1 and thecheck_signature()method gets stricter and will error out if the signature can't be verified. no unsigned nonsense on this watch π¨require_strong_checksumsβ set to 1 and thecheck_checksums()method gets stricter and will error out if there is no strong checksum. weak checksums? not on the menu πcopy_orig_tarballsβ set to 1 and the extraction will copy the upstream tarballs next the target directory. this is useful if you want to be able to rebuild the source package after its extraction. future you says thank you π«Ά
β $filename = $src_pkg->get_filename()
Returns the filename of the DSC file. just the name, pure and simple π
π @files_list = $src_pkg->get_files()
Returns the list of files referenced by the source package. The filenames usually do not have any path information. so don't go looking for directories, they're not there π
π $src_pkg->check_checksums()
Verify the checksums embedded in the DSC file. It requires the presence of the other files constituting the source package. If any inconsistency is discovered, it immediately errors out. It will make sure at least one strong checksum is present. ngl this one is the group-chat moderator of methods π
If the object has been created with the "require_strong_checksums" option, then any problem will result in a fatal error. periodt.
π¦ $pathname = $src_pkg->get_basedirname()
Returns the default base directory name for the package. your package's little home base π‘
π $pathname = $src_pkg->get_upstream_signing_key($dir)
Get the filename for the upstream key. that's the whole thing, bestie π
πΈ $src_pkg->armor_original_tarball_signature($bin, $asc)
Convert a signature from binary to ASCII armored form:
- If the signature file does not exist, it is a no-op. nothing to do, we chillin βοΈ
- If the signature file is already ASCII armored then it copies it.
- Otherwise it converts it from binary to ASCII armored form. glow-up complete β¨
π
$src_pkg->check_original_tarball_signature($dir, @asc)
Verify the original upstream tarball signatures @asc using the upstream public keys. It requires the origin upstream tarballs, their signatures and the upstream signing key, as found in an unpacked source tree $dir. If any inconsistency is discovered, it immediately errors out. it's giving strict hall monitor and honestly we stan π¨
π $bool = $src_pkg->is_signed()
Returns 1 if the DSC files contains an embedded OpenPGP signature. Otherwise returns 0. yes/no energy only π
π $src_pkg->check_signature()
Implement the same OpenPGP signature check that dpkg-source does. In case of problems, it prints a warning or errors out. iconic consistency with the real tool π«
If the object has been created with the "require_valid_signature" option, then any problem will result in a fatal error. no soft launch here π€
π $src_pkg->extract($targetdir)
Extracts the source package in the target directory $targetdir.
β οΈ Beware that if$targetdiralready exists, it will be erased (as long as theno_overwrite_diroption is set). bestie. please double check your path before you hit enter, i am literally begging π
π§ CHANGES π§
πΈ Version 2.04 (dpkg 1.23.0)
New options: certs, use_vendor_certs in $p->check_checksums().
π¦ Version 2.03 (dpkg 1.22.7)
New method: $p->get_basedirname().
π Version 2.02 (dpkg 1.21.10)
New method: $p->armor_original_tarball_signature().
π Version 2.01 (dpkg 1.20.1)
New method: $p->get_upstream_signing_key().
β Version 2.00 (dpkg 1.20.0)
New method: $p->check_original_tarball_signature().
Remove variable: $diff_ignore_default_regexp.
Hide variable: @tar_ignore_default_pattern.
π Version 1.03 (dpkg 1.19.3)
New option: format in new().
π Version 1.02 (dpkg 1.18.7)
New option: require_strong_checksums in $p->check_checksums().
β¨ Version 1.01 (dpkg 1.17.2)
New functions: $p->get_default_diff_ignore_regex(), $p->set_default_diff_ignore_regex(), $p->get_default_tar_ignore_pattern().
Deprecated variables: $diff_ignore_default_regexp, @tar_ignore_default_pattern
π Version 1.00 (dpkg 1.16.1)
Mark the module as public. she's official now, everyone say congrats π
okay that's the whole page bestie, you ate π
β¨ β this little love letter is from version 1.23.11-dirty, dated 2026-09-09, and it's the Dpkg::Source::Package(3perl) manpage signing off π«Άπ
π¦ where this page comes from
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms