summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-12-27 14:06:03 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-12-27 14:06:03 +0200
commit34756e6b87e7c8c055a6e050cad90e0b0a549357 (patch)
tree55fbdd7fbc5c44b0394573415341b966a7914b1c /src/package.c
parent83b098d357fa8508834d65bf2fbfee6c288cbd20 (diff)
downloadapk-tools-34756e6b87e7c8c055a6e050cad90e0b0a549357.tar.gz
apk-tools-34756e6b87e7c8c055a6e050cad90e0b0a549357.tar.bz2
apk-tools-34756e6b87e7c8c055a6e050cad90e0b0a549357.tar.xz
apk-tools-34756e6b87e7c8c055a6e050cad90e0b0a549357.zip
solver: report number of (mega)bytes used
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c
index 1c7bd2d..0283c25 100644
--- a/src/package.c
+++ b/src/package.c
@@ -82,6 +82,7 @@ struct apk_installed_package *apk_pkg_install(struct apk_database *db,
/* Overlay override information resides in a nameless package */
if (pkg->name != NULL) {
db->installed.stats.packages++;
+ db->installed.stats.bytes += pkg->installed_size;
list_add_tail(&ipkg->installed_pkgs_list,
&db->installed.packages);
}
@@ -97,8 +98,10 @@ void apk_pkg_uninstall(struct apk_database *db, struct apk_package *pkg)
if (ipkg == NULL)
return;
- if (db != NULL)
+ if (db != NULL) {
db->installed.stats.packages--;
+ db->installed.stats.bytes -= pkg->installed_size;
+ }
list_del(&ipkg->installed_pkgs_list);
@@ -729,7 +732,7 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg,
db->compat_notinstallable = 1;
}
db->compat_newfeatures = 1;
- return 1;
+ return 2;
}
if (APK_BLOB_IS_NULL(value))
return -1;