saltstack/salt — pull request #2526 by archtaku (2012-11-12 05:41:21+00:00)
Title: pacman.py cleanup

Some tweaks to the code I added for #2291. These include:

1) Better logging when the package is not successfully cached, or a bad
path is provided for a local package file.
2) If the package file can't be cached or found locally, the calls to
list_pkgs() are skipped and an empty dict is returned. No need to run
these functions when you know there will be no change.
3) The "source" kwarg is explicitly defined in the function definition
for install().
4) More descriptive docstring for install().
5) Better regexes in _parse_pkg_meta().

Also, in testing I found that the loader throws a traceback when reading
__virtual__() in yumpkg5.py, because part of the value of the osrelease
grain is passed to the int() python built-in. In rolling release distros
like Arch the osrelease grain is empty, so a check has been added to
avoid this traceback.