apt: export env vars before run dpkg

Without this change, some trouble may occur when "deb" parameter
is used as env vars controlling dpkg are not set. For example,
installing a package that requires user input will never end since
DEBIAN_FRONTEND=noninteractive is not set.

So export env vars in APT_ENV_VARS before run dpkg, like in cases
using apt-get/aptitude.
pull/18777/head
Arata Notsu 9 years ago committed by Matt Clay
parent 47d0719cfe
commit a9f23ac54f

@ -443,6 +443,9 @@ def install_deb(m, debs, cache, force, install_recommends, dpkg_options):
if force: if force:
options += " --force-all" options += " --force-all"
for (k,v) in APT_ENV_VARS.iteritems():
os.environ[k] = v
cmd = "dpkg %s -i %s" % (options, " ".join(pkgs_to_install)) cmd = "dpkg %s -i %s" % (options, " ".join(pkgs_to_install))
rc, out, err = m.run_command(cmd) rc, out, err = m.run_command(cmd)
if "stdout" in retvals: if "stdout" in retvals:

Loading…
Cancel
Save