MCPcopy Create free account
hub / github.com/Kitware/CMake / PackageComponents

Method PackageComponents

Source/CPack/cmCPackRPMGenerator.cxx:125–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
126{
127 int retval = 1;
128 /* Reset package file name list it will be populated during the
129 * component packaging run*/
130 this->packageFileNames.clear();
131 std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
132
133 cmValue mainComponent = this->GetOption("CPACK_RPM_MAIN_COMPONENT");
134
135 if (this->IsOn("CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE") &&
136 !this->IsOn("CPACK_RPM_DEBUGINFO_PACKAGE")) {
137 // check if we need to set CPACK_RPM_DEBUGINFO_PACKAGE because non of
138 // the components is setting per component debuginfo package variable
139 bool shouldSet = true;
140
141 if (ignoreGroup) {
142 std::map<std::string, cmCPackComponent>::iterator compIt;
143 for (compIt = this->Components.begin(); compIt != this->Components.end();
144 ++compIt) {
145 std::string component(compIt->first);
146 std::transform(component.begin(), component.end(), component.begin(),
147 cmsysString_toupper);
148
149 if (this->IsOn("CPACK_RPM_" + compIt->first + "_DEBUGINFO_PACKAGE") ||
150 this->IsOn("CPACK_RPM_" + component + "_DEBUGINFO_PACKAGE")) {
151 shouldSet = false;
152 break;
153 }
154 }
155 } else {
156 std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
157 for (compGIt = this->ComponentGroups.begin();
158 compGIt != this->ComponentGroups.end(); ++compGIt) {
159 std::string component(compGIt->first);
160 std::transform(component.begin(), component.end(), component.begin(),
161 cmsysString_toupper);
162
163 if (this->IsOn("CPACK_RPM_" + compGIt->first + "_DEBUGINFO_PACKAGE") ||
164 this->IsOn("CPACK_RPM_" + component + "_DEBUGINFO_PACKAGE")) {
165 shouldSet = false;
166 break;
167 }
168 }
169
170 if (shouldSet) {
171 std::map<std::string, cmCPackComponent>::iterator compIt;
172 for (compIt = this->Components.begin();
173 compIt != this->Components.end(); ++compIt) {
174 // Does the component belong to a group?
175 if (!compIt->second.Group) {
176 std::string component(compIt->first);
177 std::transform(component.begin(), component.end(),
178 component.begin(), cmsysString_toupper);
179
180 if (this->IsOn("CPACK_RPM_" + compIt->first +
181 "_DEBUGINFO_PACKAGE") ||
182 this->IsOn("CPACK_RPM_" + component + "_DEBUGINFO_PACKAGE")) {

Callers 1

PackageFilesMethod · 0.95

Calls 10

PackageOnePackMethod · 0.95
transformFunction · 0.85
clearMethod · 0.45
GetOptionMethod · 0.45
IsOnMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
SetOptionMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected