aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-01-15 18:20:34 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-01-15 18:20:34 +0000
commitf16e8f30a7c3188faa7c8b795e6b8fdfc6237684 (patch)
treecd17fba272cb75c7187e65152d56b3790a996d56
parentb9c17411d001b3a5f990958b680fb2b47f4acdd0 (diff)
downloadpaludis-f16e8f30a7c3188faa7c8b795e6b8fdfc6237684.tar.gz
paludis-f16e8f30a7c3188faa7c8b795e6b8fdfc6237684.tar.xz
Don't continue stage building when one stage fails w/o throwing any exception.
-rw-r--r--paludis/tasks/stage_builder_task.cc14
-rw-r--r--paludis/tasks/stage_builder_task.hh2
2 files changed, 13 insertions, 3 deletions
diff --git a/paludis/tasks/stage_builder_task.cc b/paludis/tasks/stage_builder_task.cc
index 14f9c36..6801878 100644
--- a/paludis/tasks/stage_builder_task.cc
+++ b/paludis/tasks/stage_builder_task.cc
@@ -43,6 +43,11 @@ namespace paludis
#include <paludis/tasks/stage_options-sr.cc>
+StageBuildError::StageBuildError(const std::string & message) throw () :
+ Exception(message)
+{
+}
+
StageBase::~StageBase()
{
}
@@ -98,8 +103,13 @@ StageBuilderTask::execute()
continue;
}
- if (((*s)->build(_imp->options)) && (! _imp->options.pretend))
- on_build_succeed(*s);
+ if (! (*s)->build(_imp->options))
+ throw StageBuildError("Failed building stage '" + (*s)->short_name() + "'");
+
+ if (_imp->options.pretend)
+ continue;
+
+ on_build_succeed(*s);
}
catch (const StageBuildError & e)
{
diff --git a/paludis/tasks/stage_builder_task.hh b/paludis/tasks/stage_builder_task.hh
index b7c98f5..6779e16 100644
--- a/paludis/tasks/stage_builder_task.hh
+++ b/paludis/tasks/stage_builder_task.hh
@@ -37,7 +37,7 @@ namespace paludis
class StageBuildError :
public Exception
{
- protected:
+ public:
/**
* Constructor
*