diff options
author | Christopher M. Fuhrman <cfuhrman@panix.com> | 2016-04-14 03:51:29 -0700 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2016-04-14 12:51:29 +0200 |
commit | 8c6a3e732edc2f70be63702c46d8d295553f5e33 (patch) | |
tree | 5f2f41bacf417146260a9ea8e1542c9d6768868a /packaging | |
parent | 4b3ab52374cc6e17cc88e290f016e0a4d0057f6b (diff) | |
download | ansible-modules-extras-8c6a3e732edc2f70be63702c46d8d295553f5e33.tar.gz |
pkgin: Fix bad regexp which did not catch packages such as p5-SVN-Notify
The previous version of my regexp did not take into account packages
such as 'p5-Perl-Tidy' or 'p5-Test-Output', so use a greedy match up to
the last occurrance of '-' for matching the package. This regex has
been extensively tested using all packages as provided by pkgsrc-2016Q1[1].
Footnotes:
[1] http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/?only_with_tag=pkgsrc-2016Q1
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/os/pkgin.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packaging/os/pkgin.py b/packaging/os/pkgin.py index cd48385e..055891eb 100755 --- a/packaging/os/pkgin.py +++ b/packaging/os/pkgin.py @@ -164,7 +164,7 @@ def query_package(module, name): # Search for package, stripping version # (results in sth like 'gcc47-libs' or 'emacs24-nox11') - pkg_search_obj = re.search(r'^([a-zA-Z]+[0-9]*[\-]*\w*)-[0-9]', pkgname_with_version, re.M) + pkg_search_obj = re.search(r'^(.*?)\-[0-9][0-9.]*(nb[0-9]+)*', pkgname_with_version, re.M) # Do not proceed unless we have a match if not pkg_search_obj: |