- found = zpm_findpkg(opt->zpmdb, pkgstr, NULL);
- if (found) {
- rv = zpm_vercmp(found, latest);
- if (rv == 1) {
- latest = found;
- pkgfile = opt->zpmdb->path;
+ if (!opt->onlylocalinstalled) {
+ found = zpm_findpkg(opt->zpmdb, pkgstr, NULL);
+ if (found) {
+ rv = zpm_vercmp(found, latest);
+ if (rv == 1) {
+ latest = found;
+ pkgfile = opt->zpmdb->path;
+ }