aboutsummaryrefslogtreecommitdiff
path: root/bpkg/database.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-07-31 22:01:32 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-08-04 13:01:50 +0300
commitfbaa48b8ebf22d97bb224444603523ed03b98854 (patch)
tree9eb6447e31c29697b11910e704883bcdc649314e /bpkg/database.hxx
parent7a8652e41637085ddf090db27c193b02a99bc679 (diff)
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.
Diffstat (limited to 'bpkg/database.hxx')
-rw-r--r--bpkg/database.hxx11
1 files changed, 11 insertions, 0 deletions
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;
+ }
};
}