cmCPackIFWGenerator.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmCPackIFWGenerator.h"
  4. #include "cmCPackComponentGroup.h"
  5. #include "cmCPackGenerator.h"
  6. #include "cmCPackIFWCommon.h"
  7. #include "cmCPackIFWInstaller.h"
  8. #include "cmCPackIFWPackage.h"
  9. #include "cmCPackIFWRepository.h"
  10. #include "cmCPackLog.h" // IWYU pragma: keep
  11. #include "cmDuration.h"
  12. #include "cmGeneratedFileStream.h"
  13. #include "cmSystemTools.h"
  14. #include <sstream>
  15. #include <utility>
  16. cmCPackIFWGenerator::cmCPackIFWGenerator()
  17. {
  18. this->Generator = this;
  19. }
  20. cmCPackIFWGenerator::~cmCPackIFWGenerator() = default;
  21. int cmCPackIFWGenerator::PackageFiles()
  22. {
  23. cmCPackIFWLogger(OUTPUT, "- Configuration" << std::endl);
  24. // Installer configuragion
  25. this->Installer.GenerateInstallerFile();
  26. // Packages configuration
  27. this->Installer.GeneratePackageFiles();
  28. std::string ifwTLD = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
  29. std::string ifwTmpFile = ifwTLD;
  30. ifwTmpFile += "/IFWOutput.log";
  31. // Run repogen
  32. if (!this->Installer.RemoteRepositories.empty()) {
  33. std::string ifwCmd = this->RepoGen;
  34. if (this->IsVersionLess("2.0.0")) {
  35. ifwCmd += " -c " + this->toplevel + "/config/config.xml";
  36. }
  37. ifwCmd += " -p " + this->toplevel + "/packages";
  38. if (!this->PkgsDirsVector.empty()) {
  39. for (std::string const& it : this->PkgsDirsVector) {
  40. ifwCmd += " -p " + it;
  41. }
  42. }
  43. if (!this->RepoDirsVector.empty()) {
  44. if (!this->IsVersionLess("3.1")) {
  45. for (std::string const& rd : this->RepoDirsVector) {
  46. ifwCmd += " --repository " + rd;
  47. }
  48. } else {
  49. cmCPackIFWLogger(WARNING,
  50. "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
  51. << "variable is set, but content will be skipped, "
  52. << "because this feature available only since "
  53. << "QtIFW 3.1. Please update your QtIFW instance."
  54. << std::endl);
  55. }
  56. }
  57. if (!this->OnlineOnly && !this->DownloadedPackages.empty()) {
  58. ifwCmd += " -i ";
  59. std::set<cmCPackIFWPackage*>::iterator it =
  60. this->DownloadedPackages.begin();
  61. ifwCmd += (*it)->Name;
  62. ++it;
  63. while (it != this->DownloadedPackages.end()) {
  64. ifwCmd += "," + (*it)->Name;
  65. ++it;
  66. }
  67. }
  68. ifwCmd += " " + this->toplevel + "/repository";
  69. cmCPackIFWLogger(VERBOSE, "Execute: " << ifwCmd << std::endl);
  70. std::string output;
  71. int retVal = 1;
  72. cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl);
  73. bool res = cmSystemTools::RunSingleCommand(
  74. ifwCmd.c_str(), &output, &output, &retVal, nullptr,
  75. this->GeneratorVerbose, cmDuration::zero());
  76. if (!res || retVal) {
  77. cmGeneratedFileStream ofs(ifwTmpFile);
  78. ofs << "# Run command: " << ifwCmd << std::endl
  79. << "# Output:" << std::endl
  80. << output << std::endl;
  81. cmCPackIFWLogger(ERROR,
  82. "Problem running IFW command: "
  83. << ifwCmd << std::endl
  84. << "Please check " << ifwTmpFile << " for errors"
  85. << std::endl);
  86. return 0;
  87. }
  88. if (!this->Repository.RepositoryUpdate.empty() &&
  89. !this->Repository.PatchUpdatesXml()) {
  90. cmCPackIFWLogger(WARNING,
  91. "Problem patch IFW \"Updates\" "
  92. << "file: "
  93. << this->toplevel + "/repository/Updates.xml"
  94. << std::endl);
  95. }
  96. cmCPackIFWLogger(OUTPUT,
  97. "- repository: " << this->toplevel
  98. << "/repository generated" << std::endl);
  99. }
  100. // Run binary creator
  101. {
  102. std::string ifwCmd = this->BinCreator;
  103. ifwCmd += " -c " + this->toplevel + "/config/config.xml";
  104. if (!this->Installer.Resources.empty()) {
  105. ifwCmd += " -r ";
  106. std::vector<std::string>::iterator it =
  107. this->Installer.Resources.begin();
  108. std::string path = this->toplevel + "/resources/";
  109. ifwCmd += path + *it;
  110. ++it;
  111. while (it != this->Installer.Resources.end()) {
  112. ifwCmd += "," + path + *it;
  113. ++it;
  114. }
  115. }
  116. ifwCmd += " -p " + this->toplevel + "/packages";
  117. if (!this->PkgsDirsVector.empty()) {
  118. for (std::string const& it : this->PkgsDirsVector) {
  119. ifwCmd += " -p " + it;
  120. }
  121. }
  122. if (!this->RepoDirsVector.empty()) {
  123. if (!this->IsVersionLess("3.1")) {
  124. for (std::string const& rd : this->RepoDirsVector) {
  125. ifwCmd += " --repository " + rd;
  126. }
  127. } else {
  128. cmCPackIFWLogger(WARNING,
  129. "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
  130. << "variable is set, but content will be skipped, "
  131. << "because this feature available only since "
  132. << "QtIFW 3.1. Please update your QtIFW instance."
  133. << std::endl);
  134. }
  135. }
  136. if (this->OnlineOnly) {
  137. ifwCmd += " --online-only";
  138. } else if (!this->DownloadedPackages.empty() &&
  139. !this->Installer.RemoteRepositories.empty()) {
  140. ifwCmd += " -e ";
  141. std::set<cmCPackIFWPackage*>::iterator it =
  142. this->DownloadedPackages.begin();
  143. ifwCmd += (*it)->Name;
  144. ++it;
  145. while (it != this->DownloadedPackages.end()) {
  146. ifwCmd += "," + (*it)->Name;
  147. ++it;
  148. }
  149. } else if (!this->DependentPackages.empty()) {
  150. ifwCmd += " -i ";
  151. // Binary
  152. std::set<cmCPackIFWPackage*>::iterator bit =
  153. this->BinaryPackages.begin();
  154. while (bit != this->BinaryPackages.end()) {
  155. ifwCmd += (*bit)->Name + ",";
  156. ++bit;
  157. }
  158. // Depend
  159. DependenceMap::iterator it = this->DependentPackages.begin();
  160. ifwCmd += it->second.Name;
  161. ++it;
  162. while (it != this->DependentPackages.end()) {
  163. ifwCmd += "," + it->second.Name;
  164. ++it;
  165. }
  166. }
  167. // TODO: set correct name for multipackages
  168. if (!this->packageFileNames.empty()) {
  169. ifwCmd += " " + this->packageFileNames[0];
  170. } else {
  171. ifwCmd += " installer";
  172. ifwCmd += this->OutputExtension;
  173. }
  174. cmCPackIFWLogger(VERBOSE, "Execute: " << ifwCmd << std::endl);
  175. std::string output;
  176. int retVal = 1;
  177. cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl);
  178. bool res = cmSystemTools::RunSingleCommand(
  179. ifwCmd.c_str(), &output, &output, &retVal, nullptr,
  180. this->GeneratorVerbose, cmDuration::zero());
  181. if (!res || retVal) {
  182. cmGeneratedFileStream ofs(ifwTmpFile);
  183. ofs << "# Run command: " << ifwCmd << std::endl
  184. << "# Output:" << std::endl
  185. << output << std::endl;
  186. cmCPackIFWLogger(ERROR,
  187. "Problem running IFW command: "
  188. << ifwCmd << std::endl
  189. << "Please check " << ifwTmpFile << " for errors"
  190. << std::endl);
  191. return 0;
  192. }
  193. }
  194. return 1;
  195. }
  196. const char* cmCPackIFWGenerator::GetPackagingInstallPrefix()
  197. {
  198. const char* defPrefix = this->cmCPackGenerator::GetPackagingInstallPrefix();
  199. std::string tmpPref = defPrefix ? defPrefix : "";
  200. if (this->Components.empty()) {
  201. tmpPref += "packages/" + this->GetRootPackageName() + "/data";
  202. }
  203. this->SetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX", tmpPref.c_str());
  204. return this->GetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX");
  205. }
  206. const char* cmCPackIFWGenerator::GetOutputExtension()
  207. {
  208. return this->OutputExtension.c_str();
  209. }
  210. int cmCPackIFWGenerator::InitializeInternal()
  211. {
  212. // Search Qt Installer Framework tools
  213. const std::string BinCreatorOpt = "CPACK_IFW_BINARYCREATOR_EXECUTABLE";
  214. const std::string RepoGenOpt = "CPACK_IFW_REPOGEN_EXECUTABLE";
  215. const std::string FrameworkVersionOpt = "CPACK_IFW_FRAMEWORK_VERSION";
  216. if (!this->IsSet(BinCreatorOpt) || !this->IsSet(RepoGenOpt) ||
  217. !this->IsSet(FrameworkVersionOpt)) {
  218. this->ReadListFile("CPackIFW.cmake");
  219. }
  220. // Look 'binarycreator' executable (needs)
  221. const char* BinCreatorStr = this->GetOption(BinCreatorOpt);
  222. if (!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) {
  223. this->BinCreator.clear();
  224. } else {
  225. this->BinCreator = BinCreatorStr;
  226. }
  227. if (this->BinCreator.empty()) {
  228. cmCPackIFWLogger(ERROR,
  229. "Cannot find QtIFW compiler \"binarycreator\": "
  230. "likely it is not installed, or not in your PATH"
  231. << std::endl);
  232. return 0;
  233. }
  234. // Look 'repogen' executable (optional)
  235. const char* RepoGenStr = this->GetOption(RepoGenOpt);
  236. if (!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) {
  237. this->RepoGen.clear();
  238. } else {
  239. this->RepoGen = RepoGenStr;
  240. }
  241. // Framework version
  242. if (const char* FrameworkVersionSrt = this->GetOption(FrameworkVersionOpt)) {
  243. this->FrameworkVersion = FrameworkVersionSrt;
  244. } else {
  245. this->FrameworkVersion = "1.9.9";
  246. }
  247. // Variables that Change Behavior
  248. // Resolve duplicate names
  249. this->ResolveDuplicateNames =
  250. this->IsOn("CPACK_IFW_RESOLVE_DUPLICATE_NAMES");
  251. // Additional packages dirs
  252. this->PkgsDirsVector.clear();
  253. if (const char* dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) {
  254. cmSystemTools::ExpandListArgument(dirs, this->PkgsDirsVector);
  255. }
  256. // Additional repositories dirs
  257. this->RepoDirsVector.clear();
  258. if (const char* dirs =
  259. this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
  260. cmSystemTools::ExpandListArgument(dirs, this->RepoDirsVector);
  261. }
  262. // Installer
  263. this->Installer.Generator = this;
  264. this->Installer.ConfigureFromOptions();
  265. // Repository
  266. this->Repository.Generator = this;
  267. this->Repository.Name = "Unspecified";
  268. if (const char* site = this->GetOption("CPACK_DOWNLOAD_SITE")) {
  269. this->Repository.Url = site;
  270. this->Installer.RemoteRepositories.push_back(&this->Repository);
  271. }
  272. // Repositories
  273. if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
  274. std::vector<std::string> RepoAllVector;
  275. cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector);
  276. for (std::string const& r : RepoAllVector) {
  277. this->GetRepository(r);
  278. }
  279. }
  280. if (const char* ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
  281. this->OnlineOnly = cmSystemTools::IsOn(ifwDownloadAll);
  282. } else if (const char* cpackDownloadAll =
  283. this->GetOption("CPACK_DOWNLOAD_ALL")) {
  284. this->OnlineOnly = cmSystemTools::IsOn(cpackDownloadAll);
  285. } else {
  286. this->OnlineOnly = false;
  287. }
  288. if (!this->Installer.RemoteRepositories.empty() && this->RepoGen.empty()) {
  289. cmCPackIFWLogger(ERROR,
  290. "Cannot find QtIFW repository generator \"repogen\": "
  291. "likely it is not installed, or not in your PATH"
  292. << std::endl);
  293. return 0;
  294. }
  295. // Executable suffix
  296. std::string exeSuffix(this->GetOption("CMAKE_EXECUTABLE_SUFFIX"));
  297. std::string sysName(this->GetOption("CMAKE_SYSTEM_NAME"));
  298. if (sysName == "Linux") {
  299. this->ExecutableSuffix = ".run";
  300. } else if (sysName == "Windows") {
  301. this->ExecutableSuffix = ".exe";
  302. } else if (sysName == "Darwin") {
  303. this->ExecutableSuffix = ".app";
  304. } else {
  305. this->ExecutableSuffix = exeSuffix;
  306. }
  307. // Output extension
  308. if (const char* optOutExt =
  309. this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
  310. this->OutputExtension = optOutExt;
  311. } else if (sysName == "Darwin") {
  312. this->OutputExtension = ".dmg";
  313. } else {
  314. this->OutputExtension = this->ExecutableSuffix;
  315. }
  316. if (this->OutputExtension.empty()) {
  317. this->OutputExtension = this->cmCPackGenerator::GetOutputExtension();
  318. }
  319. return this->Superclass::InitializeInternal();
  320. }
  321. std::string cmCPackIFWGenerator::GetComponentInstallDirNameSuffix(
  322. const std::string& componentName)
  323. {
  324. const std::string prefix = "packages/";
  325. const std::string suffix = "/data";
  326. if (this->componentPackageMethod == this->ONE_PACKAGE) {
  327. return std::string(prefix + this->GetRootPackageName() + suffix);
  328. }
  329. return prefix +
  330. this->GetComponentPackageName(&this->Components[componentName]) + suffix;
  331. }
  332. cmCPackComponent* cmCPackIFWGenerator::GetComponent(
  333. const std::string& projectName, const std::string& componentName)
  334. {
  335. ComponentsMap::iterator cit = this->Components.find(componentName);
  336. if (cit != this->Components.end()) {
  337. return &(cit->second);
  338. }
  339. cmCPackComponent* component =
  340. this->cmCPackGenerator::GetComponent(projectName, componentName);
  341. if (!component) {
  342. return component;
  343. }
  344. std::string name = this->GetComponentPackageName(component);
  345. PackagesMap::iterator pit = this->Packages.find(name);
  346. if (pit != this->Packages.end()) {
  347. return component;
  348. }
  349. cmCPackIFWPackage* package = &this->Packages[name];
  350. package->Name = name;
  351. package->Generator = this;
  352. if (package->ConfigureFromComponent(component)) {
  353. package->Installer = &this->Installer;
  354. this->Installer.Packages.insert(
  355. std::pair<std::string, cmCPackIFWPackage*>(name, package));
  356. this->ComponentPackages.insert(
  357. std::pair<cmCPackComponent*, cmCPackIFWPackage*>(component, package));
  358. if (component->IsDownloaded) {
  359. this->DownloadedPackages.insert(package);
  360. } else {
  361. this->BinaryPackages.insert(package);
  362. }
  363. } else {
  364. this->Packages.erase(name);
  365. cmCPackIFWLogger(ERROR,
  366. "Cannot configure package \""
  367. << name << "\" for component \"" << component->Name
  368. << "\"" << std::endl);
  369. }
  370. return component;
  371. }
  372. cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup(
  373. const std::string& projectName, const std::string& groupName)
  374. {
  375. cmCPackComponentGroup* group =
  376. this->cmCPackGenerator::GetComponentGroup(projectName, groupName);
  377. if (!group) {
  378. return group;
  379. }
  380. std::string name = this->GetGroupPackageName(group);
  381. PackagesMap::iterator pit = this->Packages.find(name);
  382. if (pit != this->Packages.end()) {
  383. return group;
  384. }
  385. cmCPackIFWPackage* package = &this->Packages[name];
  386. package->Name = name;
  387. package->Generator = this;
  388. if (package->ConfigureFromGroup(group)) {
  389. package->Installer = &this->Installer;
  390. this->Installer.Packages.insert(
  391. std::pair<std::string, cmCPackIFWPackage*>(name, package));
  392. this->GroupPackages.insert(
  393. std::pair<cmCPackComponentGroup*, cmCPackIFWPackage*>(group, package));
  394. this->BinaryPackages.insert(package);
  395. } else {
  396. this->Packages.erase(name);
  397. cmCPackIFWLogger(ERROR,
  398. "Cannot configure package \""
  399. << name << "\" for component group \"" << group->Name
  400. << "\"" << std::endl);
  401. }
  402. return group;
  403. }
  404. enum cmCPackGenerator::CPackSetDestdirSupport
  405. cmCPackIFWGenerator::SupportsSetDestdir() const
  406. {
  407. return cmCPackGenerator::SETDESTDIR_SHOULD_NOT_BE_USED;
  408. }
  409. bool cmCPackIFWGenerator::SupportsAbsoluteDestination() const
  410. {
  411. return false;
  412. }
  413. bool cmCPackIFWGenerator::SupportsComponentInstallation() const
  414. {
  415. return true;
  416. }
  417. bool cmCPackIFWGenerator::IsOnePackage() const
  418. {
  419. return this->componentPackageMethod == cmCPackGenerator::ONE_PACKAGE;
  420. }
  421. std::string cmCPackIFWGenerator::GetRootPackageName()
  422. {
  423. // Default value
  424. std::string name = "root";
  425. if (const char* optIFW_PACKAGE_GROUP =
  426. this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
  427. // Configure from root group
  428. cmCPackIFWPackage package;
  429. package.Generator = this;
  430. package.ConfigureFromGroup(optIFW_PACKAGE_GROUP);
  431. name = package.Name;
  432. } else if (const char* optIFW_PACKAGE_NAME =
  433. this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
  434. // Configure from root package name
  435. name = optIFW_PACKAGE_NAME;
  436. } else if (const char* optPACKAGE_NAME =
  437. this->GetOption("CPACK_PACKAGE_NAME")) {
  438. // Configure from package name
  439. name = optPACKAGE_NAME;
  440. }
  441. return name;
  442. }
  443. std::string cmCPackIFWGenerator::GetGroupPackageName(
  444. cmCPackComponentGroup* group) const
  445. {
  446. std::string name;
  447. if (!group) {
  448. return name;
  449. }
  450. if (cmCPackIFWPackage* package = this->GetGroupPackage(group)) {
  451. return package->Name;
  452. }
  453. const char* option =
  454. this->GetOption("CPACK_IFW_COMPONENT_GROUP_" +
  455. cmsys::SystemTools::UpperCase(group->Name) + "_NAME");
  456. name = option ? option : group->Name;
  457. if (group->ParentGroup) {
  458. cmCPackIFWPackage* package = this->GetGroupPackage(group->ParentGroup);
  459. bool dot = !this->ResolveDuplicateNames;
  460. if (dot && name.substr(0, package->Name.size()) == package->Name) {
  461. dot = false;
  462. }
  463. if (dot) {
  464. name = package->Name + "." + name;
  465. }
  466. }
  467. return name;
  468. }
  469. std::string cmCPackIFWGenerator::GetComponentPackageName(
  470. cmCPackComponent* component) const
  471. {
  472. std::string name;
  473. if (!component) {
  474. return name;
  475. }
  476. if (cmCPackIFWPackage* package = this->GetComponentPackage(component)) {
  477. return package->Name;
  478. }
  479. std::string prefix = "CPACK_IFW_COMPONENT_" +
  480. cmsys::SystemTools::UpperCase(component->Name) + "_";
  481. const char* option = this->GetOption(prefix + "NAME");
  482. name = option ? option : component->Name;
  483. if (component->Group) {
  484. cmCPackIFWPackage* package = this->GetGroupPackage(component->Group);
  485. if ((this->componentPackageMethod ==
  486. cmCPackGenerator::ONE_PACKAGE_PER_GROUP) ||
  487. this->IsOn(prefix + "COMMON")) {
  488. return package->Name;
  489. }
  490. bool dot = !this->ResolveDuplicateNames;
  491. if (dot && name.substr(0, package->Name.size()) == package->Name) {
  492. dot = false;
  493. }
  494. if (dot) {
  495. name = package->Name + "." + name;
  496. }
  497. }
  498. return name;
  499. }
  500. cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage(
  501. cmCPackComponentGroup* group) const
  502. {
  503. std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit =
  504. this->GroupPackages.find(group);
  505. return pit != this->GroupPackages.end() ? pit->second : nullptr;
  506. }
  507. cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
  508. cmCPackComponent* component) const
  509. {
  510. std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit =
  511. this->ComponentPackages.find(component);
  512. return pit != this->ComponentPackages.end() ? pit->second : nullptr;
  513. }
  514. cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
  515. const std::string& repositoryName)
  516. {
  517. RepositoriesMap::iterator rit = this->Repositories.find(repositoryName);
  518. if (rit != this->Repositories.end()) {
  519. return &(rit->second);
  520. }
  521. cmCPackIFWRepository* repository = &this->Repositories[repositoryName];
  522. repository->Name = repositoryName;
  523. repository->Generator = this;
  524. if (repository->ConfigureFromOptions()) {
  525. if (repository->Update == cmCPackIFWRepository::None) {
  526. this->Installer.RemoteRepositories.push_back(repository);
  527. } else {
  528. this->Repository.RepositoryUpdate.push_back(repository);
  529. }
  530. } else {
  531. this->Repositories.erase(repositoryName);
  532. repository = nullptr;
  533. cmCPackIFWLogger(WARNING,
  534. "Invalid repository \""
  535. << repositoryName << "\""
  536. << " configuration. Repository will be skipped."
  537. << std::endl);
  538. }
  539. return repository;
  540. }