+ if (check) {
+ found = zpm_package_hash(&pkg, pkgid, hash);
+ char *ehash = zpm_db_string(&pkg, "select hash from packages_pkgid where pkgid = %Q", pkgid);
+ if (ehash && found && !strcmp(ehash, hash)) {
+ found = 1;
+ } else {
+ found = 0;
+ }
+ } else if (set) {