diff options
author | Dan McGee <dan@archlinux.org> | 2011-09-03 02:26:07 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-09-03 02:26:07 +0200 |
commit | 83a1e4fee39321358858841069e1fe36d44edefc (patch) | |
tree | 9638a56a69aa45c071dd3934dfcb2b9fca8e5791 /lib/libalpm/delta.c | |
parent | c51b9ca0ad897428a008701e35f8f11fa0ad9046 (diff) | |
download | pacman-83a1e4fee39321358858841069e1fe36d44edefc.tar.gz pacman-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/delta.c')
-rw-r--r-- | lib/libalpm/delta.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index c88955f7..1dd2bf44 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -249,12 +249,11 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg) { - off_t pkgsize = alpm_pkg_get_size(pkg); - alpm_list_t *unused = find_unused( + ASSERT(pkg != NULL, return NULL); + return find_unused( alpm_pkg_get_deltas(pkg), alpm_pkg_get_filename(pkg), - pkgsize * MAX_DELTA_RATIO); - return unused; + pkg->size * MAX_DELTA_RATIO); } /** @} */ |