pátek 2. prosince 2011

Multiple groups matching in cnucnu

Cnucnu is a tool that provides upstream release monitoring service with bugzilla
integration. It can monitor upstream projects of your interest and alert you everytime the new version is released. This tool is already deployed in Fedora project infrastructure. If you want to monitor your packages in Fedora simply follow steps on: http://fedoraproject.org/wiki/Upstream_Release_Monitoring.

Cnucnu will then check the preset URL and compare with the package versions in Fedora. If newer version is found, bug is filled. All what you need to get this work is to correctly set the URL and correct regex for your package. Currently there are templates for mostly used patterns, but if your package uses special naming you will have to create custom regex. You can develop the regex interactively by running:
cnucnu --shell
Then specify URL to check and iteratively develop the regex. The regex specify what to look for on the URL. You also need to specify how looks the version substring. In the recent version of cnucnu the first group match (part of the regex enclosed by parenthesis) was used for this. The problem arise if you specify more than one group. In such case the cnucnu hangs. This is not good, thus I reported the problem to bugzilla and created simple patch that fixes this. The patch concatenates all results from all groups together (the dot is used as separator). This also allows you to parse more complex strings than before, simple example:
regex: package-0*(\d+)_0*(\d+).tar.gz
Cnucnu without patch will hang when parsing this. Cnucnu with patch parses this as version 4.1. Hopefully the patch will be integrated soon.

Žádné komentáře: