

def preseed_package(pkg_name, preseed):
    "\n    Enable unattended package installation by preseeding ``debconf``\n    parameters.\n\n    Example::\n\n        import fabtools\n\n        # Unattended install of Postfix mail server\n        fabtools.deb.preseed_package('postfix', {\n            'postfix/main_mailer_type': ('select', 'Internet Site'),\n            'postfix/mailname': ('string', 'example.com'),\n            'postfix/destinations': ('string', 'example.com, localhost.localdomain, localhost'),\n        })\n        fabtools.deb.install('postfix')\n\n    "
    for (q_name, _) in preseed.items():
        (q_type, q_answer) = preseed
        run_as_root(('echo "%(pkg_name)s %(q_name)s %(q_type)s %(q_answer)s" | debconf-set-selections' % locals()))

dataset/ETHPy150Open ronnix/fabtools/fabtools/deb.py preseed_package/VarMisuse@35/225 `_`->`preseed`