From fbaa48b8ebf22d97bb224444603523ed03b98854 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 31 Jul 2023 22:01:32 +0300 Subject: Add support for specifying package archive and directory as a dependency for pkg-build Also make sure that a package specified as an archive or directory always replaces selected package. Also add support for deorphaning and upgrading of such a package. --- bpkg/database.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bpkg/database.hxx') diff --git a/bpkg/database.hxx b/bpkg/database.hxx index 7ef2d40..684dc9d 100644 --- a/bpkg/database.hxx +++ b/bpkg/database.hxx @@ -754,6 +754,17 @@ namespace bpkg return make_pair (base_type::emplace (end (), db, move (v)), true); } + + V& + operator[] (database& db) + { + iterator i (find (db)); + + if (i == end ()) + i = base_type::emplace (end (), db, V ()); + + return i->second; + } }; } -- cgit v1.1