aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-mask.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-06-16 18:17:07 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-06-19 13:49:27 +0300
commit636d69c1b740d8975bb7c7a3b518c280ac224545 (patch)
treebe9552beaea26413280bac12dabf07127bec4e28 /bpkg/rep-mask.hxx
parent5e6c781d4a1fafdb5e81c17b792cd36b7433ce90 (diff)
Add --mask-repository pkg-build option
Diffstat (limited to 'bpkg/rep-mask.hxx')
-rw-r--r--bpkg/rep-mask.hxx66
1 files changed, 66 insertions, 0 deletions
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 <bpkg/types.hxx>
+#include <bpkg/forward.hxx> // database, repository
+#include <bpkg/utility.hxx>
+
+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<repository>&);
+
+ // Note: the argument must refer to a persistent object which incorporates
+ // the configuration information (database).
+ //
+ bool
+ rep_masked (const lazy_weak_ptr<repository>&);
+
+ // 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<repository_fragment>&);
+
+ // Note: the argument must refer to a persistent object which incorporates
+ // the configuration information (database).
+ //
+ bool
+ rep_masked_fragment (const lazy_shared_ptr<repository_fragment>&);
+}
+
+#endif // BPKG_REP_MASK_HXX