models.py 5 KB
Newer Older
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
from typing import List, Optional

from pydantic import BaseModel


class Base(BaseModel):
    """A model describing the %BASE% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    base: str


class Version(BaseModel):
    """A model describing the %VERSION% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    version: str


class MakeDepends(BaseModel):
    """A model describing the %MAKEDEPENDS% header in a 'desc' file, which type it represents and whether it is required
    or not"""

    makedepends: Optional[List[str]]


class CheckDepends(BaseModel):
    """A model describing the %CHECKDEPENDS% header in a 'desc' file, which type it represents and whether it is
    required or not"""

    checkdepends: Optional[List[str]]


class FileName(BaseModel):
    """A model describing the %FILENAME% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    filename: str


class Name(BaseModel):
    """A model describing the %NAME% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    name: str


class Desc(BaseModel):
    """A model describing the %DESC% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    desc: str


class Groups(BaseModel):
    """A model describing the %GROUPS% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    groups: Optional[List[str]]


class CSize(BaseModel):
    """A model describing the %CSIZE% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    csize: int


class ISize(BaseModel):
    """A model describing the %ISIZE% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    isize: int


class Md5Sum(BaseModel):
    """A model describing the %MD5SUM% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    md5sum: str


class Sha256Sum(BaseModel):
    """A model describing the %SHA256SUM% header in a 'desc' file, which type it represents and whether it is required
    or not"""

    sha256sum: str


class PgpSig(BaseModel):
    """A model describing the %PGPSIG% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    pgpsig: str


class Url(BaseModel):
    """A model describing the %URL% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    url: str


class License(BaseModel):
    """A model describing the %LICENSE% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    licenses: List[str]


class Arch(BaseModel):
    """A model describing the %ARCH% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    arch: str


class BuildDate(BaseModel):
    """A model describing the %BUILDDATE% header in a 'desc' file, which type it represents and whether it is required
    or not"""

    builddate: int


class Packager(BaseModel):
    """A model describing the %PACKAGER% header in a 'desc' file, which type it represents and whether it is required
    or not"""

    packager: str


class Replaces(BaseModel):
    """A model describing the %REPLACES% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    replaces: Optional[List[str]]


class Conflicts(BaseModel):
    """A model describing the %CONFLICTS% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    conflicts: Optional[List[str]]


class Provides(BaseModel):
    """A model describing the %PROVIDES% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    provides: Optional[List[str]]


class Depends(BaseModel):
    """A model describing the %DEPENDS% header in a 'desc' file, which type it represents and whether it is required or
    not"""

    depends: Optional[List[str]]


class OptDepends(BaseModel):
    """A model describing the %OPTDEPENDS% header in a 'desc' file, which type it represents and whether it is required
    or not"""

    optdepends: Optional[List[str]]


class Backup(BaseModel):
    """A model describing the %BACKUP% header in a 'desc' file, which type it represents and whether it is required
    or not"""

    backup: Optional[List[str]]


class Files(BaseModel):
    """A model describing the %FILES% header in a 'files' file, which type it represents and whether it is required or
    not"""

    files: Optional[List[str]]


class PackageDesc(
    Arch,
    Backup,
    Base,
    BuildDate,
    Conflicts,
    CSize,
    Depends,
    Desc,
    CheckDepends,
    FileName,
    Groups,
    ISize,
    License,
    MakeDepends,
    Md5Sum,
    Name,
    OptDepends,
    Packager,
    PgpSig,
    Provides,
    Replaces,
    Sha256Sum,
    Url,
    Version,
):
    """A model describing all headers in a 'desc' file, which type they represent and whether they are required or
    not"""

    pass