public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-apps@cygwin.com
Subject: [PATCH setup] Ignore reinstall requests if version is not accessible
Date: Sun, 11 Dec 2022 16:11:02 +0100	[thread overview]
Message-ID: <e73cfc51-d883-1176-2fb7-5f3b30562a62@t-online.de> (raw)

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

This prevents accidental package loss if reinstall is run from local 
directory but the package is no longer cached.

Possible further improvement: Do not offer "Reinstall" in the popup menu 
in this case.

-- 
Regards,
Christian


[-- Attachment #2: 0001-Ignore-reinstall-requests-if-version-is-not-accessib.patch --]
[-- Type: text/plain, Size: 717 bytes --]

From 054697c297a3e21ee5e63f51b27431640cab5cde Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Sun, 11 Dec 2022 15:55:47 +0100
Subject: [PATCH] Ignore reinstall requests if version is not accessible

---
 package_meta.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package_meta.cc b/package_meta.cc
index 2257b59..3daa970 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -672,7 +672,7 @@ packagemeta::set_action (_actions action, packageversion const &default_version,
   else if (action == Reinstall_action)
     {
       desired = installed;
-      if (desired)
+      if (desired.accessible ())
 	{
 	  pick (true);
 	  srcpick (false);
-- 
2.38.1


             reply	other threads:[~2022-12-11 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11 15:11 Christian Franke [this message]
2022-12-15 17:39 ` Jon Turney
2022-12-16 15:40   ` Christian Franke
2022-12-17 17:00     ` 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=e73cfc51-d883-1176-2fb7-5f3b30562a62@t-online.de \
    --to=christian.franke@t-online.de \
    --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).