Skip to content

Commit

Permalink
Update tor upgrade check for newer aptitude
Browse files Browse the repository at this point in the history
Between the version of aptitude on Xenial and that on Focal, empty
searches started returning 1, causing `Check whether tor will be
upgraded` to fail. Let's ignore the exit code, since what we care
about is whether "tor" is in the stdout.

We could use `apt list --upgradable`, but that command warns about
lack of a stable CLI, and additionally we'd have to munge the output
further to inspect it.
  • Loading branch information
rmol authored and Conor Schaefer committed Sep 14, 2020
1 parent 773012d commit d0ddfc5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions install_files/ansible-base/roles/common/tasks/apt_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
command: aptitude search '~U' --display-format '%p' --disable-columns
register: tor_upgradable_result
changed_when: false
# aptitude >= 0.7.6 will exit non-zero if no hits
failed_when: false

- name: Hold tor package to prevent upgrade breaking SSH connection.
command: aptitude hold tor
Expand Down

0 comments on commit d0ddfc5

Please sign in to comment.