From 98b1145e8c58a128766738eab7d0e97087d2d806 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Dec 2024 11:00:46 +0200 Subject: Diagnose --match-only use with dist meta-operation --- libbuild2/dist/operation.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libbuild2/dist/operation.cxx b/libbuild2/dist/operation.cxx index 5b00980..0ed02c6 100644 --- a/libbuild2/dist/operation.cxx +++ b/libbuild2/dist/operation.cxx @@ -60,8 +60,13 @@ namespace build2 const path& arc, const dir_path& dir, const string& ext); static operation_id - dist_operation_pre (context&, const values&, operation_id o) + dist_operation_pre (context& ctx, const values&, operation_id o) { + // Note: cannot be --load-only which requires perform(update). + // + if (ctx.match_only) + fail << "--match-only specified for dist meta-operation"; + if (o != default_id) fail << "explicit operation specified for dist meta-operation"; @@ -283,6 +288,8 @@ namespace build2 action_targets ts {tgt}; { + // Signal to the rules we will not be executing. + // auto mog = make_guard ([&ctx] () {ctx.match_only = nullopt;}); ctx.match_only = match_only_level::all; -- cgit v1.1