From 636d69c1b740d8975bb7c7a3b518c280ac224545 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 16 Jun 2023 18:17:07 +0300 Subject: Add --mask-repository pkg-build option --- bpkg/rep-mask.hxx | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 bpkg/rep-mask.hxx (limited to 'bpkg/rep-mask.hxx') diff --git a/bpkg/rep-mask.hxx b/bpkg/rep-mask.hxx new file mode 100644 index 0000000..dd9cedf --- /dev/null +++ b/bpkg/rep-mask.hxx @@ -0,0 +1,66 @@ +// file : bpkg/rep-mask.hxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#ifndef BPKG_REP_MASK_HXX +#define BPKG_REP_MASK_HXX + +#include +#include // database, repository +#include + +namespace bpkg +{ + // Note: not a command (at least not yet). + // + // Mask repositories to pretend they don't exist in the configurations that + // are used as the repository information sources (repo_configs). Also mask + // their complement and prerequisite repositories, recursively, excluding + // those which are complements and/or prerequisites of other unmasked + // repositories. The repositories can be specified either as repository + // location canonical names or URLs. Issue diagnostics and fail if any of + // the specified repositories don't exist in any configuration. + // + // Notes: + // + // - A repository may end up being masked in one configuration but not in + // another. + // + // - Using a canonical name potentially masks repositories with different + // URLs in different configurations (think of local and remote pkg + // repository locations). + // + // - Using a URL potentially masks repositories with different canonical + // names in the same configuration (think of directory and local git + // repository locations). + // + // NOTE: repo_configs needs to be filled prior to the function call. + // + void + rep_mask (const strings&); + + // Return true if a repository is masked in the specified configuration. + // + bool + rep_masked (database&, const shared_ptr&); + + // Note: the argument must refer to a persistent object which incorporates + // the configuration information (database). + // + bool + rep_masked (const lazy_weak_ptr&); + + // Return true if a repository fragment in the specified configuration + // belongs to the masked repositories only and is therefore masked (see + // package.hxx for the fragment/repository relationship details). + // + bool + rep_masked_fragment (database&, const shared_ptr&); + + // Note: the argument must refer to a persistent object which incorporates + // the configuration information (database). + // + bool + rep_masked_fragment (const lazy_shared_ptr&); +} + +#endif // BPKG_REP_MASK_HXX -- cgit v1.1