From 83a1e4fee39321358858841069e1fe36d44edefc Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 2 Sep 2011 19:26:07 -0500 Subject: Clean up handling of size fields We currently have csize, isize, and size concepts, and sometimes the difference isn't clear. Ensure the following holds: * size (aka csize): always the compressed size of the package; available for everything except local packages (where it will return 0) * isize: always the installed size of the package; available for all three package types Signed-off-by: Dan McGee --- lib/libalpm/package.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 487b56d9..56788808 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -92,7 +92,6 @@ static time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg->builddate static time_t _pkg_get_installdate(alpm_pkg_t *pkg) { return pkg->installdate; } static const char *_pkg_get_packager(alpm_pkg_t *pkg) { return pkg->packager; } static const char *_pkg_get_arch(alpm_pkg_t *pkg) { return pkg->arch; } -static off_t _pkg_get_size(alpm_pkg_t *pkg) { return pkg->size; } static off_t _pkg_get_isize(alpm_pkg_t *pkg) { return pkg->isize; } static alpm_pkgreason_t _pkg_get_reason(alpm_pkg_t *pkg) { return pkg->reason; } static int _pkg_has_scriptlet(alpm_pkg_t *pkg) { return pkg->scriptlet; } @@ -138,7 +137,6 @@ struct pkg_operations default_pkg_ops = { .get_installdate = _pkg_get_installdate, .get_packager = _pkg_get_packager, .get_arch = _pkg_get_arch, - .get_size = _pkg_get_size, .get_isize = _pkg_get_isize, .get_reason = _pkg_get_reason, .has_scriptlet = _pkg_has_scriptlet, @@ -258,8 +256,7 @@ const char SYMEXPORT *alpm_pkg_get_arch(alpm_pkg_t *pkg) off_t SYMEXPORT alpm_pkg_get_size(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); - pkg->handle->pm_errno = 0; - return pkg->ops->get_size(pkg); + return pkg->size; } off_t SYMEXPORT alpm_pkg_get_isize(alpm_pkg_t *pkg) -- cgit v1.2.3-24-g4f1b