From 968a2cbf2f70cbd1aa562cdea6664692c0c22399 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 24 May 2012 15:09:45 +0000 Subject: [PATCH] apt-shell (InstallPackages): do not abort when commit is cancelled (ALT#13877) Unlike one may suppose, this change will not cause the cache of accumulated changes to be cleared by cancelled "commit" operation, but this is exactly what Vitaly Lipatov has proposed in his comments to ALT#13877. --- apt/cmdline/apt-shell.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/apt/cmdline/apt-shell.cc b/apt/cmdline/apt-shell.cc index 2d29a0e..06acf1e 100644 --- a/apt/cmdline/apt-shell.cc +++ b/apt/cmdline/apt-shell.cc @@ -1100,10 +1100,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, " ?] "),Prompt); c2out << flush; if (AnalPrompt(Prompt) == false) - { - c2out << _("Abort.") << endl; - exit(1); - } + return _error->Error(_("Operation cancelled.")); } else { @@ -1119,10 +1116,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, c2out << _("Do you want to continue? [Y/n] ") << flush; if (YnPrompt() == false) - { - c2out << _("Abort.") << endl; - exit(1); - } + return _error->Error(_("Operation cancelled.")); } } }