Skip to content

Commit

Permalink
Merge pull request #1937 from subutai-io/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Mike Savochkin authored Aug 17, 2020
2 parents 0d5cb17 + 0112562 commit a8fe3df
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change Log
## [7.3.10] 08/18/2020
# IMPROVEMENTS:
* Fixed check for a new version of vagrant package

## [7.3.9] 08/09/2020
# IMPROVEMENTS:
* New update mechanism for Control Center and it's components
Expand Down
3 changes: 3 additions & 0 deletions hub/include/RestWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,14 @@ private slots:
public:
void set_next_cc_version(const QString& version);
void set_next_p2p_version(const QString& version);
void set_next_vagrant_version(const QString& version);
const QString& get_next_cc_version() const;
const QString& get_next_p2p_version() const;
const QString& get_next_vagrant_version() const;
private:
QString next_cc_version;
QString next_p2p_version;
QString next_vagrant_version;
};

#endif // CRESTWORKER_H
6 changes: 6 additions & 0 deletions hub/src/DlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,12 @@ void DlgAbout::check_for_versions_and_updates() {
std::vector<CComponentMetaFile>::iterator p2p_it = p2p_meta.begin();
CRestWorker::Instance()->set_next_p2p_version(p2p_it->version());
}
std::vector<CComponentMetaFile> vagrant_meta = CRestWorker::Instance()->download_remote_file_meta(vagrant_kurjun_package_name());
if (!vagrant_meta.empty())
{
std::vector<CComponentMetaFile>::iterator vagrant_it = vagrant_meta.begin();
CRestWorker::Instance()->set_next_vagrant_version(vagrant_it->version());
}

int cur_components_count = DlgAboutInitializer::COMPONENTS_COUNT - 1; // -1 for CC version check
QString current_hypervisor = VagrantProvider::Instance()->CurrentVal();
Expand Down
10 changes: 10 additions & 0 deletions hub/src/RestWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,11 @@ void CRestWorker::set_next_p2p_version(const QString& version)
next_p2p_version = version;
}

void CRestWorker::set_next_vagrant_version(const QString& version)
{
next_vagrant_version = version;
}

const QString& CRestWorker::get_next_cc_version() const
{
return next_cc_version;
Expand All @@ -1164,4 +1169,9 @@ const QString& CRestWorker::get_next_p2p_version() const
return next_p2p_version;
}

const QString& CRestWorker::get_next_vagrant_version() const
{
return next_vagrant_version;
}

////////////////////////////////////////////////////////////////////////////
19 changes: 1 addition & 18 deletions hub/src/updater/UpdaterComponentP2P.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,11 @@ CUpdaterComponentP2P::download_p2p_path() {

bool
CUpdaterComponentP2P::update_available_internal() {

auto next_version = CRestWorker::Instance()->get_next_p2p_version();
if (next_version == UNKNOWN_VERSION) return false;
QString p2p_version = "";
QString p2p_version;
CSystemCallWrapper::p2p_version(p2p_version);
qDebug() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
qDebug() << "Current p2p version: " << p2p_version;
qDebug() << "Next p2p version: " << next_version;
return next_version != p2p_version;

std::vector<CGorjunFileInfo> fi =
CRestWorker::Instance()->get_gorjun_file_info(p2p_kurjun_file_name());
if (fi.empty()) return false;
QString str_p2p_path = p2p_path();
if (str_p2p_path == P2P) return false;
QString md5_current = CCommons::FileMd5(str_p2p_path);
QString md5_kurjun = fi[0].md5_sum();
qDebug()
<<"Checking for p2p update"
<<"md5_current: "<<md5_current
<<"md5_kurjun: "<<md5_kurjun;
return md5_current != md5_kurjun;
}
////////////////////////////////////////////////////////////////////////////

Expand Down
4 changes: 3 additions & 1 deletion hub/src/updater/UpdaterComponentVagrant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ QString CUpdaterComponentVAGRANT::download_vagrant_path() {
}

bool CUpdaterComponentVAGRANT::update_available_internal() {
auto next_version = CRestWorker::Instance()->get_next_vagrant_version();
if (next_version == UNKNOWN_VERSION) return false;
QString version;
CSystemCallWrapper::vagrant_version(version);
return version == "undefined";
return version != next_version;
}

chue_t CUpdaterComponentVAGRANT::install_internal() {
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.9
7.3.10

0 comments on commit a8fe3df

Please sign in to comment.