From c28758a9327efc0f3bfc2f3c14d12b533750d94b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 8 Jul 2019 21:27:53 +0300 Subject: Add support for marking internal repository as non-buildable --- libbrep/package.hxx | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'libbrep/package.hxx') diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 86a1922..5e1bebd 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -21,7 +21,7 @@ // #define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 14 -#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 14, closed) +#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 15, closed) namespace brep { @@ -245,6 +245,7 @@ namespace brep string display_name, repository_location cache_location, optional, + bool buildable, uint16_t priority); // Create external repository. @@ -259,8 +260,8 @@ namespace brep repository_location location; // Note: foreign-mapped in build. string display_name; - // The order in the internal repositories configuration file, starting from - // 1. 0 for external repositories. + // The order in the internal repositories configuration file, starting + // from 1. 0 for external repositories. // uint16_t priority; @@ -291,6 +292,12 @@ namespace brep timestamp repositories_timestamp; bool internal; + + // Whether repository packages are buildable by the build bot controller + // service. Can only be true for internal repositories. + // + bool buildable; + vector> complements; vector> prerequisites; @@ -401,6 +408,13 @@ namespace brep bool internal () const noexcept {return internal_repository != nullptr;} + bool + stub () const noexcept + { + return version.compare (wildcard_version, + true /* ignore_revision */) == 0; + } + // Manifest data. // package_id id; @@ -459,6 +473,17 @@ namespace brep vector> other_repositories; + // Whether the package is buildable by the build bot controller service. + // Can only be true for non-stubs that belong to at least one buildable + // (internal) repository. + // + // While we could potentially calculate this flag on the fly, that would + // complicate the database queries significantly. + // + // Note: foreign-mapped in build. + // + bool buildable; + // Database mapping. // #pragma db member(id) id column("") -- cgit v1.1