Dpkg::BuildFlags(3perl)
π¦ Dpkg::BuildFlags β the libdpkg-perl glow-up π¦
okay so bestie, this is Dpkg::BuildFlags(3perl) from libdpkg-perl, and it's literally the Perl class that lets you peek at build flags. Welcome to the group chat π
πΈ NAME πΈ
Dpkg::BuildFlags β query build flags, that's the whole vibe β¨
π DESCRIPTION π
So this class is what dpkg-buildflags uses under the hood, and you can use it to query the exact same information. Same tea, same source π« no cap.
β¨ METHODS β¨
okay here's the whole lineup, one by one, no skipping π
$bf = Dpkg::BuildFlags->new(%opts)β Create a newDpkg::BuildFlagsobject, iconic behavior honestly. It gets initialized based on the value of several configuration files and environment variables.
Options:
vendor_defaultsβ If set to false, then no vendor defaults are initialized (it defaults to true). Simple as that π«
$bf->load_vendor_defaults()β Reset the flags stored to the default set provided by the vendor. Fresh start energy π$bf->load_system_config()β Update flags from the system configuration.$bf->load_user_config()β Update flags from the user configuration.$bf->load_environment_config()β Update flags based on user directives stored in the environment. Seedpkg-buildflags(1)for details π$bf->load_maintainer_config()β Update flags based on maintainer directives stored in the environment. Seedpkg-buildflags(1)for details.$bf->load_config()β Call successivelyload_system_config(),load_user_config(),load_environment_config()andload_maintainer_config()to update the default build flags defined by the vendor. It's giving "do the whole routine" π$bf->unset($flag)β Unset the build flag$flag, so that it will not be known anymore. Gone, deleted, uninvited from the party π$bf->set($flag, $value, $source, $maint)β Update the build flag$flagwith value$valueand record its origin as$source(if defined). Record it as maintainer modified if$maintis defined and true.$bf->set_feature($area, $feature, $enabled)β Update the boolean state of whether a specific feature within a known feature area has been enabled. The only currently known feature areas are"future","qa","sanitize","optimize","hardening"and"reproducible". Memorize those, there's gonna be a quiz π$value = $bf->get_feature($area, $feature)β Returns the value for the given feature within a known feature area. This is relevant for builtin features where the feature has a ternary state of true, false and undef, and where the latter cannot be retrieved withuse_feature(). Ternary state?? she contains multitudes π$bool = $bf->use_feature($area, $feature)β Returns true if the given feature within a known feature areas has been enabled, and false otherwise. The only currently recognized feature areas are"future","qa","sanitize","optimize","hardening"and"reproducible". (Yes, same list, it's a recurring character π)$bf->set_builtin($area, $feature, $enabled)β Update the boolean state of whether a specific feature within a known feature area is handled (even if only in some architectures) as a builtin default by the compiler.%builtins = $bf->get_builtins($area)β Return, for the given area, a hash with keys as feature names, and values as booleans indicating whether the feature is handled as a builtin default by the compiler or not. Only features that might be handled as builtins on some architectures are returned as part of the hash. Missing features mean they are currently never handled as builtins by the compiler. iykyk π₯$bf->set_option_value($option, $value)β Private method to set the value of a build option. Do not use outside of the dpkg project. Back off, it's private π« (affectionate)$value = $bf->get_option_value($option)β Private method to get the value of a build option. Do not use outside of the dpkg project. Same deal, bestie π ββοΈ$bf->strip($flag, $value, $source, $maint)β Update the build flag$flagby stripping the flags listed in$valueand record its origin as$source(if defined). Record it as maintainer modified if$maintis defined and true. Strip it, remove it, cleanse the timeline π§$bf->append($flag, $value, $source, $maint)β Append the options listed in$valueto the current value of the flag$flag. Record its origin as$source(if defined). Record it as maintainer modified if$maintis defined and true. Add to the end, cute π«$bf->prepend($flag, $value, $source, $maint)β Prepend the options listed in$valueto the current value of the flag$flag. Record its origin as$source(if defined). Record it as maintainer modified if$maintis defined and true. Same but in the front, main character placement π$bf->update_from_conffile($file, $source)β Update the current build flags based on the configuration directives contained in$file. Seedpkg-buildflags(1)for the format of the directives.
$source is the origin recorded for any build flag set or modified. Gotta keep the receipts π§Ύ
$value = $bf->get($flag)β Return the value associated to the flag. It might be undef if the flag doesn't exist. So like, check before you assume bestie π@areas = $bf->get_feature_areas()β Return the feature areas (i.e. the area valueshas_featureswill return true for).%features = $bf->get_features($area)β Return, for the given area, a hash with keys as feature names, and values as booleans indicating whether the feature is enabled or not. Lit π₯$origin = $bf->get_origin($flag)β Return the origin associated to the flag. It might be undef if the flag doesn't exist.$bool = $bf->is_maintainer_modified($flag)β Return true if the flag is modified by the maintainer. Detective mode π΅οΈββοΈ$bool = $bf->has_features($area)β Returns true if the given area of features is known, and false otherwise. The only currently recognized feature areas are"future","qa","sanitize","optimize","hardening"and"reproducible". Yes queen, the same six again π$bool = $bf->has($option)β Returns a boolean indicating whether the flags exists in the object. (Spelling's the original's, we don't touch facts, only vibes β¨)@flags = $bf->list()β Returns the list of flags stored in the object. The whole roster π
π CHANGES π
the lore drop, chronological, in order π
β Version 1.06 (dpkg 1.21.15)
- New method:
$bf->get_feature().
β Version 1.05 (dpkg 1.21.14)
- New option:
'vendor_defaults'innew(). - New methods:
$bf->load_vendor_defaults(),$bf->use_feature(),$bf->set_builtin(),$bf->get_builtins().
β Version 1.04 (dpkg 1.20.0)
- New method:
$bf->unset().
β Version 1.03 (dpkg 1.16.5)
- New method:
$bf->get_feature_areas()to list possible values for$bf->get_features. - New method
$bf->is_maintainer_modified()and new optional parameter to$bf->set(),$bf->append(),$bf->prepend(),$bf->strip().
β Version 1.02 (dpkg 1.16.2)
- New methods:
$bf->get_features(),$bf->has_features(),$bf->set_feature().
β Version 1.01 (dpkg 1.16.1)
- New method:
$bf->prepend()very similar toappend(). Implement support of the prepend operation everywhere. - New method:
$bf->load_maintainer_config()that update the build flags based on the package maintainer directives.
β Version 1.00 (dpkg 1.15.7)
- Mark the module as public. It's official, she's out ππ
ngl the module went public in 1.15.7 and honestly? we've been obsessed ever since π«Ά
and that's the whole page, bestie β this was Dpkg::BuildFlags(3perl) from libdpkg-perl, version 1.23.11-dirty, dated 2026-09-09 ππ slay, periodt, go query some flags β¨
π¦ 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