Dpkg::BuildOptions(3perl)

πŸ’… Dpkg::BuildOptions(3perl)

okay so bestie, welcome to Dpkg::BuildOptions β€” it's a libdpkg-perl module and it's literally the main character of build-option management ✨


πŸŽ€ NAME πŸŽ€

Dpkg::BuildOptions β€” parse and update build options, no cap 🫢


🌸 DESCRIPTION 🌸

so like, this class is the one you call when you wanna manipulate options that live in environment variables β€” think DEB_BUILD_OPTIONS and DEB_BUILD_MAINT_OPTIONS. that's the whole vibe. it holds your options, it massages them, it exports them back out. iconic behavior honestly πŸ‘‘


πŸ¦‹ METHODS πŸ¦‹

  • $bo = Dpkg::BuildOptions->new(%opts) β€” spin up a brand new Dpkg::BuildOptions object. it initializes itself from the value of the environment variable named DEB_BUILD_OPTIONS (unless you tell it otherwise, see below πŸ’–)

Options:

  • envvar β€” set the environment variable name to use instead of DEB_BUILD_OPTIONS to initialize the build flags. yes bestie you can pick your own variable, go off ✨
  • $bo->reset() β€” reset the object so it has zero options. empty. blank slate. a fresh face, a clean girl 🧼 it's empty, periodt.
  • $count = $bo->merge($content, $source) β€” merge the options set in $content and record that they came from the source $source. rn $source is mainly used in warning messages to indicate where invalid options got detected πŸ‘€

$content is a space separated list of options with optional assigned values, like "nocheck parallel=2".

  • $bool = $bo->set($option, $value, [$source]) β€” store the given option in the object with the given value. it's totally legitimate for a value to be undefined if the option is a simple boolean (its presence means true, its absence means false β€” very demure, very mindful). $source is optional and indicates where the option comes from.

the known options have their values checked for sanity 🧠 options without values have their value removed, and options with invalid values are discarded (sorry girl, gone πŸ’€).

  • $value = $bo->get($option) β€” return the value associated to the option. heads up: it might be undef even if the option exists 😭 so you might wanna check with $bo->has($option) to verify the option is actually stored in the object. trust.
  • $bool = $bo->has($option) β€” returns a boolean telling you whether the option is stored in the object. simple. clean. slay πŸ’…
  • $bo->parse_features($option, $use_feature) β€” parse the $option values as a set of known features to enable or disable, exactly as specified in the $use_feature hash reference.

each feature is prefixed with a '+' or a '-' character as a marker to enable or disable it. and the special feature "all" can be used to act on all known features πŸ‘‘ (yes, all of them, queen behavior)

unknown or malformed features will emit warnings πŸ™ˆ you've been warned.

  • $string = $bo->output($fh) β€” return a string representation of the build options, suitable to be assigned to an environment variable. can optionally output that string to the given filehandle too πŸŽ€
  • $string = $bo->export([$var]) β€” export the build options to the given environment variable. if $var is omitted, the environment variable defined at creation time is assumed (iykyk πŸ‘€). the value set to the variable is also returned. two-for-one, we love to see it πŸ’–

🌈 CHANGES 🌈

⭐ Version 1.02 (dpkg 1.18.19)

  • New method: $bo->parse_features(). ✨

⭐ Version 1.01 (dpkg 1.16.1)

  • Enable to use another environment variable instead of DEB_BUILD_OPTIONS. Thus add support for the "envvar" option at creation time. πŸ¦‹

⭐ Version 1.00 (dpkg 1.15.6)

  • Mark the module as public. πŸŽ‰

fr fr that's the whole page, every method and every version note accounted for, no details left behind πŸ’œ

and that's a wrap bestie!! πŸ“ this page is from libdpkg-perl, version 1.23.11-dirty, dated 2026-09-09 β€” screenshot it, cite it, frame it, whatever, go be iconic with your build options πŸ’…πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from