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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
#!/usr/bin/python
# Copyright (c) 2016 Samsung Electronics Co., Ltd
#
# Licensed under the Flora License, Version 1.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://floralicense.org/license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Contributors:
# - S-Core Co., Ltd
import re
import logging
from lxml import etree
from tic.utils.error import TICError
from tic.utils.rpmmisc import archPolicies, default_arch
from tic.config import configmgr
# meta pkg
META_PREFIX = configmgr.regularexp['meta_prefix']
META_PREFIX_ROOT = configmgr.regularexp['meta_prefix_root']
META_PREFIX_SUB1 = configmgr.regularexp['meta_prefix_sub1']
META_PATTERN = re.compile(''.join(['^', META_PREFIX, configmgr.regularexp['meta_pattern']]), re.I)
META_SUB1_PATTERN = re.compile(configmgr.regularexp['meta_sub1_pattern'])
META_SUB2_PATTERN = re.compile(configmgr.regularexp['meta_sub2_pattern'])
# profile pkg
PROFILE_PATTERN = re.compile(configmgr.regularexp['profile_pattern'])
class RepodataParser(object):
def __init__(self, arch, repodata_list):
self.arch = arch
self.repodata_list = repodata_list
def _xml_parse(self, pkg_group, pkg_list, tag_dic):
def _set_version(element, tag):
if 'ver' in tag.attrib:
element['ver'] = tag.attrib['ver']
if 'rel' in tag.attrib:
element['rel'] = tag.attrib['rel']
if 'epoch' in tag.attrib:
element['epoch'] = tag.attrib['epoch']
if 'flags' in tag.attrib:
element['flags'] = tag.attrib['flags']
pkg_dict = pkg_group.get('pkg_dict')
provides_dict = pkg_group.get('provides')
files_dict = pkg_group.get('files')
meta_info = pkg_group.get('meta_info')
pkg_id = len(pkg_dict)
for pkg in pkg_list:
pkg_name = pkg.findtext(tag_dic['name'])
# check whether a package is duplicated.
if pkg_name in pkg_dict:
# TODO: Apply to policy of duplication
# logger.warning('package(%s) is duplicated. exclude this package', pkg_name)
continue
pkg_info = {}
pkg_info['id'] = pkg_id
pkg_info['name'] = pkg_name
pkg_info['arch'] = pkg.findtext(tag_dic['arch'])
pkg_info['summary'] = pkg.findtext(tag_dic['summary'])
pkg_info['selfChecked'] = False # for web-ui tree
# Parsing meta-pkg using meta naming rule
meta_match = META_PATTERN.search(pkg_info['name'])
if meta_match is not None:
if meta_match.group('meta') == 'root':
meta_info['root'].append([pkg_info['name'], pkg_info['summary']])
pkg_info['meta'] = 'root'
elif meta_match.group('meta') == 'sub1':
sub1_match = META_SUB1_PATTERN.search(meta_match.group('pkgname'))
meta_info['sub1'].append([pkg_info['name'],
''.join([META_PREFIX_ROOT, sub1_match.group('root')]),
pkg_info['summary']])
pkg_info['meta'] = 'sub1'
elif meta_match.group('meta') == 'sub2':
sub2_match = META_SUB2_PATTERN.search(meta_match.group('pkgname'))
meta_info['sub2'].append([pkg_info['name'],
''.join([META_PREFIX_ROOT, sub2_match.group('root')]),
''.join([META_PREFIX_SUB1, sub2_match.group('root'),'-', sub2_match.group('sub1')]),
pkg_info['summary']])
pkg_info['meta'] = 'sub2'
elif meta_match.group('meta') == 'category':
pkg_info['meta'] = 'category'
# 0: pkg_name, 1: category_name
meta_info['category'].append([pkg_info['name'], meta_match.group('pkgname')])
else:
# building-blocks.rpm, etc...
pkg_info['meta'] = 'etc'
# check profile pkg
profile_match = PROFILE_PATTERN.search(pkg_info['name']);
if profile_match and profile_match.group('profile'):
pkg_info['profile'] = profile_match.group('profile')
else:
pkg_info['profile'] = None
ver_tag = pkg.find(tag_dic['version'])
pkg_info['version'] = {'epoch':ver_tag.attrib['epoch'],
'ver':ver_tag.attrib['ver'],
'rel':ver_tag.attrib['rel']}
pkg_info['checksum'] = pkg.findtext(tag_dic['checksum'])
pkg_info['description'] = pkg.findtext(tag_dic['description'])
pkg_info['location'] = pkg.find(tag_dic['location']).attrib['href']
size_tag = pkg.find(tag_dic['size'])
pkg_info['size'] = size_tag.attrib['package']
pkg_info['installed'] = size_tag.attrib['installed']
format_tag = pkg.find(tag_dic['format'])
if(format_tag is not None):
requires_tag = format_tag.find(tag_dic['requires'])
if requires_tag is not None:
dep_list = []
for rpm in requires_tag:
require = dict(name= rpm.attrib['name'])
_set_version(require, rpm)
dep_list.append(require)
pkg_info['requires'] = dep_list
provides_tag = format_tag.find(tag_dic['provides'])
if provides_tag is not None:
dep_list = []
for rpm in provides_tag:
provide = dict(name= rpm.attrib['name'])
_set_version(provide, rpm)
if provide.get('ver') and not provide.get('rel') and pkg_info['version']['rel']:
provide['rel'] = pkg_info['version']['rel']
if rpm.attrib['name'] in provides_dict:
provides_dict[rpm.attrib['name']].append({'name': pkg_name, 'data': provide})
else:
provides_dict[rpm.attrib['name']] = [{'name': pkg_name, 'data': provide}]
dep_list.append(provide)
pkg_info['provides'] = dep_list
conflicts_tag = format_tag.find(tag_dic['conflicts'])
if conflicts_tag is not None:
dep_list = []
for rpm in conflicts_tag:
conflict = dict(name= rpm.attrib['name'])
_set_version(conflict, rpm)
dep_list.append(conflict)
pkg_info['conflicts'] = dep_list
recommends_tag = format_tag.find(tag_dic['recommends'])
if recommends_tag is not None:
dep_list = []
for rpm in recommends_tag:
recommend = dict(name=rpm.attrib['name'])
_set_version(recommend, rpm)
dep_list.append(recommend)
pkg_info['recommends'] = dep_list
suggests_tag = format_tag.find(tag_dic['suggests'])
if suggests_tag is not None:
dep_list = []
for rpm in suggests_tag:
suggests = dict(name= rpm.attrib['name'])
dep_list.append(suggests)
pkg_info['suggests'] = dep_list
file_tag = format_tag.find(tag_dic['file'])
if file_tag is not None:
dep_list = []
for file_t in format_tag.findall(tag_dic['file']):
if file_t.text in files_dict:
files_dict[file_t.text].append(pkg_name)
else:
files_dict[file_t.text] = [pkg_name]
dep_list.append(file_t.text)
pkg_info['file'] = dep_list
pkg_dict[pkg_name] = pkg_info
pkg_id += 1
def _prepare_requires_id(self, pkg_group):
logger = logging.getLogger(__name__)
pkg_list = pkg_group.get('pkg_list')
pkg2id = pkg_group.get('pkg2id')
provides2id = pkg_group.get('provides2id')
file2id = pkg_group.get('file2id')
for pkg_id in range(len(pkg_list)):
requires = pkg_list[pkg_id].get('requires')
if requires is not None:
for req_info in requires:
req_name = req_info['name']
#TODO: Determine dependency search order
if req_name in provides2id:
#TODO: Select a package in provides (version?)
req_info['id'] = provides2id[req_name][0]['id']
elif req_name in pkg2id:
req_info['id'] = pkg2id[req_name]
elif req_name in file2id:
req_info['id'] = file2id[req_name][0]['id']
else:
#TODO: Exception Check
# the dependent package does not exist.
logger.warning('"%s" required by "%s" does not exist.', req_name, pkg_list[pkg_id].get('name'))
def _get_tagname(self, root):
tags = {}
# xmlns = re.sub('metadata$', '', root.tag)
tags['metadata'] = '{%s}metadata' % root.nsmap[None]
tags['package'] = '{%s}package' % root.nsmap[None]
tags['name'] = '{%s}name' % root.nsmap[None]
tags['arch'] = '{%s}arch' % root.nsmap[None]
tags['version'] = '{%s}version' % root.nsmap[None]
tags['checksum'] = '{%s}checksum' % root.nsmap[None]
tags['summary'] = '{%s}summary' % root.nsmap[None]
tags['description'] = '{%s}description' % root.nsmap[None]
tags['location'] = '{%s}location' % root.nsmap[None]
tags['size'] = '{%s}size' % root.nsmap[None]
tags['format'] = '{%s}format' % root.nsmap[None]
tags['requires'] = '{%s}requires' % root.nsmap['rpm']
tags['provides'] = '{%s}provides' % root.nsmap['rpm']
tags['conflicts'] = '{%s}conflicts' % root.nsmap['rpm']
tags['suggests'] = '{%s}suggests' % root.nsmap['rpm']
tags['recommends'] = '{%s}recommends' % root.nsmap['rpm']
tags['file'] = '{%s}file' % root.nsmap[None]
return tags
def _filtering_data_based_arch(self, xml_list, tag_dic):
ret_list = []
for xml_root in xml_list:
pkg_data = {}
for pkg_elm in xml_root.findall(tag_dic['package']):
pkg_arch = pkg_elm.findtext(tag_dic['arch'])
if pkg_arch not in archPolicies[self.arch] and pkg_arch not in default_arch:
continue;
if not pkg_data.get(pkg_arch):
pkg_data[pkg_arch] = []
pkg_data[pkg_arch].append(pkg_elm)
ret_list.append(pkg_data)
return ret_list
def parse(self):
logger = logging.getLogger(__name__)
if not self.repodata_list:
return None
xml_list = []
try:
for repodata in self.repodata_list:
tree = etree.parse(repodata['primary'])
xml_list.append(tree.getroot())
except etree.XMLSyntaxError as e:
logger.info(e)
raise TICError(configmgr.message['xml_parse_error'] % ('primary', repodata['baseurl']))
tag_dic = self._get_tagname(xml_list[0])
# TODO: temporary code (should be deleted)
#meta_string='<?xml version="1.0" encoding="UTF-8"?><metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="1467"><package type="rpm"><name>building-blocks-category-domains</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>Simple DirectMedia Layer</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:suggests><rpm:entry name="building-blocks-root-metapkg" /></rpm:suggests></format></package><package type="rpm"><name>building-blocks-category-presets</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>Simple DirectMedia Layer</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:suggests><rpm:entry name="building-blocks-root-metapkg2" /></rpm:suggests></format></package><package type="rpm"><name>building-blocks-root-metapkg2</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>Meta root pkg2</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /></format></package><package type="rpm"><name>building-blocks-root-metapkg</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>Meta root pkg1</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:requires><rpm:entry name="building-blocks-sub1-metapkg-extsub1" /><rpm:entry name="building-blocks-sub1-metapkg-extsub2" /></rpm:requires></format></package><package type="rpm"><name>building-blocks-sub1-metapkg-extsub1</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>sub1-extension</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:requires><rpm:entry name="building-blocks-sub2-metapkg-extsub1-exts1sub1" /></rpm:requires></format></package><package type="rpm"><name>building-blocks-sub2-metapkg-extsub1-exts1sub1</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>sub2-extension</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:conflicts><rpm:entry name="building-blocks-sub2-metapkg-extsub1-exts1sub2" /></rpm:conflicts></format></package><package type="rpm"><name>building-blocks-sub2-metapkg-extsub1-exts1sub2</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>sub2-extension</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:conflicts><rpm:entry name="building-blocks-sub2-metapkg-extsub1-exts1sub1" /></rpm:conflicts></format></package><package type="rpm"><name>building-blocks-sub1-metapkg-extsub2</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>sub1-extension</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:requires><rpm:entry name="building-blocks-sub2-metapkg-extsub2-exts2sub1" /><rpm:entry name="SDL2" /></rpm:requires></format></package><package type="rpm"><name>building-blocks-sub2-metapkg-extsub2-exts2sub1</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>sub2-extension</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /></format></package><package type="rpm"><name>building-blocks-sub2-metapkg-extsub2-exts2sub2</name><arch>armv7l</arch><version epoch="0" ver="2.0.4" rel="4.2" vcs="platform/upstream/SDL#5f9405ba696ad79a0e05150430fe69e874f8280d" /><checksum type="sha256" pkgid="YES">6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcf</checksum><summary>sub2-extension</summary><description>This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</description><packager /><url>http://www.libsdl.org/</url><time file="1476718677" build="1476718668" /><size package="264245" installed="956696" archive="957124" /><location href="armv7l/SDL2-2.0.4-4.2.armv7l.rpm" /><format><rpm:license>Zlib and SGI-B-2.0</rpm:license><rpm:vendor>tizen</rpm:vendor><rpm:group>System Environment/Libraries</rpm:group><rpm:buildhost>w36</rpm:buildhost><rpm:sourcerpm>SDL2-2.0.4-4.2.src.rpm</rpm:sourcerpm><rpm:header-range start="280" end="5958" /><rpm:requires><rpm:entry name="SDL2" /></rpm:requires></format></package></metadata>'
#xml_list.append(etree.fromstring(meta_string))
filter_data = self._filtering_data_based_arch(xml_list, tag_dic)
pkg_group = dict(pkg_dict={},
provides={},
files={},
groups={},
conflicts={},
meta_info=dict(root=[], sub1=[], sub2=[], category=[]))
# parses the repodata (primary.xml)
# for xml_root in xml_list:
# self._xml_parse(pkg_group, xml_root, tag_dic)
for xml_data in filter_data:
for arch in archPolicies[self.arch]:
if arch in xml_data:
self._xml_parse(pkg_group, xml_data[arch], tag_dic)
# noarch, src
for arch in default_arch:
if arch in xml_data:
self._xml_parse(pkg_group, xml_data[arch], tag_dic)
# set the requires id
#self._prepare_requires_id(pkg_group)
return pkg_group
|