Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_local.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/be_local.c
parentc51b9ca0ad897428a008701e35f8f11fa0ad9046 (diff)
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/be_local.c')
-rw-r--r--lib/libalpm/be_local.c16
1 files changed, 1 insertions, 15 deletions
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) {