aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/package.hxx')
-rw-r--r--bpkg/package.hxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/bpkg/package.hxx b/bpkg/package.hxx
index 7dc8e11..d31e806 100644
--- a/bpkg/package.hxx
+++ b/bpkg/package.hxx
@@ -1503,8 +1503,8 @@ namespace bpkg
//
struct config_package
{
- database& db;
- package_name name;
+ reference_wrapper<database> db;
+ package_name name;
config_package (database& d, package_name n): db (d), name (move (n)) {}
@@ -1519,16 +1519,26 @@ namespace bpkg
{
// See operator==(database, database).
//
- return name == v.name && &db == &v.db;
+ return name == v.name && &db.get () == &v.db.get ();
}
bool
operator< (const config_package&) const;
+ // Return the package string representation in the form:
+ //
+ // <name>[ <config-dir>]
+ //
std::string
string () const;
};
+ inline ostream&
+ operator<< (ostream& os, const config_package& p)
+ {
+ return os << p.string ();
+ }
+
// Return a count of repositories that contain this repository fragment.
//
#pragma db view table("main.repository_fragments")