diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-20 14:39:47 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-20 14:39:47 +0200 |
commit | 024161a19edd411ae249ec5fec503aff2409bc67 (patch) | |
tree | 3d38156a238c11a81214c2e220781ccf7eecf62f | |
parent | 0898e65ca37686a0a06a2980acf8cc40c0e2494e (diff) |
Match inner update rule before prerequisites in install::file_rule
-rw-r--r-- | build2/install/rule.cxx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index 58182cb..266f873 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -292,6 +292,16 @@ namespace build2 // In both cases, the next step is to search, match, and collect all the // installable prerequisites. // + // But first, in case of the update pre-operation, match the inner rule + // (actual update). We used to do this after matching the prerequisites + // but the inner rule may provide some rule-specific information (like + // the target extension for exe{}) that may be required during the + // prerequisite search (like the base name for in{}). + // + optional<bool> unchanged; + if (a.operation () == update_id) + unchanged = match_inner (a, t, unmatch::unchanged); + auto& pts (t.prerequisite_targets[a]); auto pms (group_prerequisite_members (a, t, members_mode::never)); @@ -346,14 +356,9 @@ namespace build2 if (a.operation () == update_id) { - // For the update pre-operation match the inner rule (actual update). - // - if (match_inner (a, t, unmatch::unchanged)) - { - return pts.empty () ? noop_recipe : default_recipe; - } - - return &perform_update; + return *unchanged + ? (pts.empty () ? noop_recipe : default_recipe) + : &perform_update; } else { |