diff --git a/changelogs/fragments/dnf-packagename-parse.yaml b/changelogs/fragments/dnf-packagename-parse.yaml new file mode 100644 index 00000000000..a50182a9142 --- /dev/null +++ b/changelogs/fragments/dnf-packagename-parse.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: + - 'dnf - fix package parsing to handle git snapshot nevra' + - 'dnf - enable package name specification for absent' diff --git a/lib/ansible/modules/packaging/os/dnf.py b/lib/ansible/modules/packaging/os/dnf.py index 9ef66cd0e6c..9e791218178 100644 --- a/lib/ansible/modules/packaging/os/dnf.py +++ b/lib/ansible/modules/packaging/os/dnf.py @@ -383,7 +383,7 @@ class DnfModule(YumDnf): ] rpm_arch_re = re.compile(r'(.*)\.(.*)') - rpm_nevr_re = re.compile(r'(\S+)-(?:(\d*):)?(.*)-(~?\w+[\w.]*)') + rpm_nevr_re = re.compile(r'(\S+)-(?:(\d*):)?(.*)-(~?\w+[\w.+]*)') try: arch = None rpm_arch_match = rpm_arch_re.match(packagename)