public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: "David Allsopp" <David.Allsopp@cl.cam.ac.uk>
To: <cygwin-apps@cygwin.com>
Subject: [PATCH setup] Add --allow-test-versions
Date: Tue, 20 Apr 2021 15:37:44 +0100	[thread overview]
Message-ID: <000001d735f2$b9f5a400$2de0ec00$@cl.cam.ac.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

Attached adds -t/--allow-test-packages to Setup which controls the initial
state of the "Test" checkbox.

Motivation is to allow one CI cron job to be installing test versions of
packages, then we can help identify things like [1] before they're released.


David


[1] https://cygwin.com/pipermail/cygwin/2021-April/248300.html

[-- Attachment #2: 0001-Add-allow-test-packages.patch --]
[-- Type: application/octet-stream, Size: 2023 bytes --]

From 8bcb46c490c05158566d2b8a650bdd82ba876aae Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Tue, 20 Apr 2021 15:23:52 +0100
Subject: [PATCH] Add --allow-test-packages

---
 choose.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/choose.cc b/choose.cc
index 4fa0c74..81a5d0d 100644
--- a/choose.cc
+++ b/choose.cc
@@ -63,6 +63,7 @@ static BoolOption UpgradeAlsoOption (false, 'g', "upgrade-also", "Also upgrade i
 static BoolOption CleanOrphansOption (false, 'o', "delete-orphans", "Remove orphaned packages");
 static BoolOption ForceCurrentOption (false, 'f', "force-current", "Select the current version for all packages");
 static BoolOption PruneInstallOption (false, 'Y', "prune-install", "Prune the installation to only the requested packages");
+static BoolOption AllowTestOption (false, 't', "allow-test-packages", "Permit installation of package versions marked test");
 
 extern ThreeBarProgressPage Progress;
 
@@ -165,7 +166,7 @@ ChooserPage::initialUpdateState()
   if (ForceCurrentOption)
     {
       update_mode_id = IDC_CHOOSE_SYNC;
-      changeTrust(update_mode_id, false, true);
+      changeTrust(update_mode_id, AllowTestOption, true);
     }
   else if (hasManualSelections && !UpgradeAlsoOption)
     {
@@ -176,7 +177,7 @@ ChooserPage::initialUpdateState()
   else
     {
       update_mode_id = IDC_CHOOSE_BEST;
-      changeTrust (update_mode_id, false, true);
+      changeTrust (update_mode_id, AllowTestOption, true);
     }
 
   static int ta[] = { IDC_CHOOSE_KEEP, IDC_CHOOSE_BEST, IDC_CHOOSE_SYNC, 0 };
@@ -251,6 +252,9 @@ ChooserPage::OnInit ()
 {
   CheckDlgButton (GetHWND (), IDC_CHOOSE_HIDE, BST_CHECKED);
 
+  if (AllowTestOption)
+    CheckDlgButton (GetHWND (), IDC_CHOOSE_EXP, BST_CHECKED);
+
   /* Populate view dropdown list with choices */
   HWND viewlist = GetDlgItem (IDC_CHOOSE_VIEW);
   SendMessage (viewlist, CB_RESETCONTENT, 0, 0);
-- 
2.29.2.windows.2


             reply	other threads:[~2021-04-20 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 14:37 David Allsopp [this message]
2021-04-23 13:00 ` Jon Turney
2021-04-23 13:11   ` David Allsopp
2021-04-26 11:49     ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000001d735f2$b9f5a400$2de0ec00$@cl.cam.ac.uk' \
    --to=david.allsopp@cl.cam.ac.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).