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 .dsc file, 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 no filename was 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 the check_signature() method will not use vendor specific keyrings, only user supplied ones. no vendor freebies πŸ™…
    • require_valid_signature β€” set to 1 and the check_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 the check_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 $targetdir already exists, it will be erased (as long as the no_overwrite_dir option 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