From eaebfcff492cf7f707b44a3d28620e786116faf1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 17 Feb 2023 21:06:00 +0300 Subject: Store in database and document type and language package manifest values --- bpkg/package.hxx | 24 +++++++++++++++++++++++- bpkg/package.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ doc/manual.cli | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) diff --git a/bpkg/package.hxx b/bpkg/package.hxx index e811e62..e5e70ad 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -11,6 +11,7 @@ #include // static_assert #include +#include #include #include @@ -27,7 +28,7 @@ // #define DB_SCHEMA_VERSION_BASE 12 -#pragma db model version(DB_SCHEMA_VERSION_BASE, 22, closed) +#pragma db model version(DB_SCHEMA_VERSION_BASE, 23, closed) namespace bpkg { @@ -513,6 +514,10 @@ namespace bpkg operator size_t () const {return result;} }; + // language + // + #pragma db value(language) definition + // package_location // #pragma db value @@ -685,6 +690,11 @@ namespace bpkg upstream_version_type version; optional upstream_version; + optional type; + + small_vector languages; + odb::section languages_section; + optional project; // List of repository fragments to which this package version belongs @@ -743,6 +753,8 @@ namespace bpkg : id (move (m.name), m.version), version (move (m.version)), upstream_version (move (m.upstream_version)), + type (move (m.type)), + languages (move (m.languages)), project (move (m.project)), dependencies (convert (move (m.dependencies))), tests (move (m.tests)), @@ -794,6 +806,16 @@ namespace bpkg // #pragma db member(id) id column("") #pragma db member(version) set(this.version.init (this.id.version, (?))) + + // languages + // + #pragma db member(languages) id_column("") value_column("language_") \ + section(languages_section) + + #pragma db member(languages_section) load(lazy) update(always) + + // locations + // #pragma db member(locations) id_column("") value_column("") \ unordered value_not_null diff --git a/bpkg/package.xml b/bpkg/package.xml index a8558fd..fd332bc 100644 --- a/bpkg/package.xml +++ b/bpkg/package.xml @@ -1,4 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/manual.cli b/doc/manual.cli index 1f540d2..d417e92 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -1041,6 +1041,8 @@ a full package manifest they can be interleaved with non-header values. name: version: [upstream-version]: +[type]: +[language]: [project]: [priority]: [; ] summary: @@ -1129,6 +1131,46 @@ and use the \c{upstream-version} value to preserve the original version for information. +\h2#manifest-package-type-language|\c{type, language}| + +\ +[type]: +[language]: + + = + = [=impl] +\ + +The package type and programming language(s). + +The currently recognized package types are \c{exe}, \c{lib}, and \c{other}. If +the type is not specified, then if the package name starts with \c{lib}, then +it is assumed to be \c{lib} and \c{exe} otherwise (see \l{#package-name +Package Name} for details). Other package types may be added in the future and +code that does not recognize a certain package type should treat it as +\c{other}. + +The package language must be in the lower case, for example, \c{c}, \c{c++}, +\c{rust}, \c{bash}. If the language is not specified, then if the package name +has an extension (as in, for example, \c{libbutl.bash}; see \l{#package-name +Package Name} for details) the extension is assumed to name the package +language. Otherwise, \c{cc} (unspecified \c{c}-common language) is assumed. If +a package uses multiple languages, then multiple \c{language} values must be +specified. The languages which are only used in a library's implementation (as +opposed to also in its interface) should be marked as such. For example, for a +C library with C++ implementation: + +\ +type: lib +language: c +language: c++=impl +\ + +\N|If the use of a language, such as C++, also always implies the use of +another language, such as C, then such an implied language need not be +explicitly specified.| + + \h2#manifest-package-project|\c{project}| \ -- cgit v1.1