From 1d5ec164f5839e1ef3f130dba2f74e2ef84b3139 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 12 Apr 2024 17:25:32 +0100 Subject: [PATCH] Suggest URLs for updated setup based on build architecture Suggest URLs for updated setup based on build architecture, rather than on that specified with '--arch'. (Or maybe we should just point at cygwin.com/install.html? Since the URL isn't clickable due to :reasons:) Also: reword messages indicating setup should be updated for clarity, don't mention the internal detail of an "ini file". Future work: These messages (along with other errors coming from the ini file parser), should be localizable. --- IniDBBuilderPackage.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc index 039404b..11edcd6 100644 --- a/IniDBBuilderPackage.cc +++ b/IniDBBuilderPackage.cc @@ -45,6 +45,12 @@ IniDBBuilderPackage::buildTimestamp (const std::string& time) timestamp = strtoul (time.c_str(), 0, 0); } +static std::string +setup_dl_url() +{ + return "https://cygwin.com/setup-" + machine_name(WindowsProcessMachine()) +".exe"; +} + void IniDBBuilderPackage::buildVersion (const std::string& aVersion) { @@ -64,11 +70,9 @@ IniDBBuilderPackage::buildVersion (const std::string& aVersion) { char old_vers[256]; snprintf (old_vers, sizeof old_vers, - "The current ini file is from a newer version of setup-%s.exe. " - "If you have any trouble installing, please download a fresh " - "version from https://cygwin.com/setup-%s.exe", - is_64bit ? "x86_64" : "x86", - is_64bit ? "x86_64" : "x86"); + "A newer version of setup is available. " + "If you have any trouble installing, please download the latest " + "version from %s", setup_dl_url().c_str()); _feedback.warning(old_vers); } } @@ -82,10 +86,9 @@ IniDBBuilderPackage::buildMinimumVersion (const std::string& minimum) { char min_vers[256]; snprintf (min_vers, sizeof(min_vers), - "The current ini file requires at least version %s of setup.\n" - "Please download a newer version from https://cygwin.com/setup-%s.exe", - minimum.c_str(), - is_64bit ? "x86_64" : "x86"); + "At least version %s of setup is required.\n" + "Please download a newer version from %s", + minimum.c_str(), setup_dl_url().c_str()); return min_vers; } return ""; -- 2.11.4.GIT