aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-03-05 16:19:21 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-03-05 16:19:21 +0000
commit28cee80678bb3b69e0712d016b8413b5b3cbebb1 (patch)
treeb3e8cfbf4b068f4bfc8660ca34561c50773c5eda
parent71c6ae679fd013a4a3fdf53f4c68ede3b96d701a (diff)
downloadpaludis-28cee80678bb3b69e0712d016b8413b5b3cbebb1.tar.gz
paludis-28cee80678bb3b69e0712d016b8413b5b3cbebb1.tar.xz
Fix pretend_resume demo hook.
-rwxr-xr-xhooks/demos/pretend_resume.bash.in2
-rw-r--r--src/clients/paludis/install.cc6
-rw-r--r--src/clients/reconcilio/install.cc6
3 files changed, 11 insertions, 3 deletions
diff --git a/hooks/demos/pretend_resume.bash.in b/hooks/demos/pretend_resume.bash.in
index 84c77a9..7c99adf 100755
--- a/hooks/demos/pretend_resume.bash.in
+++ b/hooks/demos/pretend_resume.bash.in
@@ -11,7 +11,7 @@
#
# You should ensure that it has execute permissions.
-[[ ${RESUME_COMMAND} = *" '="* ]] || exit 0
+[[ -n ${RESUME_COMMAND} ]] || exit 0
${DEPLIST_HAS_ERRORS} && exit 0
echo
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 749a71d..1aeee68 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -124,6 +124,10 @@ namespace
virtual std::string make_resume_command(const bool undo_failures) const
{
+ std::string serialisation(serialise(undo_failures));
+ if (serialisation.empty())
+ return "";
+
std::string resume_command = environment()->paludis_command()
+ " --" + CommandLine::get_instance()->a_install.long_name();
@@ -131,7 +135,7 @@ namespace
resume_command.append(CommandLine::get_instance()->dl_args.resume_command_fragment(*this));
resume_command.append(" --" + CommandLine::get_instance()->a_serialised.long_name() + " " + serialised_format());
resume_command.append(" ");
- resume_command.append(serialise(undo_failures));
+ resume_command.append(serialisation);
return resume_command;
}
diff --git a/src/clients/reconcilio/install.cc b/src/clients/reconcilio/install.cc
index 774bffa..5c5fded 100644
--- a/src/clients/reconcilio/install.cc
+++ b/src/clients/reconcilio/install.cc
@@ -104,13 +104,17 @@ namespace
virtual std::string make_resume_command(const bool undo_failures) const
{
+ std::string serialisation(serialise(undo_failures));
+ if (serialisation.empty())
+ return "";
+
std::string resume_command = environment()->paludis_command() + " --install";
resume_command.append(CommandLine::get_instance()->install_args.resume_command_fragment(*this));
resume_command.append(CommandLine::get_instance()->dl_args.resume_command_fragment(*this));
resume_command.append(" --serialised " + serialised_format());
resume_command.append(" ");
- resume_command.append(serialise(undo_failures));
+ resume_command.append(serialisation);
return resume_command;
}