mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
slackpkg: fix matching some special cases in package names. (#505)
* slackpkg: fix matching some special cases in package names. * Add chagelog/fragments file * Update changelogs/fragments/505-slackpkg_fix_matching_some_special_cases_in_package_names.yml Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
parent
a3953106e6
commit
736f2ecac0
2 changed files with 6 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- slackpkg - fix matching some special cases in package names (https://github.com/ansible-collections/community.general/pull/505).
|
|
@ -72,7 +72,10 @@ def query_package(module, slackpkg_path, name):
|
|||
import re
|
||||
|
||||
machine = platform.machine()
|
||||
pattern = re.compile('^%s-[^-]+-(%s|noarch)-[^-]+$' % (re.escape(name), re.escape(machine)))
|
||||
# Exception for kernel-headers package on x86_64
|
||||
if name == 'kernel-headers' and machine == 'x86_64':
|
||||
machine = 'x86'
|
||||
pattern = re.compile('^%s-[^-]+-(%s|noarch|fw)-[^-]+$' % (re.escape(name), re.escape(machine)))
|
||||
packages = [f for f in os.listdir('/var/log/packages') if pattern.match(f)]
|
||||
|
||||
if len(packages) > 0:
|
||||
|
|
Loading…
Reference in a new issue