core: in confirm_spawn, the meaning of 'n' and 's' choices are confusing
authorFranck Bui <fbui@suse.com>
Sun, 13 Nov 2016 08:32:52 +0000 (09:32 +0100)
committerFranck Bui <fbui@suse.com>
Thu, 17 Nov 2016 17:16:49 +0000 (18:16 +0100)
Before this patch we had:

 - "no" which gives "failing execution" but the command is actually assumed as
   succeed.

 - "skip" which gives "skipping", but the command is assumed to have failed,
   which ends up with "Failed to start ..." on the console.

Now we have:

 - "fail" which gives "failing execution" and the command is indeed assumed as
   failed.

 - "skip" which gives "skipping execution" and the command is assumed as
   succeed.

NEWS
src/core/execute.c

diff --git a/NEWS b/NEWS
index b10a6f5..fbd9afa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,17 @@
 systemd System and Service Manager
 
+CHANGES WITH 233 in spe
+
+        * The confirmation spawn prompt has been reworked to offer the
+          following choices:
+
+           (f)ail, don't execute the command and pretend it failed
+           (s)kip, don't execute the command and pretend it succeeded
+           (y)es, execute the command
+
+          The 'n' choice for the confirmation spawn prompt has been removed,
+          because its meaning was confusing.
+
 CHANGES WITH 232:
 
         * The new RemoveIPC= option can be used to remove IPC objects owned by
index 8b09f71..10e9dd7 100644 (file)
@@ -731,7 +731,7 @@ static int ask_for_confirmation(const char *vc, const char *cmdline) {
                 return CONFIRM_EXECUTE;
         }
 
-        r = ask_char(&c, "yns", "Execute %s? [Yes, No, Skip] ", cmdline);
+        r = ask_char(&c, "yfs", "Execute %s? [Yes, Fail, Skip] ", cmdline);
         if (r < 0) {
                 write_confirm_error_fd(r, STDOUT_FILENO);
                 r = CONFIRM_EXECUTE;
@@ -739,13 +739,13 @@ static int ask_for_confirmation(const char *vc, const char *cmdline) {
         }
 
         switch (c) {
-        case 'n':
+        case 'f':
                 printf("Failing execution.\n");
-                r = CONFIRM_PRETEND_SUCCESS;
+                r = CONFIRM_PRETEND_FAILURE;
                 break;
         case 's':
                 printf("Skipping execution.\n");
-                r = CONFIRM_PRETEND_FAILURE;
+                r = CONFIRM_PRETEND_SUCCESS;
                 break;
         case 'y':
                 r = CONFIRM_EXECUTE;