2011-08-31 15:38:32 +02:00
|
|
|
# Copyright 2011 Corentin Chary <corentin.chary@gmail.com>
|
2023-11-15 21:31:08 +01:00
|
|
|
# Copyright 2020-2023 src_prepare group
|
2011-08-31 15:38:32 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2019-12-05 17:46:19 +01:00
|
|
|
import configparser
|
2012-09-02 18:58:01 +02:00
|
|
|
import os
|
2012-09-14 11:33:57 +02:00
|
|
|
from ast import literal_eval
|
2012-09-02 18:58:01 +02:00
|
|
|
|
2011-08-31 15:38:32 +02:00
|
|
|
CONFIG = {
|
|
|
|
"nocolor": False,
|
|
|
|
"quiet": False,
|
2011-09-21 10:09:50 +02:00
|
|
|
"verbose": 1,
|
2011-08-31 15:38:32 +02:00
|
|
|
"debug": False,
|
|
|
|
"brute-force": 3,
|
|
|
|
"brute-force-recursive": True,
|
2011-09-21 10:09:50 +02:00
|
|
|
"brute-force-false-watermark": 50,
|
2011-08-31 15:38:32 +02:00
|
|
|
"scan-dir": True,
|
2011-10-08 08:33:03 +02:00
|
|
|
"oneshot": True,
|
2023-11-16 00:14:05 +01:00
|
|
|
"user-agent": "euscan-ng (https://gitlab.com/src_prepare/euscan-ng)",
|
2012-04-28 18:16:05 +02:00
|
|
|
"skip-robots-txt": False,
|
2012-05-21 22:24:44 +02:00
|
|
|
"cache": False,
|
|
|
|
"format": None,
|
2012-06-28 12:20:57 +02:00
|
|
|
"indent": 2,
|
2012-07-02 17:44:55 +02:00
|
|
|
"progress": False,
|
|
|
|
"mirror": False,
|
2012-07-17 12:27:22 +02:00
|
|
|
"ignore-pre-release": False,
|
|
|
|
"ignore-pre-release-if-stable": False,
|
2012-07-20 08:22:52 +02:00
|
|
|
"ebuild-uri": False,
|
2012-09-14 11:33:57 +02:00
|
|
|
"handlers-exclude": [],
|
2011-08-31 15:38:32 +02:00
|
|
|
}
|
|
|
|
|
2019-12-05 17:46:19 +01:00
|
|
|
config = configparser.ConfigParser()
|
2012-09-02 18:58:01 +02:00
|
|
|
config.read(["/etc/euscan.conf", os.path.expanduser("~/.euscan.conf")])
|
|
|
|
if config.has_section("euscan"):
|
|
|
|
for key, value in config.items("euscan"):
|
|
|
|
if key in CONFIG:
|
2012-09-14 11:33:57 +02:00
|
|
|
CONFIG[key] = literal_eval(value)
|
2012-09-02 18:58:01 +02:00
|
|
|
|
2011-08-31 15:38:32 +02:00
|
|
|
BLACKLIST_VERSIONS = [
|
2012-04-28 18:16:05 +02:00
|
|
|
# Compatibility package for running binaries linked against a
|
|
|
|
# pre gcc 3.4 libstdc++, won't be updated
|
2012-02-20 08:20:54 +01:00
|
|
|
">=sys-libs/libstdc++-v3-3.4",
|
2019-12-05 19:03:49 +01:00
|
|
|
# Actually older or incorrect
|
|
|
|
"~app-backup/backup-manager-0.7.15",
|
|
|
|
"=x11-plugins/wmacpimon-001",
|
2011-08-31 15:38:32 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
BLACKLIST_PACKAGES = [
|
2012-02-20 08:20:54 +01:00
|
|
|
# These kernels are almost dead
|
|
|
|
"sys-kernel/xbox-sources",
|
2011-08-31 15:38:32 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
SCANDIR_BLACKLIST_URLS = [
|
2024-03-03 18:59:34 +01:00
|
|
|
"https://rubygems.org/(.*)", # Not browsable
|
2012-04-28 18:16:05 +02:00
|
|
|
"mirror://gentoo/(.*)", # Directory too big
|
2024-03-02 19:40:53 +01:00
|
|
|
"https://dev.gentoo.org/(.*)", # There shouldn't be releases here
|
|
|
|
# Waste of time to go through
|
|
|
|
"https://crates.io/(.*)",
|
|
|
|
"https://api.nuget.org/(.*)",
|
|
|
|
"https://myget.org/(.*)",
|
2011-08-31 15:38:32 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
BRUTEFORCE_BLACKLIST_PACKAGES = [
|
2012-04-28 18:16:05 +02:00
|
|
|
# infinite loop any
|
|
|
|
# http://plone.org/products/plonepopoll/releases/*/plonepopoll-2-6-1.tgz
|
|
|
|
# link will work
|
|
|
|
"net-zope/plonepopoll"
|
2011-09-21 10:09:50 +02:00
|
|
|
]
|
2011-08-31 15:38:32 +02:00
|
|
|
|
|
|
|
BRUTEFORCE_BLACKLIST_URLS = [
|
2012-04-28 18:16:05 +02:00
|
|
|
"http://hydra.nixos.org/build/(.*)", # infinite loop
|
2012-05-23 16:30:43 +02:00
|
|
|
# Doesn't respect 404, infinite loop
|
|
|
|
"http://www.rennings.net/gentoo/distfiles/(.*)",
|
|
|
|
"http://art.gnome.org/download/(.*)",
|
|
|
|
"http://barelysufficient.org/~olemarkus/(.*)",
|
|
|
|
"http://olemarkus.org/~olemarkus/(.*)",
|
2011-09-21 10:09:50 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
ROBOTS_TXT_BLACKLIST_DOMAINS = [
|
|
|
|
"(.*)sourceforge(.*)",
|
|
|
|
"(.*)github.com",
|
2023-11-16 04:10:40 +01:00
|
|
|
r"(.*)qt\.nokia\.com(.*)",
|
|
|
|
r"(.*)chromium\.org(.*)",
|
|
|
|
r"(.*)nodejs\.org(.*)",
|
|
|
|
r"(.*)download\.mono-project\.com(.*)",
|
|
|
|
r"(.*)fedorahosted\.org(.*)",
|
|
|
|
r"(.*)download\.tuxfamily\.org(.*)",
|
|
|
|
r"(.*)festvox\.org(.*)",
|
2011-08-31 15:38:32 +02:00
|
|
|
]
|
2012-05-21 22:24:44 +02:00
|
|
|
|
2023-11-14 22:43:04 +01:00
|
|
|
from euscan.out import EuscanOutput # noqa: E402
|
2023-11-14 22:03:53 +01:00
|
|
|
|
2012-05-31 18:42:37 +02:00
|
|
|
output = EuscanOutput(CONFIG)
|