aboutsummaryrefslogtreecommitdiff
path: root/bpkg/manifest-utility.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-03-09 14:02:32 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-03-09 14:58:10 +0300
commit61adcbd5ca83762c02cfa421e09fbd65c52b6da9 (patch)
tree4eaf5089ad37104a53ca74464c26b597ed2414bc /bpkg/manifest-utility.hxx
parent538711543c68be94b3e7e3192394bc2f19f49516 (diff)
Fix up package manifest version for pkg-unpack
Diffstat (limited to 'bpkg/manifest-utility.hxx')
-rw-r--r--bpkg/manifest-utility.hxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/bpkg/manifest-utility.hxx b/bpkg/manifest-utility.hxx
index f608858..ee73c4a 100644
--- a/bpkg/manifest-utility.hxx
+++ b/bpkg/manifest-utility.hxx
@@ -74,6 +74,21 @@ namespace bpkg
//
bool
repository_name (const string&);
+
+ // Return the version of a package as provided by the build2 version module.
+ // Return nullopt if the version module is disabled for the package (or the
+ // build2 project directory doesn't contain the manifest file). Fail if the
+ // directory is not a build2 project.
+ //
+ // Note that if the package directory is under the version control, then the
+ // resulting version may be populated with the snapshot information (see
+ // libbutl/standard-version.mxx for more details). Thus, this function can
+ // be used for fixing up the package manifest version.
+ //
+ class common_options;
+
+ optional<version>
+ package_version (const common_options&, const dir_path&);
}
#endif // BPKG_MANIFEST_UTILITY_HXX