# Pacman module breaks when encountering certain package names

**URL:** <https://forum.ansible.com/t/pacman-module-breaks-when-encountering-certain-package-names/24752>\
**Category:** Ansible Developer\
**Tags:** ansible-lint\
**Created:** [June 17, 2017, 12:00am UTC](https://forum.ansible.com/t/pacman-module-breaks-when-encountering-certain-package-names/24752 "2017-06-17T00:00:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_V\_Chiarelli](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bruce\_V\_Chiarelli](https://forum.ansible.com/u/Bruce_V_Chiarelli)\
**Post date:** [June 17, 2017, 12:00am UTC](https://forum.ansible.com/t/pacman-module-breaks-when-encountering-certain-package-names/24752/1 "2017-06-17T00:00:23Z")

</div>

The Arch Linux package naming guidelines[1] specify that "package  
names should consist of \*alphanumeric characters only\*; all letters  
should be \*lowercase\*" (emphasis in original).

In reality, this guideline is not adhered to. In fact, \*most\* packages  
have hyphens in their names, and some have a few other characters beyond  
that.

This regex is used to parse the output of "pacman -Qu": '([\w-]+)  
((?:\S+)-(?:\S+)) -\> ((?:\S+)-(?:\S+))' [2] --- ie, we assume that  
package names have only alphanumeric characters and hyphens. On the  
other hand, the sanity check in makepkg (part of the distribution  
itself) allows '[:alnum:]+\_.@-' [3].

Boring story longer, Ansible broke for me today because pacman told it  
it was going to upgrade "crypto++". Adding a plus to the first match  
group of the regex above remedied the issue.

-Bruce

[1] [https://wiki.archlinux.org/index.php/Arch\_packaging\_standards#Package\_naming](https://wiki.archlinux.org/index.php/Arch_packaging_standards#Package_naming)  
[2] lib/ansible/modules/packaging/os/pacman.py:211  
[3] /usr/share/makepkg/lint\_pkgbuild/pkgname.sh:49 (on Archlinux)
