<commit_before>/*
 * Copyright (C) 2007-2015 <NAME>.
 *
 * Use of this source is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 */

#include "BuildPlan.h"
#include "InstallStage.h"

namespace fluxmake {

bool InstallStage::run()
{
    if (complete_) return success_;
    complete_ = true;

    if (plan()->options() & BuildPlan::Test) return success_ = true;

    for (int i = 0; i < plan()->prerequisites()->count(); ++i) {
        if (!plan()->prerequisites()->at(i)->installStage()->run())
            return success_ = false;
    }

    if (plan()->options() & BuildPlan::Package) return success_ = true;

    if (plan()->options() & BuildPlan::Tools) {
        for (int i = 0; i < plan()->modules()->count(); ++i) {
            if (!toolChain()->install(plan(), plan()->modules()->at(i)))
                return success_ = false;
        }
        return success_ = true;
    }

    return success_ = toolChain()->install(plan());
}

} // namespace fluxmake<commit_msg>Fix: respect build scope in install stage<commit_after>/*
 * Copyright (C) 2007-2015 <NAME>.
 *
 * Use of this source is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 */

#include "BuildPlan.h"
#include "InstallStage.h"

namespace fluxmake {

bool InstallStage::run()
{
    if (complete_) return success_;
    complete_ = true;

    if (outOfScope()) return success_ = true;
    if (plan()->options() & BuildPlan::Test) return success_ = true;

    for (int i = 0; i < plan()->prerequisites()->count(); ++i) {
        if (!plan()->prerequisites()->at(i)->installStage()->run())
            return success_ = false;
    }

    if (plan()->options() & BuildPlan::Package) return success_ = true;

    if (plan()->options() & BuildPlan::Tools) {
        for (int i = 0; i < plan()->modules()->count(); ++i) {
            if (!toolChain()->install(plan(), plan()->modules()->at(i)))
                return success_ = false;
        }
        return success_ = true;
    }

    return success_ = toolChain()->install(plan());
}

} // namespace fluxmake
{'fraction_non_alphanumeric': 0.177063339731286, 'fraction_numerical': 0.009596928982725527, 'mean_word_length': 2.839779005524862, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5909580', 'n_tokens_mistral': 646, 'n_tokens_neox': 611, 'n_words': 180}