Skip to content

Commit 2fd3f08

Browse files
committed
sgug_world_builder: warn about all missing SRPM files at once, rather than one by one
1 parent c92fa44 commit 2fd3f08

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AC_PREREQ(2.65)
22
AC_INIT([sgug-rpm-tools],
3-
[0.1.4],
3+
[0.1.5],
44
55

66
AC_SUBST(ACLOCAL_AMFLAGS, "-I macros")

src/sgug-rpm-tools/sgug_world_builder.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,26 @@ int main(int argc, char**argv)
260260
cout << "# Checking availability of SRPMs for packages..." << endl;
261261
unordered_map<string,string> package_to_srpm_map;
262262

263+
vector<string> missing_srpms;
264+
263265
for( const sgug_rpm::specfile & specfile : valid_specfiles ) {
264266
const string & srpm_name = specfile.get_name();
265267
cout << "# Looking for srpm " << srpm_name << endl;
266268
optional<string> found_srpm_opt =
267269
find_srpm_for_package( verbose, inputsrpm_p, srpm_name );
268270
if( !found_srpm_opt ) {
269-
cerr << "Unable to find SRPM for " << srpm_name << endl;
270-
exit(EXIT_FAILURE);
271+
missing_srpms.push_back( srpm_name );
272+
}
273+
else {
274+
package_to_srpm_map[srpm_name] = *found_srpm_opt;
271275
}
272-
package_to_srpm_map[srpm_name] = *found_srpm_opt;
276+
}
277+
278+
if( missing_srpms.size() > 0 ) {
279+
for( const string & missing_srpm : missing_srpms ) {
280+
cerr << "Unable to find SRPM for " << missing_srpm << endl;
281+
}
282+
exit(EXIT_FAILURE);
273283
}
274284

275285
cout << "# Writing worldrebuilder.sh..." << endl;

0 commit comments

Comments
 (0)