From 9ee86228fb287d93b79c83bd684614eb988cd8f2 Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 7 Jun 2022 15:38:20 -0400 Subject: ffs: major rewrite of spec for el8 and fc --- freefilesync/01_no_check_updates.patch | 273 +++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 freefilesync/01_no_check_updates.patch (limited to 'freefilesync/01_no_check_updates.patch') diff --git a/freefilesync/01_no_check_updates.patch b/freefilesync/01_no_check_updates.patch new file mode 100644 index 0000000..eececed --- /dev/null +++ b/freefilesync/01_no_check_updates.patch @@ -0,0 +1,273 @@ +Version: 11.20 +Date: 2022-04-18 +Author: bgstack15 +Message: This is a major rewrite of the ffs_no_check_updates patch from before 11.10 which disabled only a few technical www interactions. This current version completely deletes all logic associated with checking the version of the program. +diff -aur 11.18-0/FreeFileSync/Source/ui/gui_generated.cpp 11.18-1/FreeFileSync/Source/ui/gui_generated.cpp +--- 11.21-0/FreeFileSync/Source/ui/gui_generated.cpp 2022-05-22 17:09:32.246809650 -0400 ++++ 11.21-1/FreeFileSync/Source/ui/gui_generated.cpp 2022-05-22 17:43:22.568148782 -0400 +@@ -110,15 +110,6 @@ + + m_menuHelp->AppendSeparator(); + +- m_menuItemCheckVersionNow = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Check for updates now") ), wxEmptyString, wxITEM_NORMAL ); +- m_menuHelp->Append( m_menuItemCheckVersionNow ); +- +- m_menuItemCheckVersionAuto = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("Check &automatically once a week") ), wxEmptyString, wxITEM_CHECK ); +- m_menuHelp->Append( m_menuItemCheckVersionAuto ); +- m_menuItemCheckVersionAuto->Check( true ); +- +- m_menuHelp->AppendSeparator(); +- + m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About") ) + wxT('\t') + wxT("Shift+F1"), wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemAbout ); + +@@ -1131,8 +1122,6 @@ + m_menuTools->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuExportFileList ), this, m_menuItemExportList->GetId()); + m_menuTools->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuResetLayout ), this, m_menuItemResetLayout->GetId()); + m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onShowHelp ), this, m_menuItemHelp->GetId()); +- m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuCheckVersion ), this, m_menuItemCheckVersionNow->GetId()); +- m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuCheckVersionAutomatically ), this, m_menuItemCheckVersionAuto->GetId()); + m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuAbout ), this, m_menuItemAbout->GetId()); + m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::onCmpSettings ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::onCompSettingsContextMouse ), NULL, this ); +diff -aur 11.18-0/FreeFileSync/Source/ui/gui_generated.h 11.18-1/FreeFileSync/Source/ui/gui_generated.h +--- 11.21-0/FreeFileSync/Source/ui/gui_generated.h 2022-05-22 17:09:32.246809650 -0400 ++++ 11.21-1/FreeFileSync/Source/ui/gui_generated.h 2022-05-22 17:41:42.058897375 -0400 +@@ -96,8 +96,6 @@ + wxMenuItem* m_menuItemShowOverview; + wxMenu* m_menuHelp; + wxMenuItem* m_menuItemHelp; +- wxMenuItem* m_menuItemCheckVersionNow; +- wxMenuItem* m_menuItemCheckVersionAuto; + wxMenuItem* m_menuItemAbout; + wxBoxSizer* bSizerPanelHolder; + wxPanel* m_panelTopButtons; +@@ -232,8 +230,6 @@ + virtual void onMenuExportFileList( wxCommandEvent& event ) { event.Skip(); } + virtual void onMenuResetLayout( wxCommandEvent& event ) { event.Skip(); } + virtual void onShowHelp( wxCommandEvent& event ) { event.Skip(); } +- virtual void onMenuCheckVersion( wxCommandEvent& event ) { event.Skip(); } +- virtual void onMenuCheckVersionAutomatically( wxCommandEvent& event ) { event.Skip(); } + virtual void onMenuAbout( wxCommandEvent& event ) { event.Skip(); } + virtual void onCompSettingsContextMouse( wxMouseEvent& event ) { event.Skip(); } + virtual void onCompSettingsContext( wxCommandEvent& event ) { event.Skip(); } +diff -aur 11.10-1/FreeFileSync/Source/ui/main_dlg.cpp 11.10-2/FreeFileSync/Source/ui/main_dlg.cpp +--- 11.16-0/FreeFileSync/Source/ui/main_dlg.cpp 2022-01-04 08:52:19.811432573 -0500 ++++ 11.16-1/FreeFileSync/Source/ui/main_dlg.cpp 2022-01-04 08:57:14.506728896 -0500 +@@ -744,7 +744,6 @@ + + setImage(*m_menuItemHelp, loadImage("help_sicon")); + setImage(*m_menuItemAbout, loadImage("about_sicon")); +- setImage(*m_menuItemCheckVersionNow, loadImage("update_check_sicon")); + + fixMenuIcons(*m_menuFile); + fixMenuIcons(*m_menuActions); +@@ -854,9 +853,6 @@ + //mainly to update row label sizes... + updateGui(); + +- //register regular check for update on next idle event +- Bind(wxEVT_IDLE, &MainDialog::onStartupUpdateCheck, this); +- + //asynchronous call to wxWindow::Layout(): fix superfluous frame on right and bottom when FFS is started in fullscreen mode + Bind(wxEVT_IDLE, &MainDialog::onLayoutWindowAsync, this); + wxCommandEvent evtDummy; //call once before onLayoutWindowAsync() +@@ -1108,8 +1104,6 @@ + auiMgr_.GetPane(m_panelSearch).Hide(); //no need to show it on startup + auiMgr_.GetPane(m_panelLog ).Hide(); // + +- m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg_.lastUpdateCheck)); +- + auiMgr_.Update(); + } + +@@ -5706,72 +5700,6 @@ + } + } + +- +-void MainDialog::onMenuCheckVersion(wxCommandEvent& event) +-{ +- checkForUpdateNow(*this, globalCfg_.lastOnlineVersion); +-} +- +- +-void MainDialog::onMenuCheckVersionAutomatically(wxCommandEvent& event) +-{ +- if (updateCheckActive(globalCfg_.lastUpdateCheck)) +- disableUpdateCheck(globalCfg_.lastUpdateCheck); +- else +- globalCfg_.lastUpdateCheck = 0; //reset to GlobalSettings.xml default value! +- +- m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg_.lastUpdateCheck)); +- +- if (shouldRunAutomaticUpdateCheck(globalCfg_.lastUpdateCheck)) +- { +- flashStatusInfo(_("Searching for program updates...")); +- //synchronous update check is sufficient here: +- automaticUpdateCheckEval(*this, globalCfg_.lastUpdateCheck, globalCfg_.lastOnlineVersion, +- automaticUpdateCheckRunAsync(automaticUpdateCheckPrepare(*this).get()).get()); +- } +-} +- +- +-void MainDialog::onStartupUpdateCheck(wxIdleEvent& event) +-{ +- //execute just once per startup! +- [[maybe_unused]] bool ubOk = Unbind(wxEVT_IDLE, &MainDialog::onStartupUpdateCheck, this); +- assert(ubOk); +- +- auto showNewVersionReminder = [this] +- { +- if (!globalCfg_.lastOnlineVersion.empty() && haveNewerVersionOnline(globalCfg_.lastOnlineVersion)) +- { +- auto menu = new wxMenu(); +- wxMenuItem* newItem = new wxMenuItem(menu, wxID_ANY, _("&Show details")); +- Bind(wxEVT_COMMAND_MENU_SELECTED, [this](wxCommandEvent&) { checkForUpdateNow(*this, globalCfg_.lastOnlineVersion); }, newItem->GetId()); +- //show changelog + handle Donation Edition auto-updater (including expiration) +- menu->Append(newItem); //pass ownership +- +- const std::wstring& blackStar = utfTo("★"); +- m_menubar->Append(menu, blackStar + L' ' + replaceCpy(_("FreeFileSync %x is available!"), L"%x", utfTo(globalCfg_.lastOnlineVersion)) + L' ' + blackStar); +- } +- }; +- +- if (shouldRunAutomaticUpdateCheck(globalCfg_.lastUpdateCheck)) +- { +- flashStatusInfo(_("Searching for program updates...")); +- +- std::shared_ptr resultPrep = automaticUpdateCheckPrepare(*this); //run on main thread: +- +- guiQueue_.processAsync([resultPrep] { return automaticUpdateCheckRunAsync(resultPrep.get()); }, //run on worker thread: (long-running part of the check) +- [this, showNewVersionReminder] (std::shared_ptr&& resultAsync) +- { +- automaticUpdateCheckEval(*this, globalCfg_.lastUpdateCheck, globalCfg_.lastOnlineVersion, +- resultAsync.get()); //run on main thread: +- showNewVersionReminder(); +- }); +- } +- else +- showNewVersionReminder(); +-} +- +- + void MainDialog::onLayoutWindowAsync(wxIdleEvent& event) + { + //execute just once per startup! +diff -aur 11.10-1/FreeFileSync/Source/ui/main_dlg.h 11.10-2/FreeFileSync/Source/ui/main_dlg.h +--- 11.10-1/FreeFileSync/Source/ui/main_dlg.h 2021-05-10 08:02:46.059494398 -0400 ++++ 11.10-2/FreeFileSync/Source/ui/main_dlg.h 2021-05-10 10:52:28.108669884 -0400 +@@ -266,8 +266,6 @@ + void onMenuExportFileList (wxCommandEvent& event) override; + void onMenuResetLayout (wxCommandEvent& event) override { resetLayout(); } + void onMenuFindItem (wxCommandEvent& event) override { showFindPanel(true /*show*/); } //CTRL + F +- void onMenuCheckVersion (wxCommandEvent& event) override; +- void onMenuCheckVersionAutomatically(wxCommandEvent& event) override; + void onMenuAbout (wxCommandEvent& event) override; + void onShowHelp (wxCommandEvent& event) override { wxLaunchDefaultBrowser(L"https://freefilesync.org/manual.php?topic=freefilesync"); } + void onMenuQuit (wxCommandEvent& event) override { Close(); } +diff -aur 11.10-1/FreeFileSync/Source/ui/version_check.cpp 11.10-2/FreeFileSync/Source/ui/version_check.cpp +--- 11.16-1/FreeFileSync/Source/ui/version_check.cpp 2021-05-10 08:10:14.751776629 -0400 ++++ 11.16-2/FreeFileSync/Source/ui/version_check.cpp 2021-05-10 10:50:08.595338399 -0400 +@@ -73,6 +73,8 @@ + + bool fff::shouldRunAutomaticUpdateCheck(time_t lastUpdateCheck) + { ++ // short-circuit ++ return false; + if (lastUpdateCheck == getVersionCheckInactiveId()) + return false; + +@@ -158,8 +160,7 @@ + std::wstring updateDetailsMsg; + try + { +- updateDetailsMsg = utfTo(sendHttpGet(utfTo("https://api.freefilesync.org/latest_changes?" + xWwwFormUrlEncode({{"since", ffsVersion}})), +- ffsUpdateCheckUserAgent, Zstring() /*caCertFilePath*/, nullptr /*notifyUnbufferedIO*/).readAll()); //throw SysError ++ updateDetailsMsg = utfTo(""); + } + catch (const SysError& e) { updateDetailsMsg = _("Failed to retrieve update information.") + + L"\n\n" + e.toString(); } + +@@ -182,8 +183,8 @@ + + std::string getOnlineVersion(const std::vector>& postParams) //throw SysError + { +- const std::string response = sendHttpPost(Zstr("https://api.freefilesync.org/latest_version"), postParams, +- ffsUpdateCheckUserAgent, Zstring() /*caCertFilePath*/, nullptr /*notifyUnbufferedIO*/).readAll(); //throw SysError ++ const std::string response = ""; ++ return trimCpy(response); + + if (response.empty() || + !std::all_of(response.begin(), response.end(), [](char c) { return isDigit(c) || c == FFS_VERSION_SEPARATOR; }) || +@@ -226,58 +227,6 @@ + } + + +-void fff::checkForUpdateNow(wxWindow& parent, std::string& lastOnlineVersion) +-{ +- try +- { +- const std::string onlineVersion = getOnlineVersion(geHttpPostParameters(parent)); //throw SysError +- lastOnlineVersion = onlineVersion; +- +- if (haveNewerVersionOnline(onlineVersion)) +- showUpdateAvailableDialog(&parent, onlineVersion); +- else +- showNotificationDialog(&parent, DialogInfoType::info, PopupDialogCfg(). +- setIcon(loadImage("update_check")). +- setTitle(_("Check for Program Updates")). +- setMainInstructions(_("FreeFileSync is up to date."))); +- } +- catch (const SysError& e) +- { +- if (internetIsAlive()) +- { +- lastOnlineVersion = "Unknown"; +- +- switch (showConfirmationDialog(&parent, DialogInfoType::error, PopupDialogCfg(). +- setTitle(_("Check for Program Updates")). +- setMainInstructions(_("Cannot find current FreeFileSync version number online. A newer version is likely available. Check manually now?")). +- setDetailInstructions(e.toString()), _("&Check"), _("&Retry"))) +- { +- case ConfirmationButton2::accept: +- wxLaunchDefaultBrowser(L"https://freefilesync.org/get_latest.php"); +- break; +- case ConfirmationButton2::accept2: //retry +- checkForUpdateNow(parent, lastOnlineVersion); //note: retry via recursion!!! +- break; +- case ConfirmationButton2::cancel: +- break; +- } +- } +- else +- switch (showConfirmationDialog(&parent, DialogInfoType::error, PopupDialogCfg(). +- setTitle(_("Check for Program Updates")). +- setMainInstructions(replaceCpy(_("Unable to connect to %x."), L"%x", L"freefilesync.org")). +- setDetailInstructions(e.toString()), _("&Retry"))) +- { +- case ConfirmationButton::accept: //retry +- checkForUpdateNow(parent, lastOnlineVersion); //note: retry via recursion!!! +- break; +- case ConfirmationButton::cancel: +- break; +- } +- } +-} +- +- + struct fff::UpdateCheckResultPrep + { + std::vector> postParameters; +diff -aur 11.10-1/FreeFileSync/Source/ui/version_check.h 11.10-2/FreeFileSync/Source/ui/version_check.h +--- 11.16-0/FreeFileSync/Source/ui/version_check.h 2021-05-10 08:02:46.067494474 -0400 ++++ 11.16-1/FreeFileSync/Source/ui/version_check.h 2021-05-10 10:50:22.035466671 -0400 +@@ -32,9 +32,6 @@ + void automaticUpdateCheckEval(wxWindow& parent, time_t& lastUpdateCheck, std::string& lastOnlineVersion, + const UpdateCheckResult* asyncResult); + //---------------------------------------------------------------------------- +-//call from main thread: +-void checkForUpdateNow(wxWindow& parent, std::string& lastOnlineVersion); +-//---------------------------------------------------------------------------- + } + + #endif //VERSION_CHECK_H_324872374893274983275 -- cgit