apt: don't markmanual if apt-mark is not installed (#40600)

* apt: don't markmanual if apt-mark is not installed

* Add warning
This commit is contained in:
Martin Krizek 2018-05-23 14:43:18 +02:00 committed by GitHub
parent 8b317e77c2
commit a3cfe0d72f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -492,7 +492,13 @@ def mark_installed_manually(m, packages):
if not packages: if not packages:
return return
apt_mark_cmd_path = m.get_bin_path("apt-mark", required=True) apt_mark_cmd_path = m.get_bin_path("apt-mark")
# https://github.com/ansible/ansible/issues/40531
if apt_mark_cmd_path is None:
m.warn("Could not find apt-mark binary, not marking package(s) as manually installed.")
return
cmd = "%s manual %s" % (apt_mark_cmd_path, ' '.join(packages)) cmd = "%s manual %s" % (apt_mark_cmd_path, ' '.join(packages))
rc, out, err = m.run_command(cmd) rc, out, err = m.run_command(cmd)