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" <cygwin-apps@cygwin.com>
Subject: RE: [PATCH setup] Add --allow-test-versions
Date: Fri, 23 Apr 2021 13:11:28 +0000	[thread overview]
Message-ID: <f8055c989efb4abf9de14ee65326999a@metastack.com> (raw)
In-Reply-To: <8164c0d2-ce49-034e-b295-258c7048f6c5@dronecode.org.uk>

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

Jon Turney wrote:
> On 20/04/2021 15:37, David Allsopp via Cygwin-apps wrote:
> > 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.
> 
> Nice.  Thanks.
> 
> > +static BoolOption AllowTestOption (false, 't', "allow-test-packages",
> > +"Permit installation of package versions marked test");
> 
> The only quibble I have is the help text here.  The user has always been
> permitted to choose test packages, this checkbox allows setup to decide to
> use them itself.
> 
> So maybe something like "Consider package versions marked test".

No problem - see attached.

All best,


David

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

From 6dd31c6881243f84e02e8d73bbc4f2d8ade3bbb4 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..5411e85 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", "Consider 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-23 13:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 14:37 David Allsopp
2021-04-23 13:00 ` Jon Turney
2021-04-23 13:11   ` David Allsopp [this message]
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=f8055c989efb4abf9de14ee65326999a@metastack.com \
    --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).