saltstack/salt — pull request #14883 by Nibbler999 (2014-08-10 15:26:36+00:00)
Title: Speed up highstate runs when all packages are already installed

Most of the time when we run a highstate there is nothing to change and all the packages we want are already installed. The slowest part of our runs is this part where Salt wants a list of all packages installed and all packages in the repos.

```
[INFO ] Executing command 'repoquery --queryformat="%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-%{REPOID}" --all --pkgnarrow=installed' in directory '/root'
[INFO ] Executing command 'repoquery --queryformat="%{NAME}_|-%{ARCH}" --pkgnarrow=all --all --plugins' in directory '/root'
```

This can be skipped if we check if the packages are already installed by asking the package manager. This patch speeds up our runs significantly, so hopefully we can get it cleaned up and added to Salt.