Make sure we check for the newest version, if performing an egg install
without an explicitly given version. See also #1802.


felix
From 90113bde332cf6b5b37ae0043390a181eb665b29 Mon Sep 17 00:00:00 2001
From: felix <[email protected]>
Date: Fri, 21 Oct 2022 12:20:47 +0200
Subject: [PATCH] Fix update logic for eggs without given version.

Make sure to check servers for newest available version.
See also #1802.

Signed-off-by: felix <[email protected]>
---
 chicken-install.scm | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/chicken-install.scm b/chicken-install.scm
index 524cf0a1..14333ce4 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -447,12 +447,11 @@
                          (and (file-exists? vfile)
                               (with-input-from-file vfile read)))))
       (cond ((and (not cached-only)
-                  (or (and (string? version)
-                           (not (equal? version lversion)))
-                      (and (or (not (file-exists? tfile))
-                               (> (- now (with-input-from-file tfile read))
-                                  +one-hour+))
-                           (not (check-remote-version name lversion cached)))))
+                  (if (string? version)
+                      (not (equal? version lversion))
+                      (or (and (file-exists? tfile)
+                               (> (- now (with-input-from-file tfile read)) 
+one-hour+))
+                          (not (check-remote-version name lversion cached)))))
              (d "version of ~a out of date~%" name)
              (fetch #t)
              (let* ((info (validate-egg-info (load-egg-info eggfile))) ; new 
egg info (fetched)
-- 
2.28.0

Reply via email to