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/be_local.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'lib/libalpm/be_local.c') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index dc9e361d..ba415448 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -99,12 +99,6 @@ static const char *_cache_get_arch(alpm_pkg_t *pkg) return pkg->arch; } -static off_t _cache_get_size(alpm_pkg_t *pkg) -{ - LAZY_LOAD(INFRQ_DESC, -1); - return pkg->size; -} - static off_t _cache_get_isize(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); @@ -243,7 +237,6 @@ static struct pkg_operations local_pkg_ops = { .get_installdate = _cache_get_installdate, .get_packager = _cache_get_packager, .get_arch = _cache_get_arch, - .get_size = _cache_get_size, .get_isize = _cache_get_isize, .get_reason = _cache_get_reason, .has_scriptlet = _cache_has_scriptlet, @@ -621,15 +614,8 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) READ_NEXT(); info->reason = (alpm_pkgreason_t)atoi(line); } else if(strcmp(line, "%SIZE%") == 0) { - /* NOTE: the CSIZE and SIZE fields both share the "size" field - * in the pkginfo_t struct. This can be done b/c CSIZE - * is currently only used in sync databases, and SIZE is - * only used in local databases. - */ READ_NEXT(); - info->size = _alpm_strtoofft(line); - /* also store this value to isize */ - info->isize = info->size; + info->isize = _alpm_strtoofft(line); } else if(strcmp(line, "%REPLACES%") == 0) { READ_AND_SPLITDEP(info->replaces); } else if(strcmp(line, "%DEPENDS%") == 0) { -- cgit v1.2.3