..::Debconf::Client::ConfModule(3)

πŸ’– ..::Debconf::Client::ConfModule(3) β€” Debconf πŸ’–

okay bestie, pull up a chair because we're talking about Debconf::Client::ConfModule, the client module for ConfModules, and honestly? it's giving main character energy for Debian's whole configuration-management situation. ✨

🌸 NAME 🌸

Debconf::Client::ConfModule β€” the client module for ConfModules, fr fr.


✨ SYNOPSIS ✨

use Debconf::Client::ConfModule ':all';
version('2.0');
my $capb=capb('backup');
input("medium", "foo/bar");
my @ret=go();
if ($ret[0] == 30) {
       # Back button pressed.
       ...
}
...

like. look at that. it's so clean. 🫢


πŸ’… DESCRIPTION πŸ’…

so basically this is the module that makes writing ConfModules for Debian's configuration management system not a whole ordeal. it can talk to a FrontEnd through the debconf protocol β€” and if you wanna read that protocol in full, it's documented in the debconf_specification in Debian policy. no cap. πŸ“œ

the design is lowkey iconic: every single command in the protocol gets its own function in this module, and the function name is just the command name but lower-cased. so you call the function, you pass in whatever parameters you want to follow the command, and you're done. that's it. that's the vibe. πŸ’–

and here's the part you need to remember: context matters, bestie.

  • if the function is called in scalar context, it returns any textual return code. just the text, that's it.
  • if it's called in list context, you get an array of two things: the numeric return code and the textual return code. both. together. iconic behavior honestly. πŸ‘‘

oh and also β€” this module uses Exporter to export all the functions it defines. so if you want everything, you just import :all and you're set. 🌈

πŸŽ€ import πŸŽ€

this one makes sure a FrontEnd is actually running. and yeah, it's a little hackish, we said what we said. πŸ™ˆ

  • if DEBIAN_HAS_FRONTEND is set, then a FrontEnd is assumed to be running already. cool cool.
  • if it's not set, one gets started up automatically, and stdin and out are connected to it.
⭐ note note note: this function is always run when the module is loaded in the usual way. so like, you don't have to think about it. it just happens. periodt.

πŸ’œ stop πŸ’œ

the frontend doesn't send a return code here, so we cannot try to read it β€” or we'll block. like actually block. do not do it. 😭

πŸ¦‹ AUTOLOAD πŸ¦‹

creates handler functions for commands on the fly. magic. wizardry. slay. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

  • the debconf specification, which lives at /usr/share/doc/debian-policy/debconf_specification.txt.gz β€” go read it, bestie, it's right there. πŸ“–

🌸 AUTHOR 🌸

Joey Hess <joeyh@debian.org> β€” thank you for your service, king. 🫢


and that's the whole page!! this was ..::Debconf::Client::ConfModule(3) from the Debconf manual, dated 2026-02-16. go forth and write your ConfModules, you're gonna eat. πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from