aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-build-collect.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-01-20 13:50:18 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-01-20 13:50:18 +0300
commit566916d41bbb1c0f57b9f708b37759129bc3fbc4 (patch)
treeada9a47169d7db9de048d3d16e4ea72f83a0930a /bpkg/pkg-build-collect.cxx
parent2f4f82143438536120eac9320a42872e787c8ac4 (diff)
Install binary distribution packages
Diffstat (limited to 'bpkg/pkg-build-collect.cxx')
-rw-r--r--bpkg/pkg-build-collect.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/bpkg/pkg-build-collect.cxx b/bpkg/pkg-build-collect.cxx
index 12db3ba..11d1848 100644
--- a/bpkg/pkg-build-collect.cxx
+++ b/bpkg/pkg-build-collect.cxx
@@ -29,6 +29,31 @@ namespace bpkg
{
// build_package
//
+ const system_package_status* build_package::
+ system_install () const
+ {
+ assert (action);
+
+ if (*action != build_package::drop && system)
+ {
+ const optional<system_repository>& sys_rep (db.get ().system_repository);
+ assert (sys_rep);
+
+ if (const system_package* sys_pkg = sys_rep->find (name ()))
+ {
+ const system_package_status* s (sys_pkg->system_status);
+
+ return s != nullptr &&
+ (s->status == system_package_status::partially_installed ||
+ s->status == system_package_status::not_installed)
+ ? s
+ : nullptr;
+ }
+ }
+
+ return nullptr;
+ }
+
bool build_package::
user_selection () const
{