From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 896453858D20; Fri, 4 Feb 2022 10:54:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 896453858D20 To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-16-gd8a243b X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 3e8e10f195747de3bff5d32bc6b2d1cd67fb9b6c X-Git-Newrev: d8a243b40247cc98f932244a4899497bb88dba1f Message-Id: <20220204105425.896453858D20@sourceware.org> Date: Fri, 4 Feb 2022 10:54:25 +0000 (GMT) From: Jon TURNEY X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2022 10:54:25 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=d8a243b40247cc98f932244a4899497bb88dba1f commit d8a243b40247cc98f932244a4899497bb88dba1f Author: Jon Turney 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'