aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-09-19 12:09:56 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-09-19 12:09:56 +0300
commit6737797c36ad1657f32bd074c38f7948858051cc (patch)
tree8fee822fa904403d68e42f0d7c3f998066c10810
parentfbaa48b8ebf22d97bb224444603523ed03b98854 (diff)
Fix system_package_manager_fedora::generate() not to return debuginfo package if not generated
-rw-r--r--bpkg/system-package-manager-fedora.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/bpkg/system-package-manager-fedora.cxx b/bpkg/system-package-manager-fedora.cxx
index 920770e..8ea6779 100644
--- a/bpkg/system-package-manager-fedora.cxx
+++ b/bpkg/system-package-manager-fedora.cxx
@@ -4411,7 +4411,9 @@ namespace bpkg
const string& package_arch (!build_arch.empty () ? build_arch : arch);
- auto add_package = [&r, &expressions, &rpmfile, &add_macro]
+ vector<binary_file> files;
+
+ auto add_package = [&files, &expressions, &rpmfile, &add_macro]
(const string& name,
const string& arch,
const char* type) -> size_t
@@ -4419,8 +4421,11 @@ namespace bpkg
add_macro ("NAME", name);
add_macro ("ARCH", arch);
expressions += rpmfile + '\n';
- r.push_back (binary_file {type, path (), name}); // Reserve.
- return r.size () - 1;
+
+ // Note: path is unknown yet.
+ //
+ files.push_back (binary_file {type, path (), name});
+ return files.size () - 1;
};
if (gen_main)
@@ -4449,11 +4454,11 @@ namespace bpkg
strings expansions (eval (cstrings ({expressions.c_str ()})));
- if (expansions.size () != r.size ())
+ if (expansions.size () != files.size ())
fail << "number of RPM file path expansions differs from number "
<< "of path expressions";
- for (size_t i (0); i != r.size(); ++i)
+ for (size_t i (0); i != files.size(); ++i)
{
try
{
@@ -4467,7 +4472,12 @@ namespace bpkg
// etc).
//
if (exists (p))
- r[i].path = move (p);
+ {
+ binary_file& f (files[i]);
+
+ r.push_back (
+ binary_file {move (f.type), move (p), move (f.system_name)});
+ }
else if (!di || i != *di) // Not a -debuginfo sub-package?
fail << "expected output file " << p << " does not exist";
}