Gather proper transaction stats (take into account binpkgs in cachedir, and "preserved" pkgs).

This commit is contained in:
Juan RP
2014-07-13 09:56:06 +02:00
parent ad28774f2f
commit 79fe312302
4 changed files with 56 additions and 22 deletions

View File

@ -228,6 +228,22 @@ xbps_repository_pkg_path(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
return xbps_xasprintf("%s/%s.%s.xbps", repoloc, pkgver, arch);
}
bool
xbps_binpkg_exists(struct xbps_handle *xhp, xbps_dictionary_t pkgd)
{
char *binpkg;
bool exists = true;
if ((binpkg = xbps_repository_pkg_path(xhp, pkgd)) == NULL)
return false;
if (access(binpkg, R_OK) == -1)
exists = false;
free(binpkg);
return exists;
}
bool
xbps_pkg_has_rundeps(xbps_dictionary_t pkgd)
{