summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-09-02 19:26:07 -0500
committerDan McGee <dan@archlinux.org>2011-09-02 19:26:07 -0500
commit83a1e4fee39321358858841069e1fe36d44edefc (patch)
tree9638a56a69aa45c071dd3934dfcb2b9fca8e5791 /lib/libalpm/package.c
parentc51b9ca0ad897428a008701e35f8f11fa0ad9046 (diff)
downloadpacman-83a1e4fee39321358858841069e1fe36d44edefc.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c5
1 files changed, 1 insertions, 4 deletions
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)