Skip to content

Commit

Permalink
Merge pull request #12873 from mpurg/fix_bash_dpkg_pkg_applicability
Browse files Browse the repository at this point in the history
Fix dpkg package applicability check in bash
  • Loading branch information
dodys authored Jan 23, 2025
2 parents 04e847f + 2207ea4 commit ccbc650
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/macros/10-bash.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2142,9 +2142,9 @@ This macro creates a Bash conditional which uses dpkg to check if a package pass
#}}
{{%- macro bash_pkg_conditional_dpkg(package, op=None, ver=None) -%}}
{{%- if ver -%}}
dpkg-query --show --showformat='${db:Status-Status}\n' '{{{ package }}}' 2>/dev/null | grep -q installed && {{{ bash_compare_version_dpkg(package, op, ver) }}}
dpkg-query --show --showformat='${db:Status-Status}\n' '{{{ package }}}' 2>/dev/null | grep -q '^installed' && {{{ bash_compare_version_dpkg(package, op, ver) }}}
{{%- else -%}}
dpkg-query --show --showformat='${db:Status-Status}\n' '{{{ package }}}' 2>/dev/null | grep -q installed
dpkg-query --show --showformat='${db:Status-Status}\n' '{{{ package }}}' 2>/dev/null | grep -q '^installed'
{{%- endif -%}}
{{%- endmacro -%}}

Expand Down

0 comments on commit ccbc650

Please sign in to comment.