[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-16-gd8a243b

Jon TURNEY via Cygwin-apps-cvs <[email protected]>
Newsgroups gmane.os.cygwin.cvs.apps
Message-ID <[email protected]>


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

commit d8a243b40247cc98f932244a4899497bb88dba1f
Author: Jon Turney <[email protected]>
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'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.