const char kRpk[] = "rpk";
+const char kInstalledInternally[] = "installed_internal";
+
} // namespace
manifest->metadata = g_list_append(manifest->metadata, md);
}
+ // set installed_storage if package is installed
+ // this is internal field in package manager but after reading configuration
+ // we must know it
+ common_installer::PkgQueryInterface pkg_query(
+ manifest->package, context_->uid.get());
+ if (!manifest->installed_storage) {
+ if (manifest_location_ == ManifestLocation::INSTALLED ||
+ manifest_location_ == ManifestLocation::RECOVERY) {
+ std::string storage = pkg_query.StorageForPkgId();
+ if (storage.empty()) {
+ // Failed to query installation storage, assign internal
+ manifest->installed_storage = strdup(kInstalledInternally);
+ } else {
+ manifest->installed_storage = strdup(storage.c_str());
+ }
+ } else {
+ manifest->installed_storage = strdup(kInstalledInternally);
+ }
+ }
+
return true;
}