mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-27 00:52:12 +00:00
fix exception when AUR package disappears
This commit is contained in:
parent
dbc35aa901
commit
16ef913b88
@ -46,6 +46,10 @@ def write_verfile():
|
||||
util.write_verfile(args.newver, g_curver)
|
||||
|
||||
def print_version_update(name, version):
|
||||
if version is None:
|
||||
task_dec()
|
||||
return
|
||||
|
||||
oldver = g_oldver.get(name, None)
|
||||
if not oldver or parse_version(oldver) < parse_version(version):
|
||||
logger.info('%s: updated version %s', name, version)
|
||||
|
@ -1,10 +1,13 @@
|
||||
from functools import partial
|
||||
import json
|
||||
import logging
|
||||
|
||||
from tornado.httpclient import AsyncHTTPClient
|
||||
|
||||
AUR_URL = 'https://aur.archlinux.org/rpc.php?type=info&arg='
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def get_version(name, conf, callback):
|
||||
aurname = conf.get('aur') or name
|
||||
url = AUR_URL + aurname
|
||||
@ -12,5 +15,11 @@ def get_version(name, conf, callback):
|
||||
|
||||
def _aur_done(name, callback, res):
|
||||
data = json.loads(res.body.decode('utf-8'))
|
||||
|
||||
if not data['results']:
|
||||
logger.error('AUR upstream not found for %s', name)
|
||||
callback(name, None)
|
||||
return
|
||||
|
||||
version = data['results']['Version']
|
||||
callback(name, version)
|
||||
|
Loading…
Reference in New Issue
Block a user