aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-01 09:13:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-01 09:13:37 +0200
commit098460199c35218979e207a1709111e477ab9567 (patch)
tree55765e91a517759bf28672abeda96102f2f511c4 /bpkg/package
parent42bbdd0e7f0d78b622697bf4d4543c1aead22ae8 (diff)
build command genesis, some re-factoring
Diffstat (limited to 'bpkg/package')
-rw-r--r--bpkg/package16
1 files changed, 13 insertions, 3 deletions
diff --git a/bpkg/package b/bpkg/package
index 9b616f6..5967448 100644
--- a/bpkg/package
+++ b/bpkg/package
@@ -222,11 +222,11 @@ namespace bpkg
// List of repositories to which this package version belongs (yes,
// in our world, it can be in multiple, unrelated repositories).
//
- std::vector<package_location> locations;
+ std::vector<package_location> locations; //@@ Map?
public:
- available_package (string name, bpkg::version v)
- : id (move (name), v), version (move (v)) {}
+ available_package (package_manifest&& m)
+ : id (move (m.name), m.version), version (move (m.version)) {}
// Database mapping.
//
@@ -251,6 +251,16 @@ namespace bpkg
operator size_t () const {return result;}
};
+ // Only return packages that are in the specified repository or its
+ // complements, recursively. While you could maybe come up with a
+ // (barely comprehensible) view/query to achieve this, doing it on
+ // the "client side" is definitely more straightforward.
+ //
+ std::vector<shared_ptr<available_package>>
+ filter (const shared_ptr<repository>&, odb::result<available_package>&&);
+
+ shared_ptr<available_package>
+ filter_one (const shared_ptr<repository>&, odb::result<available_package>&&);
// state
//