From f76ffaa79fd622645104ccfac805a1c37f4a9f31 Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Thu, 7 Jul 2016 18:13:16 +0900 Subject: [PATCH] display storage info from "pkgcmd -l" output. Change-Id: I1bbbdc770d1f1775c402467a7027a029109b34d0 Signed-off-by: jongmyeongko --- src/pkg_cmd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pkg_cmd.c b/src/pkg_cmd.c index 487133a..38b72f3 100644 --- a/src/pkg_cmd.c +++ b/src/pkg_cmd.c @@ -447,6 +447,7 @@ static int __pkgmgr_list_cb(const pkgmgrinfo_pkginfo_h handle, void *user_data) char *pkg_version = NULL; char *pkg_label = NULL; bool for_all_users = 0; + pkgmgrinfo_installed_storage storage; ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid); if (ret == -1) { @@ -473,8 +474,15 @@ static int __pkgmgr_list_cb(const pkgmgrinfo_pkginfo_h handle, void *user_data) return ret; } - printf("%s\tpkg_type [%s]\tpkgid [%s]\tname [%s]\tversion [%s]\n", - for_all_users ? "system apps" : "user apps ", pkg_type, pkgid, pkg_label, pkg_version); + ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage); + if (ret == -1) { + printf("Failed to get pkgmgrinfo_pkginfo_get_installed_storage\n"); + return ret; + } + + printf("%s\tpkg_type [%s]\tpkgid [%s]\tname [%s]\tversion [%s]\tstorage [%s]\n", + for_all_users ? "system apps" : "user apps ", pkg_type, pkgid, pkg_label, pkg_version, + (storage == PMINFO_EXTERNAL_STORAGE) ? "external":"internal"); return ret; } -- 2.7.4