diff options
Diffstat (limited to 'bpkg/system-repository.hxx')
-rw-r--r-- | bpkg/system-repository.hxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/bpkg/system-repository.hxx b/bpkg/system-repository.hxx index 83a43ea..d524ee4 100644 --- a/bpkg/system-repository.hxx +++ b/bpkg/system-repository.hxx @@ -1,5 +1,4 @@ // file : bpkg/system-repository.hxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BPKG_SYSTEM_REPOSITORY_HXX @@ -15,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. // @@ -31,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; @@ -49,8 +59,6 @@ namespace bpkg private: std::map<package_name, system_package> map_; }; - - extern system_repository_type system_repository; } #endif // BPKG_SYSTEM_REPOSITORY_HXX |