Add groups to index
This commit is contained in:
@@ -99,6 +99,8 @@ class Index(xmlfile.XmlFile):
|
|||||||
self.add_spec(os.path.join(root, fn), repo_uri)
|
self.add_spec(os.path.join(root, fn), repo_uri)
|
||||||
if fn == 'distribution.xml':
|
if fn == 'distribution.xml':
|
||||||
self.add_distro(os.path.join(root, fn))
|
self.add_distro(os.path.join(root, fn))
|
||||||
|
if fn == 'groups.xml':
|
||||||
|
self.add_groups(os.path.join(root, fn))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
obsoletes_list = map(str, self.distribution.obsoletes)
|
obsoletes_list = map(str, self.distribution.obsoletes)
|
||||||
@@ -147,6 +149,13 @@ class Index(xmlfile.XmlFile):
|
|||||||
|
|
||||||
self.packages.append(md.package)
|
self.packages.append(md.package)
|
||||||
|
|
||||||
|
def add_groups(self, path):
|
||||||
|
ctx.ui.info("Adding groups.xml to index...")
|
||||||
|
groups_xml = group.Groups()
|
||||||
|
groups_xml.read(path)
|
||||||
|
for group in groups_xml.groups:
|
||||||
|
self.groups.append(group)
|
||||||
|
|
||||||
def add_components(self, path):
|
def add_components(self, path):
|
||||||
ctx.ui.info("Adding components.xml to index...")
|
ctx.ui.info("Adding components.xml to index...")
|
||||||
components_xml = component.Components()
|
components_xml = component.Components()
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import pisi.dependency
|
|||||||
import pisi.replace
|
import pisi.replace
|
||||||
import pisi.conflict
|
import pisi.conflict
|
||||||
import pisi.component as component
|
import pisi.component as component
|
||||||
|
import pisi.group as group
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
import pisi.db
|
import pisi.db
|
||||||
|
|
||||||
@@ -288,6 +289,7 @@ class SpecFile(xmlfile.XmlFile):
|
|||||||
t_Packages = [ [Package], autoxml.mandatory, "Package"]
|
t_Packages = [ [Package], autoxml.mandatory, "Package"]
|
||||||
t_History = [ [Update], autoxml.mandatory]
|
t_History = [ [Update], autoxml.mandatory]
|
||||||
t_Components = [ [component.Component], autoxml.optional, "Component"]
|
t_Components = [ [component.Component], autoxml.optional, "Component"]
|
||||||
|
t_Groups = [ [group.Group], autoxml.optional, "Group"]
|
||||||
|
|
||||||
def getSourceVersion(self):
|
def getSourceVersion(self):
|
||||||
return self.history[0].version
|
return self.history[0].version
|
||||||
|
|||||||
Reference in New Issue
Block a user