From: Jon Turney Date: Sun, 23 Jun 2024 18:26:27 +0000 (+0100) Subject: Remove the odd "Drop back to attended mode" logic X-Git-Url: https://cygwin.com/git/?a=commitdiff_plain;h=a8d773ed09b265716b9fcb736907cd2f55a2d31f;p=cygwin-apps%2Fsetup.git Remove the odd "Drop back to attended mode" logic 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 --- diff --git a/proppage.cc b/proppage.cc index 514c1085..d177f2dd 100644 --- a/proppage.cc +++ b/proppage.cc @@ -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 b76a0bec..aa605617 100644 --- 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