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

(cherry picked from commit a3cfe0d72f)
pull/40656/head
Martin Krizek 7 years ago committed by GitHub
parent 12ac23bad3
commit 18581adbb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- skip marking packages as manually installed when apt-mark is not available (https://github.com/ansible/ansible/pull/40600)

@ -473,7 +473,13 @@ def mark_installed_manually(m, packages):
if not packages:
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))
rc, out, err = m.run_command(cmd)

Loading…
Cancel
Save