diff options
Diffstat (limited to 'bpkg/system-repository.hxx')
-rw-r--r-- | bpkg/system-repository.hxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/bpkg/system-repository.hxx b/bpkg/system-repository.hxx index 1168ec0..d524ee4 100644 --- a/bpkg/system-repository.hxx +++ b/bpkg/system-repository.hxx @@ -14,9 +14,11 @@ namespace bpkg { + struct system_package_status; // <bpkg/system-package-manager.hxx> + // A map of discovered system package versions. The information can be // authoritative (i.e., it was provided by the user or auto-discovered - // on this run) or non-authoritative (i.e., comes from selected_packages + // on this run) or non-authoritative (i.e., comes from selected packages // that are present in the database; in a sence it was authoritative but // on some previous run. // @@ -30,16 +32,25 @@ namespace bpkg version_type version; bool authoritative; + + // If the information is authoritative then this member indicates whether + // the version came from the system package manager (not NULL) or + // user/fallback (NULL). + // + const system_package_status* system_status; }; - class system_repository_type + class system_repository { public: const version& - insert (const package_name& name, const version&, bool authoritative); + insert (const package_name& name, + const version&, + bool authoritative, + const system_package_status* = nullptr); const system_package* - find (const package_name& name) + find (const package_name& name) const { auto i (map_.find (name)); return i != map_.end () ? &i->second : nullptr; @@ -48,8 +59,6 @@ namespace bpkg private: std::map<package_name, system_package> map_; }; - - extern system_repository_type system_repository; } #endif // BPKG_SYSTEM_REPOSITORY_HXX |