namespace common_installer {
bool AppQueryInterface::IsPkgInstalled(const std::string& arg,
- uid_t uid) const {
- // argument from commandline is package id
- PkgQueryInterface pkg_query(arg, uid);
- if (pkg_query.IsPackageInstalled(GetRequestMode(uid)))
- return true;
-
+ uid_t uid) const {
// argument from commandline is path to file
std::string pkg_id = GetPkgIdFromPath(arg);
if (pkg_id.empty())
- return false;
- PkgQueryInterface pkg_query2(pkg_id, uid);
- return pkg_query2.IsPackageInstalled(GetRequestMode(uid));
+ pkg_id = arg;
+ PkgQueryInterface pkg_query(pkg_id, uid);
+ return pkg_query.IsPackageInstalled(GetRequestMode(uid));
}
std::string AppQueryInterface::GetPkgId(const std::string& arg) const {