Rex::C...kgConf(3pm)

πŸ’– Rex::C...kgConf(3pm) πŸ’–

okay bestie, so this is Rex::Commands::PkgConf, and it lives in the User Contributed Perl Documentation corner of the manual-page universe β€” yes, that's the manual name, no I'm not making it up ✨


πŸŽ€ NAME πŸŽ€

Rex::Commands::PkgConf β€” Configure packages


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so basically? With this module you can configure packages. Periodt.

Right now it's giving Debian-only energy because it uses debconf, but lowkey it was designed to be extendable β€” so future support for other things is very much main character potential. πŸ‘‘


🌸 SYNOPSIS 🌸

my %options = get_pkgconf('postfix');
say $options{'postfix/relayhost'}->{value};

# Only obtain one value
my %options = get_pkgconf('postfix', 'postfix/relayhost');
say $options{'postfix/relayhost'}->{value};

# Set options
set_pkgconf("postfix", [
   {question => 'chattr', type => 'boolean', value => 'false'},
   {question => 'relayhost', type => 'string', value => 'relay.example.com'},
]);

# Don't update if it's already set
set_pkgconf("mysql-server-5.5", [
   {question => 'mysql-server/root_password', type => 'string', value => 'mysecret'},
   {question => 'mysql-server/root_password_again', type => 'string', value => 'mysecret'},
], no_update => 1);

✨ EXPORTED FUNCTIONS ✨

πŸ’… get_pkgconf($package, [$question])

Use this one to query existing package configurations, okay? It's literally the vibe-check-the-current-state function.

  • Without a question specified, it returns all the options for the specified package as a hash.
  • With a question specified, it returns only that option. 🎯

Every question comes back with the question as the key, and the value as a hashref. That hashref contains these keys: question, value and already_set. And already_set is true if that question has already been answered. iykyk πŸ’–

# Only obtain one value
my %options = get_pkgconf('postfix', 'postfix/relayhost');
say $options{'postfix/relayhost'}->{question};
say $options{'postfix/relayhost'}->{value};
say $options{'postfix/relayhost'}->{already_set};

🫢 set_pkgconf($package, $values, [%options])

Use this one to set package configurations. Yes, the glow-up function. πŸ”₯

At least the package name and values must be specified β€” no skimping, bestie. And the values must be an array ref, where each item contains a hashref with the attributes that are required by the package configuration program. ✨

For example, for debconf, this has to be the question, the type and the answer. In this case the types can be any acceptable debconf type: string, boolean, select, multiselect, note, text, password.

Optionally, the option no_update may be true β€” in which case the question will not be updated if it has already been set. it's giving "don't touch it, it's already cute" energy πŸ™ˆ

See the synopsis for examples, bestie β€” they're right up there. πŸ‘†

πŸ’– that's the whole page, no notes πŸ’–

and a lil sign-off for the credits, because we always cite our sources: this manual page ships with perl v5.40.1, dated 2025-10-03, and it's titled Rex::C...kgConf(3pm). slay πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from