public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-16-gd8a243b
Date: Fri,  4 Feb 2022 10:54:25 +0000 (GMT)	[thread overview]
Message-ID: <20220204105425.896453858D20@sourceware.org> (raw)




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'



                 reply	other threads:[~2022-02-04 10:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220204105425.896453858D20@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /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).