PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock)
PKG_CHECK_MODULES(GIO_DEPS REQUIRED gio-2.0)
PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
+PKG_CHECK_MODULES(RPK_INSTALLER_DEPS REQUIRED rpk-installer)
FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options)
BuildRequires: pkgconfig(gmock)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(rpk-installer)
%if 0%{?gcov:1}
BuildRequires: lcov
%files gcov
%defattr(-,root,root,-)
%{_datadir}/gcov/*
-%endif
\ No newline at end of file
+%endif
#include <hybrid/hybrid_installer.h>
#include <tpk/tpk_app_query_interface.h>
#include <tpk/tpk_installer.h>
+#include <rpk/rpk_installer.h>
+#include <rpk/rpk_app_query_interface.h>
#include <wgt/utils/wgt_app_query_interface.h>
#include <wgt/wgt_installer.h>
};
std::string ValidatePkgType(const std::string& type) {
- if (type == "tpk" || type == "wgt")
+ if (type == "tpk" || type == "wgt" || type == "rpk")
return type;
else if (type == "rpm")
return "tpk";
std::string GetPkgTypeFromPath(const std::string& path) {
std::string type;
+
+ if (boost::filesystem::extension(path) == ".rpk")
+ return "rpk";
+
unzFile uf = unzOpen(path.c_str());
if (!uf) {
LOG(ERROR) << "Failed to open zip file: " << path;
new tpk::TpkAppQueryInterface());
pkgmgr->AddAppQueryInterface(idx, tpk_aqi);
installer.reset(new tpk::TpkInstaller(pkgmgr));
- } else {
+ } else if (type == "wgt") {
// should be fixed
std::shared_ptr<wgt::WgtAppQueryInterface> wgt_aqi(
new wgt::WgtAppQueryInterface());
} else {
installer.reset(new wgt::WgtInstaller(pkgmgr));
}
+ } else {
+ std::shared_ptr<rpk::RpkAppQueryInterface> rpk_aqi(
+ new rpk::RpkAppQueryInterface());
+ pkgmgr->AddAppQueryInterface(idx, rpk_aqi);
+ installer.reset(new rpk::RpkInstaller(pkgmgr));
}
installer->SetIndex(idx);