aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2010-06-23 22:23:11 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2010-06-23 22:23:11 +0100
commit642372e42c6d77229ad0c11557b3411dcefbda9c (patch)
tree72a1ab995b4decffb26941ce0a924a3a2dd32f41
parent2b3a39829fa423dc7a0b3209a52d66dfa29f6bbc (diff)
downloadpaludis-642372e42c6d77229ad0c11557b3411dcefbda9c.tar.gz
paludis-642372e42c6d77229ad0c11557b3411dcefbda9c.tar.xz
Put --preserve-world in the resume file
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc1
-rw-r--r--src/clients/cave/cmd_resume.cc4
-rw-r--r--src/clients/cave/resume_data.cc2
-rw-r--r--src/clients/cave/resume_data.hh2
4 files changed, 9 insertions, 0 deletions
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 4d2f118..e7bc0fb 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -1146,6 +1146,7 @@ namespace
ResumeData resume_data(make_named_values<ResumeData>(
n::job_lists() = lists,
+ n::preserve_world() = cmdline.execution_options.a_preserve_world.specified(),
n::target_set() = cmdline.a_set.specified(),
n::targets() = targets
));
diff --git a/src/clients/cave/cmd_resume.cc b/src/clients/cave/cmd_resume.cc
index fb65d77..571e8ee 100644
--- a/src/clients/cave/cmd_resume.cc
+++ b/src/clients/cave/cmd_resume.cc
@@ -80,6 +80,7 @@ namespace
execution_options(this),
program_options(this)
{
+ execution_options.a_preserve_world.remove();
add_usage_line("--resume-file state [ --retry-failed ] [ --retry-skipped ]");
}
@@ -141,6 +142,9 @@ namespace
p != p_end ; ++p)
args->push_back(*p);
+ if (data->preserve_world())
+ args->push_back("--preserve-world");
+
if (data->target_set())
args->push_back("--set");
diff --git a/src/clients/cave/resume_data.cc b/src/clients/cave/resume_data.cc
index 1609c8b..2c9a9aa 100644
--- a/src/clients/cave/resume_data.cc
+++ b/src/clients/cave/resume_data.cc
@@ -49,6 +49,7 @@ ResumeData::deserialise(Deserialisation & d)
return make_shared_copy(make_named_values<ResumeData>(
n::job_lists() = v.member<std::tr1::shared_ptr<JobLists> >("job_lists"),
+ n::preserve_world() = v.member<bool>("preserve_world"),
n::target_set() = v.member<bool>("target_set"),
n::targets() = targets
));
@@ -59,6 +60,7 @@ ResumeData::serialise(Serialiser & s) const
{
s.object("ResumeData@" + stringify(PALUDIS_VERSION))
.member(SerialiserFlags<serialise::might_be_null>(), "job_lists", job_lists())
+ .member(SerialiserFlags<>(), "preserve_world", preserve_world())
.member(SerialiserFlags<>(), "target_set", target_set())
.member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "targets", targets())
;
diff --git a/src/clients/cave/resume_data.hh b/src/clients/cave/resume_data.hh
index fcf3cf2..d7a0319 100644
--- a/src/clients/cave/resume_data.hh
+++ b/src/clients/cave/resume_data.hh
@@ -31,6 +31,7 @@ namespace paludis
namespace n
{
typedef Name<struct job_lists_name> job_lists;
+ typedef Name<struct preserve_world_name> preserve_world;
typedef Name<struct target_set_name> target_set;
typedef Name<struct targets_name> targets;
}
@@ -40,6 +41,7 @@ namespace paludis
struct ResumeData
{
NamedValue<n::job_lists, std::tr1::shared_ptr<resolver::JobLists> > job_lists;
+ NamedValue<n::preserve_world, bool> preserve_world;
NamedValue<n::target_set, bool> target_set;
NamedValue<n::targets, std::tr1::shared_ptr<Sequence<std::string> > > targets;