public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-16-gd8a243b
@ 2022-02-04 10:54 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-02-04 10:54 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=d8a243b40247cc98f932244a4899497bb88dba1f

commit d8a243b40247cc98f932244a4899497bb88dba1f
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Thu Feb 3 20:17:09 2022 +0000

    Always apply upstream_version annotations
    
    process_relarea() constructs the package state ab inito, so we must
    retain the fetched data and reapply the package annotations on every
    call to annotate_packages().


Diff:
---
 calm/repology.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/calm/repology.py b/calm/repology.py
index 2e19aba..c4aa0a5 100644
--- a/calm/repology.py
+++ b/calm/repology.py
@@ -33,6 +33,7 @@ import urllib.request
 
 REPOLOGY_API_URL = 'https://repology.org/api/v1/projects/'
 last_check = 0
+last_data = {}
 
 
 def repology_fetch_versions():
@@ -83,10 +84,11 @@ def annotate_packages(args, packages):
     global last_check
     if (time.time() - last_check) < (24 * 60 * 60):
         logging.info("not consulting %s due to ratelimit" % (REPOLOGY_API_URL))
-        return
+    else:
+        logging.info("consulting %s" % (REPOLOGY_API_URL))
+        last_data = repology_fetch_versions()
 
-    logging.info("consulting %s" % (REPOLOGY_API_URL))
-    uv = repology_fetch_versions()
+    uv = last_data
 
     for pn in uv:
         spn = pn + '-src'



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-04 10:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 10:54 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-16-gd8a243b Jon TURNEY

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).