saltstack/salt — pull request #2706 by borgstrom (2012-11-26 06:57:36+00:00)
Title: Speed up yum/rpm version() if we're not looking for something specific

While testing things I end up applying state a lot, and when yum is
invoked for every single `pkg.installed` state it ends up taking a
really long time.

Since the comments for list_pkgs say it's being used to handle version
matching I think it's a reasonable assumption to make that if the
package name provided to `version` does not contain a number then the user
doesn't have any complex version matching requirements.

This makes my state run times go from:

real 1m16.450s
user 0m3.016s
sys 0m0.657s

To:

real 0m4.689s
user 0m1.780s
sys 0m0.333s

Let me know if you have any conerns about this.