diff --git a/pkgcrap/outdated_check.py b/pkgcrap/outdated_check.py index b1f4406..eab24d9 100644 --- a/pkgcrap/outdated_check.py +++ b/pkgcrap/outdated_check.py @@ -4,7 +4,7 @@ import urllib.request import pkgcrap.parse as parse import json -from pkgcrap.util import maintained_packages_get +from pkgcrap.util import blacklisted_tags_get, maintained_packages_get from functools import cmp_to_key from libversion import version_compare @@ -58,6 +58,7 @@ def repos_from_pkg(pkg): return [repo for repo in repos if repo != None] def repo_get_latest_git(uri, pkg, verbose): + global blacklisted_tags try: r = urllib.request.urlopen(uri+'/info/refs?service=git-upload-pack') except urllib.error.HTTPError: @@ -66,9 +67,13 @@ def repo_get_latest_git(uri, pkg, verbose): return None tags = [] for line in reversed(r.read().decode('utf-8').split("\n")): + if line[4:44] in blacklisted_tags: + continue line = line.split(' ')[-1].split("\t")[-1] if line[:10] == 'refs/tags/' and line[-3:] != '^{}': tag = line[10:] + if tag in blacklisted_tags: + continue if tag.startswith(pkg.name): tag = tag[len(pkg.name):] if tag.startswith('version'): @@ -130,6 +135,8 @@ def main(args): else: packages = [parse.package.from_path('.')] verbose = True + global blacklisted_tags + blacklisted_tags = blacklisted_tags_get() for pkg in packages: pkg.load() outdated_check(pkg, verbose=verbose) diff --git a/pkgcrap/util.py b/pkgcrap/util.py index 197cca9..8c23d69 100644 --- a/pkgcrap/util.py +++ b/pkgcrap/util.py @@ -34,3 +34,12 @@ def maintained_packages_get(): cat.load() packages.append(cat.packages[pkg_info[1]]) return packages + +def blacklisted_tags_get(): + blacklisted_tags = [] + with open(conf_file_path('eviltags.txt'), 'r') as fp: + for line in fp.read().split('\n'): + if len(line) > 0 and line[0] == '#': + continue + blacklisted_tags.append(line.split(' ',1)[0]) + return blacklisted_tags