summaryrefslogtreecommitdiff
path: root/src/ver.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-12 19:17:46 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-12 19:17:46 +0300
commit36b5cee98b1e80a493d291e9bffa1ed120ed908a (patch)
tree88855947e73b5e0f0a0dda3bd138064c401ff441 /src/ver.c
parentdee6ffa492c2efee982dcd0b4724213317eceb37 (diff)
downloadapk-tools-36b5cee98b1e80a493d291e9bffa1ed120ed908a.tar.gz
apk-tools-36b5cee98b1e80a493d291e9bffa1ed120ed908a.tar.bz2
apk-tools-36b5cee98b1e80a493d291e9bffa1ed120ed908a.tar.xz
apk-tools-36b5cee98b1e80a493d291e9bffa1ed120ed908a.zip
db, pkg: separate structure for fields of installed packages
this makes the database package entry smaller, and we propbably get more fields to installed_package later too. this cleans up the way scripts are stored and is a preparation for supporting triggers. some parsing for trigger meta-data. ref #45.
Diffstat (limited to 'src/ver.c')
-rw-r--r--src/ver.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ver.c b/src/ver.c
index 24754c1..5a8fb9c 100644
--- a/src/ver.c
+++ b/src/ver.c
@@ -93,7 +93,7 @@ static void ver_print_package_status(struct apk_package *pkg, const char *limit)
static int ver_main(void *ctx, struct apk_database *db, int argc, char **argv)
{
struct ver_ctx *ictx = (struct ver_ctx *) ctx;
- struct apk_package *pkg;
+ struct apk_installed_package *ipkg;
struct apk_name *name;
int i, j, ret = 0;
@@ -105,9 +105,9 @@ static int ver_main(void *ctx, struct apk_database *db, int argc, char **argv)
printf("%-42sAvailable:\n", "Installed:");
if (argc == 0) {
- list_for_each_entry(pkg, &db->installed.packages,
+ list_for_each_entry(ipkg, &db->installed.packages,
installed_pkgs_list) {
- ver_print_package_status(pkg, ictx->limchars);
+ ver_print_package_status(ipkg->pkg, ictx->limchars);
}
goto ver_exit;
}
@@ -121,7 +121,7 @@ static int ver_main(void *ctx, struct apk_database *db, int argc, char **argv)
}
for (j = 0; j < name->pkgs->num; j++) {
struct apk_package *pkg = name->pkgs->item[j];
- if (apk_pkg_get_state(pkg) == APK_PKG_INSTALLED)
+ if (pkg->ipkg != NULL)
ver_print_package_status(pkg, ictx->limchars);
}
}