From 65b57d04735886fbd8b202c32ffc592ac44db2c2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 12 Jan 2023 21:55:46 +0300 Subject: Store in database and document *-name, *-version, and *-to-downstream-version package manifest values --- bpkg/package.hxx | 13 ++++++++++++- bpkg/package.xml | 41 +++++++++++++++++++++++++++++++++++++++++ bpkg/pkg-build.cxx | 2 +- bpkg/pkg-verify.cxx | 2 +- bpkg/pkg-verify.hxx | 4 ++-- 5 files changed, 57 insertions(+), 5 deletions(-) (limited to 'bpkg') diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 4f4f16b..14cd296 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -27,7 +27,7 @@ // #define DB_SCHEMA_VERSION_BASE 12 -#pragma db model version(DB_SCHEMA_VERSION_BASE, 20, closed) +#pragma db model version(DB_SCHEMA_VERSION_BASE, 21, closed) namespace bpkg { @@ -670,6 +670,10 @@ namespace bpkg // #pragma db value(buildfile) definition + // distribution_name_value + // + #pragma db value(distribution_name_value) definition + #pragma db object pointer(shared_ptr) session class available_package { @@ -716,6 +720,8 @@ namespace bpkg optional root_build; vector buildfiles; + vector distribution_values; + // Present for non-transient objects only (and only for certain repository // types). // @@ -734,6 +740,7 @@ namespace bpkg version (move (m.version)), dependencies (convert (move (m.dependencies))), tests (move (m.tests)), + distribution_values (move (m.distribution_values)), sha256sum (move (m.sha256sum)) { if (!stub ()) @@ -834,6 +841,10 @@ namespace bpkg // #pragma db member(tests) id_column("") value_column("test_") + // distributions + // + #pragma db member(distribution_values) id_column("") value_column("dist_") + // alt_naming // // @@ TMP Drop when database migration to the schema version 20 is no diff --git a/bpkg/package.xml b/bpkg/package.xml index eafcaa8..baa8dfb 100644 --- a/bpkg/package.xml +++ b/bpkg/package.xml @@ -1,4 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 4e88fa1..aa34594 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -2189,7 +2189,7 @@ namespace bpkg false /* ignore_toolchain */, false /* expand_values */, true /* load_buildfiles */, - true /* complete_depends */, + true /* complete_values */, diag ? 2 : 1)); // This is a package archive. diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx index 0541f1b..d48c5b7 100644 --- a/bpkg/pkg-verify.cxx +++ b/bpkg/pkg-verify.cxx @@ -566,7 +566,7 @@ namespace bpkg o.ignore_unknown () /* ignore_toolchain */, o.deep () /* expand_values */, o.deep () /* load_buildfiles */, - o.deep () /* complete_depends */, + o.deep () /* complete_values */, o.silent () ? 0 : 2)); if (o.manifest ()) diff --git a/bpkg/pkg-verify.hxx b/bpkg/pkg-verify.hxx index 631f0be..0609844 100644 --- a/bpkg/pkg-verify.hxx +++ b/bpkg/pkg-verify.hxx @@ -26,7 +26,7 @@ namespace bpkg // description-type value to the effective description type (see // libbpkg/manifest.hxx), load the bootstrap, root, and config/*.build // buildfiles into the respective *-build values, and complete the - // dependency constraints. + // manifest values (depends, -version, etc). // // Throw not_package (derived from failed) if this doesn't look like a // package. Throw plain failed if this does looks like a package but @@ -47,7 +47,7 @@ namespace bpkg bool ignore_toolchain, bool expand_values, bool load_buildfiles, - bool complete_depends = true, + bool complete_values = true, int diag_level = 2); // Similar to the above but verifies that a source directory is a valid -- cgit v1.1