]> git.ipfire.org Git - people/jschlag/pbs.git/blob - backend/constants.py
Drop dependency on textile
[people/jschlag/pbs.git] / backend / constants.py
1 #!/usr/bin/python
2
3 import os.path
4
5 # Import all constants from the pakfire module.
6 from pakfire.constants import *
7
8 PAKFIRE_DIR = "/pakfire"
9 PACKAGES_DIR = os.path.join(PAKFIRE_DIR, "packages")
10 BUILD_RELEASE_DIR = os.path.join(PACKAGES_DIR, "release")
11 BUILD_SCRATCH_DIR = os.path.join(PACKAGES_DIR, "scratch")
12 REPOS_DIR = os.path.join(PAKFIRE_DIR, "repositories")
13 SOURCES_DIR = os.path.join(PAKFIRE_DIR, "sources")
14
15 UPLOADS_DIR = "/var/tmp/pakfire/uploads"
16
17 BUFFER_SIZE = 1024 * 100 # 100kb
18
19 BUGZILLA_PATTERN = r"(bug\s?|#)(\d+)"
20 CVE_PATTERN = r"(CVE)(\s|\-)(\d{4}\-\d{4})"
21
22 FILE_EXTENSIONS_VIEWABLE = (
23 ".c",
24 ".cc",
25 ".cfg",
26 ".conf",
27 ".config",
28 ".cpp",
29 ".diff",
30 ".h",
31 ".nm",
32 ".patch",
33 ".patch0",
34 ".patch1",
35 ".patch2",
36 ".patch3",
37 ".patch4",
38 ".patch5",
39 ".patch6",
40 ".patch7",
41 ".patch8",
42 ".patch9",
43 ".pl",
44 ".pm",
45 ".py",
46 ".S",
47 ".s",
48 ".sh",
49 ".txt",
50 "Kconfig",
51 "Makefile",
52 )
53
54 N_ = lambda x: x
55
56 MSG_BUILD_FAILED_SUBJECT = N_("[%(build_name)s] Build job failed.")
57 MSG_BUILD_FAILED = N_("""\
58 The build job "%(build_name)s" has failed.
59
60 This could have a couple of reasons and needs to be investigated by you.
61
62 Here is more information about the incident:
63
64 Build name: %(build_name)s
65 Build host: %(build_host)s
66
67 Click on this link to get all details about the build:
68 https://pakfire.ipfire.org/job/%(build_uuid)s
69
70 Sincerely,
71 The Pakfire Build Service""")
72
73
74 MSG_BUILD_FINISHED_SUBJECT = N_("[%(build_name)s] Build job finished.")
75 MSG_BUILD_FINISHED = N_("""\
76 The build job "%(build_name)s" has finished.
77
78 If you are the maintainer, it is up to you to push it to one or more repositories.
79
80 Click on this link to get all details about the build:
81 https://pakfire.ipfire.org/job/%(build_uuid)s
82
83 Sincerely,
84 The Pakfire Build Service""")
85
86 # Bug update messages.
87 BUG_TESTING_MSG = """\
88 %(package_name)s has been pushed to the %(distro_name)s %(repo_name)s repository.
89
90 You can provide feedback for this build here:
91 %(build_url)s"""
92
93 BUG_UNSTABLE_MSG = """\
94 %(package_name)s has been pushed to the %(distro_name)s %(repo_name)s repository.
95
96 You can provide feedback for this build here:
97 %(build_url)s"""
98
99 BUG_STABLE_MSG = """\
100 %(package_name)s has been pushed to the %(distro_name)s %(repo_name)s repository.
101
102 If problems still persist, please make note of it in this bug report."""
103
104 BUG_MESSAGES = {
105 "testing" : {
106 "status" : "MODIFIED",
107 "comment" : BUG_TESTING_MSG,
108 },
109
110 "unstable" : {
111 "status" : "ON_QA",
112 "comment" : BUG_UNSTABLE_MSG,
113 },
114
115 "stable" : {
116 "status" : "CLOSED", "resolution" : "FIXED",
117 "comment" : BUG_STABLE_MSG,
118 },
119 }