diff options
Diffstat (limited to 'brep')
-rw-r--r-- | brep/module | 8 | ||||
-rw-r--r-- | brep/module.cxx | 7 | ||||
-rw-r--r-- | brep/package-version-details.cxx | 1 | ||||
-rw-r--r-- | brep/repository-root | 3 | ||||
-rw-r--r-- | brep/repository-root.cxx | 12 |
5 files changed, 31 insertions, 0 deletions
diff --git a/brep/module b/brep/module index 80a0a56..5e6a181 100644 --- a/brep/module +++ b/brep/module @@ -165,6 +165,14 @@ namespace brep virtual bool handle (request&, response&, log&); + virtual void + version (log&); + + // Can be overriden by the module implementation to log version, etc. + // + virtual void + version () {} + name_values expand_options (const name_values&); diff --git a/brep/module.cxx b/brep/module.cxx index 283731e..e2b99af 100644 --- a/brep/module.cxx +++ b/brep/module.cxx @@ -337,6 +337,13 @@ namespace brep } } + void module:: + version (log& l) + { + log_ = &l; + version (); + } + // module::name_value_scanner // module::name_value_scanner:: diff --git a/brep/package-version-details.cxx b/brep/package-version-details.cxx index 9bc06f6..0300b88 100644 --- a/brep/package-version-details.cxx +++ b/brep/package-version-details.cxx @@ -48,6 +48,7 @@ handle (request& rq, response& rs) { using namespace web; using namespace web::xhtml; + using brep::version; // Not to confuse with module::version. MODULE_DIAG; diff --git a/brep/repository-root b/brep/repository-root index 2397764..006f163 100644 --- a/brep/repository-root +++ b/brep/repository-root @@ -38,6 +38,9 @@ namespace brep virtual void init (cli::scanner&); + virtual void + version (); + private: shared_ptr<package_search> package_search_; shared_ptr<package_details> package_details_; diff --git a/brep/repository-root.cxx b/brep/repository-root.cxx index 7af76b2..5711109 100644 --- a/brep/repository-root.cxx +++ b/brep/repository-root.cxx @@ -10,6 +10,7 @@ #include <brep/types> #include <brep/utility> +#include <brep/version> #include <brep/module> #include <brep/options> @@ -187,4 +188,15 @@ namespace brep return false; } + + void repository_root:: + version () + { + MODULE_DIAG; + + info << "module " << BREP_VERSION_STR + << ", libbrep " << LIBBREP_VERSION_STR + << ", libbpkg " << LIBBPKG_VERSION_STR + << ", libbutl " << LIBBUTL_VERSION_STR; + } } |