X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tic%2Fparser%2Frepo_parser.py;h=25a7ac0b74960b2fc8f54d793ca5769fa4bfdfbb;hb=refs%2Fchanges%2F94%2F123494%2F1;hp=2ee2c8ea1adaddb53ffae6e6f81bfa6c86d7e68b;hpb=9647f5cea675046d07d94caff1e7725c06ceee9b;p=archive%2F20170607%2Ftools%2Ftic-core.git
diff --git a/tic/parser/repo_parser.py b/tic/parser/repo_parser.py
index 2ee2c8e..25a7ac0 100644
--- a/tic/parser/repo_parser.py
+++ b/tic/parser/repo_parser.py
@@ -75,7 +75,6 @@ class RepodataParser(object):
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:
@@ -95,6 +94,13 @@ class RepodataParser(object):
''.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']);
@@ -123,7 +129,7 @@ class RepodataParser(object):
require = dict(name= rpm.attrib['name'])
_set_version(require, rpm)
dep_list.append(require)
- pkg_info['requires'] = dep_list;
+ pkg_info['requires'] = dep_list
provides_tag = format_tag.find(tag_dic['provides'])
if provides_tag is not None:
dep_list = []
@@ -131,14 +137,14 @@ class RepodataParser(object):
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'];
+ 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;
+ pkg_info['provides'] = dep_list
conflicts_tag = format_tag.find(tag_dic['conflicts'])
if conflicts_tag is not None:
dep_list = []
@@ -146,7 +152,7 @@ class RepodataParser(object):
conflict = dict(name= rpm.attrib['name'])
_set_version(conflict, rpm)
dep_list.append(conflict)
- pkg_info['conflicts'] = dep_list;
+ pkg_info['conflicts'] = dep_list
recommends_tag = format_tag.find(tag_dic['recommends'])
if recommends_tag is not None:
dep_list = []
@@ -154,14 +160,14 @@ class RepodataParser(object):
recommend = dict(name=rpm.attrib['name'])
_set_version(recommend, rpm)
dep_list.append(recommend)
- pkg_info['recommends'] = dep_list;
+ 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;
+ pkg_info['suggests'] = dep_list
file_tag = format_tag.find(tag_dic['file'])
if file_tag is not None:
dep_list = []
@@ -171,7 +177,7 @@ class RepodataParser(object):
else:
files_dict[file_t.text] = [pkg_name]
dep_list.append(file_t.text)
- pkg_info['file'] = dep_list;
+ pkg_info['file'] = dep_list
pkg_dict[pkg_name] = pkg_info
pkg_id += 1
@@ -253,8 +259,8 @@ class RepodataParser(object):
tag_dic = self._get_tagname(xml_list[0])
# TODO: temporary code (should be deleted)
- # meta_string='building-blocks-root-metapkgarmv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfSimple DirectMedia LayerThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub1-metapkg-extsub1armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub1-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub1-exts1sub1armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub1-exts1sub2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub1-metapkg-extsub2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub1-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub2-exts2sub1armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub2-exts2sub2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpm'
- # xml_list.append(etree.fromstring(meta_string))
+ #meta_string='building-blocks-category-domainsarmv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfSimple DirectMedia LayerThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-category-presetsarmv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfSimple DirectMedia LayerThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-root-metapkg2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfMeta root pkg2This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-root-metapkgarmv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfMeta root pkg1This is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub1-metapkg-extsub1armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub1-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub1-exts1sub1armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub1-exts1sub2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub1-metapkg-extsub2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub1-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub2-exts2sub1armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpmbuilding-blocks-sub2-metapkg-extsub2-exts2sub2armv7l6f74666eb89e1addc4ce75e25f3e639bbfdd8798fc848a6b7027501070567dcfsub2-extensionThis is the Simple DirectMedia Layer, a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.http://www.libsdl.org/Zlib and SGI-B-2.0tizenSystem Environment/Librariesw36SDL2-2.0.4-4.2.src.rpm'
+ #xml_list.append(etree.fromstring(meta_string))
filter_data = self._filtering_data_based_arch(xml_list, tag_dic)
@@ -263,7 +269,7 @@ class RepodataParser(object):
files={},
groups={},
conflicts={},
- meta_info=dict(root=[], sub1=[], sub2=[]))
+ meta_info=dict(root=[], sub1=[], sub2=[], category=[]))
# parses the repodata (primary.xml)
# for xml_root in xml_list: