From 219808714f94788a66a430786c552f60e95b1a01 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 27 Sep 2007 23:39:37 -0500 Subject: Add 'full' parameter to alpm_pkg_load In most cases, we want to fully scan a package when we load it, which serves as a integrity verification check. However, there are times when it is only desired to read the metadata and nothing else, so allow the caller of pkg_load to choose the behavior they need. This pays big dividends in speeding up pacman cache cleaning functionality. Old (729 packages): real 1m43.717s user 1m20.785s sys 0m2.993s New (729 packages): real 0m25.607s user 0m19.389s sys 0m0.543s Signed-off-by: Dan McGee --- lib/libalpm/add.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 442b3180..47a885ec 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -65,7 +65,7 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) _alpm_log(PM_LOG_DEBUG, "loading target '%s'\n", name); - if(alpm_pkg_load(name, &pkg) != 0) { + if(alpm_pkg_load(name, 1, &pkg) != 0) { goto error; } pkgname = alpm_pkg_get_name(pkg); @@ -97,7 +97,7 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) pmpkg_t *newpkg; _alpm_log(PM_LOG_WARNING, _("replacing older version %s-%s by %s in target list\n"), pkg->name, pkg->version, pkgver); - if((newpkg = _alpm_pkg_load(name)) == NULL) { + if((newpkg = _alpm_pkg_load(name, 1)) == NULL) { /* pm_errno is already set by pkg_load() */ goto error; } -- cgit v1.2.3-54-g00ecf