From 2508d4d0e05ef55beb3a4db52aa01424eedb4226 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 20 Jul 2017 15:30:21 +0300 Subject: Make package manifest build inclusions and exclusions order significant --- mod/build-config.cxx | 10 ++-------- mod/mod-package-version-details.cxx | 11 ++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/mod/build-config.cxx b/mod/build-config.cxx index ecbcf6f..1ac4939 100644 --- a/mod/build-config.cxx +++ b/mod/build-config.cxx @@ -160,14 +160,8 @@ namespace brep { for (const auto& bc: p.constraints) { - if (!bc.exclusion && match (bc.config, bc.target, c)) - return false; - } - - for (const auto& bc: p.constraints) - { - if (bc.exclusion && match (bc.config, bc.target, c)) - return true; + if (match (bc.config, bc.target, c)) + return bc.exclusion; } return false; diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index 0138154..edab232 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -384,14 +384,11 @@ handle (request& rq, response& rs) { for (const auto& bc: pkg->build_constraints) { - if (!bc.exclusion && match (bc.config, bc.target, c)) - return false; - } - - for (const auto& bc: pkg->build_constraints) - { - if (bc.exclusion && match (bc.config, bc.target, c)) + if (match (bc.config, bc.target, c)) { + if (!bc.exclusion) + return false; + // Save the first sentence of the exclusion comment, lower-case the // first letter if the beginning looks like a word (the second // character is the lower-case letter or space). -- cgit v1.1