diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2016-05-17 14:00:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-18 13:49:14 (GMT) |
commit | 41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee (patch) | |
tree | 07b7d562e9896dc36de8a79dffb5a80290b560ab /Source/CPack/IFW/cmCPackIFWInstaller.cxx | |
parent | 6ca6b0dd7b1f4bb7429cbe039101558c58f3ea27 (diff) | |
download | CMake-41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee.zip CMake-41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee.tar.gz CMake-41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee.tar.bz2 |
CPackIFW: Add support for Promoting Updates
Add support for this feature added by QtIFW 2.0.3:
http://doc.qt.io/qtinstallerframework/ifw-updates.html
Add a `cpack_ifw_update_repository` command as porcelain.
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWInstaller.cxx')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 78 |
1 files changed, 4 insertions, 74 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index b9a9861..dfc509b 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -159,57 +159,6 @@ void cmCPackIFWInstaller::ConfigureFromOptions() AdminTargetDir = option; } - // Repositories - Repositories.clear(); - RepositoryStruct Repo; - if (const char* site = this->GetOption("CPACK_DOWNLOAD_SITE")) { - Repo.Url = site; - Repositories.push_back(Repo); - } - if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) { - std::vector<std::string> RepoAllVector; - cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector); - for (std::vector<std::string>::iterator rit = RepoAllVector.begin(); - rit != RepoAllVector.end(); ++rit) { - std::string prefix = - "CPACK_IFW_REPOSITORY_" + cmsys::SystemTools::UpperCase(*rit) + "_"; - // Url - if (const char* url = GetOption(prefix + "URL")) { - Repo.Url = url; - } else { - Repo.Url = ""; - } - // Enabled - if (IsOn(prefix + "DISABLED")) { - Repo.Enabled = "0"; - } else { - Repo.Enabled = ""; - } - // Username - if (const char* username = GetOption(prefix + "USERNAME")) { - Repo.Username = username; - } else { - Repo.Username = ""; - } - // Password - if (const char* password = GetOption(prefix + "PASSWORD")) { - Repo.Password = password; - } else { - Repo.Password = ""; - } - // DisplayName - if (const char* displayName = GetOption(prefix + "DISPLAY_NAME")) { - Repo.DisplayName = displayName; - } else { - Repo.DisplayName = ""; - } - - if (!Repo.Url.empty()) { - Repositories.push_back(Repo); - } - } - } - // Maintenance tool if (const char* optIFW_MAINTENANCE_TOOL = this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME")) { @@ -320,30 +269,11 @@ void cmCPackIFWInstaller::GenerateInstallerFile() } // Remote repositories - if (!Repositories.empty()) { + if (!RemoteRepositories.empty()) { xout.StartElement("RemoteRepositories"); - for (std::vector<RepositoryStruct>::iterator rit = Repositories.begin(); - rit != Repositories.end(); ++rit) { - xout.StartElement("Repository"); - // Url - xout.Element("Url", rit->Url); - // Enabled - if (!rit->Enabled.empty()) { - xout.Element("Enabled", rit->Enabled); - } - // Username - if (!rit->Username.empty()) { - xout.Element("Username", rit->Username); - } - // Password - if (!rit->Password.empty()) { - xout.Element("Password", rit->Password); - } - // DisplayName - if (!rit->DisplayName.empty()) { - xout.Element("DisplayName", rit->DisplayName); - } - xout.EndElement(); + for (RepositoriesVector::iterator rit = RemoteRepositories.begin(); + rit != RemoteRepositories.end(); ++rit) { + (*rit)->WriteRepositoryConfig(xout); } xout.EndElement(); } |