]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Remove the odd "Drop back to attended mode" logic
authorJon Turney <jon.turney@dronecode.org.uk>
Sun, 23 Jun 2024 18:26:27 +0000 (19:26 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Sun, 23 Jun 2024 18:28:58 +0000 (19:28 +0100)
Remove the odd "Drop back to attended mode" logic, only used in one
place (when we do not have any selected sites), and instead report this
as a problem and terminate with non-zero exit code.

https://cygwin.com/pipermail/cygwin/2024-June/256158.html

proppage.cc
site.cc

index 514c1085df80a5e054fe526104d73d2d85845e5f..d177f2ddc1bf1d3099a34e0c656502e9fc2092f4 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "getopt++/BoolOption.h"
 #include "Exception.h"
-#include "LogSingleton.h"
+#include "LogFile.h"
 
 bool PropertyPage::DoOnceForSheet = true;
 
@@ -196,17 +196,17 @@ PropertyPage::DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
 
               OnActivate ();
 
-              if (unattended_mode) 
+              if (unattended_mode)
               {
-                // -2 == disable unattended mode, display page
+                // -2 == cannot continue in unattended mode
                 // -1 == display page but stay in unattended mode (progress bars)
                 // 0 == skip to next page (in propsheet sequence)
                 // IDD_* == skip to specified page
                 long nextwindow = OnUnattended();
                 if (nextwindow == -2)
                 {
-                  unattended_mode = attended;
-                  SetWindowLongPtr (GetHWND (), DWLP_MSGRESULT, 0);
+                  Log (LOG_PLAIN) << "Unable to continue" << endLog;
+                  Logger ().exit (1);
                   return TRUE;
                 }
                 else if (nextwindow == -1)
@@ -224,8 +224,8 @@ PropertyPage::DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
                   SetWindowLongPtr (GetHWND (), DWLP_MSGRESULT, nextwindow);
                   return TRUE;
                 }
-              } 
-              else 
+              }
+              else
               {
                 // 0 == Accept activation, -1 = Don't accept
                 ::SetWindowLongPtr (GetHWND (), DWLP_MSGRESULT, 0);
diff --git a/site.cc b/site.cc
index b76a0bec2967edddef7a1895ff1b78a19b3f2b00..aa605617e3cf303e97123a9c930f347c2e1c009b 100644 (file)
--- a/site.cc
+++ b/site.cc
@@ -665,8 +665,9 @@ SitePage::OnUnattended ()
 {
   if (SendMessage (GetDlgItem (IDC_URL_LIST), LB_GETSELCOUNT, 0, 0) > 0)
     return OnNext ();
-  else
-    return -2;
+
+  Log (LOG_PLAIN) << "No package repository site(s) specified" << endLog;
+  return -2;
 }
 
 void
This page took 0.034662 seconds and 5 git commands to generate.