aboutsummaryrefslogtreecommitdiff
blob: 2e9deac720273311abd53229a5f0553fa9f76597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/python
#
# Copyright 2011 Corentin Chary <corentin.chary@gmail.com>
# Distributed under the terms of the GNU General Public License v2

__version__ = "git"

import ConfigParser
import os
from ast import literal_eval


CONFIG = {
    'nocolor': False,
    'quiet': False,
    'verbose': 1,
    'debug': False,
    'brute-force': 3,
    'brute-force-recursive': True,
    'brute-force-false-watermark': 50,
    'scan-dir': True,
    'oneshot': True,
    'user-agent': 'escan (http://euscan.iksaif.net)',
    'skip-robots-txt': False,
    'cache': False,
    'format': None,
    'indent': 2,
    'progress': False,
    'mirror': False,
    'ignore-pre-release': False,
    'ignore-pre-release-if-stable': False,
    'ebuild-uri': False,
    'handlers-exclude': [],
}

config = ConfigParser.ConfigParser()
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:
            CONFIG[key] = literal_eval(value)

BLACKLIST_VERSIONS = [
    # Compatibility package for running binaries linked against a
    # pre gcc 3.4 libstdc++, won't be updated
    '>=sys-libs/libstdc++-v3-3.4',
]

BLACKLIST_PACKAGES = [
    # These kernels are almost dead
    'sys-kernel/usermode-sources',
    'sys-kernel/xbox-sources',
    'sys-kernel/cell-sources',
]

SCANDIR_BLACKLIST_URLS = [
    'mirror://rubygems/(.*)',  # Not browsable
    'mirror://gentoo/(.*)'  # Directory too big
]

BRUTEFORCE_BLACKLIST_PACKAGES = [
    # infinite loop any
    # http://plone.org/products/plonepopoll/releases/*/plonepopoll-2-6-1.tgz
    # link will work
    'net-zope/plonepopoll'
]

BRUTEFORCE_BLACKLIST_URLS = [
    'http://(.*)dockapps.org/download.php/id/(.*)',  # infinite loop
    'http://hydra.nixos.org/build/(.*)',  # infinite loop
    # 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/(.*)',
]

ROBOTS_TXT_BLACKLIST_DOMAINS = [
    '(.*)sourceforge(.*)',
    '(.*)github.com',
    '(.*)berlios(.*)',
    '(.*)qt\.nokia\.com(.*)',
    '(.*)chromium\.org(.*)',
    '(.*)nodejs\.org(.*)',
    '(.*)download\.mono-project\.com(.*)',
    '(.*)fedorahosted\.org(.*)',
    '(.*)download\.tuxfamily\.org(.*)',
    '(.*)festvox\.org(.*)',
]

from out import EuscanOutput
output = EuscanOutput(CONFIG)