pkglistgen: fix up coolo's code
This commit is contained in:
parent
48a572ed59
commit
2110ded1a6
@ -62,7 +62,6 @@ class Group(object):
|
|||||||
self.solved = False
|
self.solved = False
|
||||||
self.not_found = dict()
|
self.not_found = dict()
|
||||||
self.unresolvable = dict()
|
self.unresolvable = dict()
|
||||||
self.unwanted = set()
|
|
||||||
for a in self.architectures:
|
for a in self.architectures:
|
||||||
self.packages[a] = []
|
self.packages[a] = []
|
||||||
self.unresolvable[a] = dict()
|
self.unresolvable[a] = dict()
|
||||||
@ -252,7 +251,7 @@ class Group(object):
|
|||||||
|
|
||||||
def check_dups(self, modules):
|
def check_dups(self, modules):
|
||||||
packages = set(self.solved_packages['*'])
|
packages = set(self.solved_packages['*'])
|
||||||
for arch in ARCHITECTURES:
|
for arch in self.architectures:
|
||||||
packages.update(self.solved_packages[arch])
|
packages.update(self.solved_packages[arch])
|
||||||
for m in modules:
|
for m in modules:
|
||||||
# do not check with ourselves and only once for the rest
|
# do not check with ourselves and only once for the rest
|
||||||
@ -260,7 +259,7 @@ class Group(object):
|
|||||||
if self.name in m.conflicts or m.name in self.conflicts:
|
if self.name in m.conflicts or m.name in self.conflicts:
|
||||||
continue
|
continue
|
||||||
mp = set(m.solved_packages['*'])
|
mp = set(m.solved_packages['*'])
|
||||||
for arch in ARCHITECTURES:
|
for arch in self.architectures:
|
||||||
mp.update(m.solved_packages[arch])
|
mp.update(m.solved_packages[arch])
|
||||||
if len(packages & mp):
|
if len(packages & mp):
|
||||||
print 'overlap_between_' + self.name + '_and_' + m.name + ':'
|
print 'overlap_between_' + self.name + '_and_' + m.name + ':'
|
||||||
@ -390,6 +389,8 @@ class PkgListGen(ToolBase.ToolBase):
|
|||||||
self.lockjobs = dict()
|
self.lockjobs = dict()
|
||||||
self.ignore_broken = False
|
self.ignore_broken = False
|
||||||
self.ignore_recommended = False
|
self.ignore_recommended = False
|
||||||
|
self.unwanted = set()
|
||||||
|
self.output = None
|
||||||
|
|
||||||
def _dump_supportstatus(self):
|
def _dump_supportstatus(self):
|
||||||
for name in self.packages.keys():
|
for name in self.packages.keys():
|
||||||
@ -438,15 +439,14 @@ class PkgListGen(ToolBase.ToolBase):
|
|||||||
return output, unwanted
|
return output, unwanted
|
||||||
|
|
||||||
def load_all_groups(self):
|
def load_all_groups(self):
|
||||||
output = None
|
|
||||||
unwanted = set()
|
|
||||||
for fn in glob.glob(os.path.join(self.input_dir, 'group*.yml')):
|
for fn in glob.glob(os.path.join(self.input_dir, 'group*.yml')):
|
||||||
o, u = self._load_group_file(fn)
|
o, u = self._load_group_file(fn)
|
||||||
if not output:
|
if o:
|
||||||
output = o
|
if self.output is not None:
|
||||||
if not unwanted:
|
raise Exception('OUTPUT defined multiple times')
|
||||||
unwanted = u
|
self.output = o
|
||||||
return output, unwanted
|
if u:
|
||||||
|
self.unwanted |= u
|
||||||
|
|
||||||
def _write_all_groups(self):
|
def _write_all_groups(self):
|
||||||
self._check_supplements()
|
self._check_supplements()
|
||||||
@ -557,7 +557,7 @@ class PkgListGen(ToolBase.ToolBase):
|
|||||||
for p in sorted(packages.keys()):
|
for p in sorted(packages.keys()):
|
||||||
fh.write(" - ")
|
fh.write(" - ")
|
||||||
fh.write(p)
|
fh.write(p)
|
||||||
if len(packages[p]) != len(ARCHITECTURES):
|
if len(packages[p]) != len(self.architectures):
|
||||||
fh.write(": [")
|
fh.write(": [")
|
||||||
fh.write(','.join(sorted(packages[p])))
|
fh.write(','.join(sorted(packages[p])))
|
||||||
fh.write("]")
|
fh.write("]")
|
||||||
@ -687,8 +687,9 @@ class CommandLineInterface(ToolBase.CommandLineInterface):
|
|||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
output, self.tool.unwanted = self.tool.load_all_groups()
|
self.tool.load_all_groups()
|
||||||
if not output:
|
if not self.tool.output:
|
||||||
|
logger.error('OUTPUT not defined')
|
||||||
return
|
return
|
||||||
|
|
||||||
if opts.ignore_unresolvable:
|
if opts.ignore_unresolvable:
|
||||||
@ -699,7 +700,7 @@ class CommandLineInterface(ToolBase.CommandLineInterface):
|
|||||||
modules = []
|
modules = []
|
||||||
# the yml parser makes an array out of everything, so
|
# the yml parser makes an array out of everything, so
|
||||||
# we loop a bit more than what we support
|
# we loop a bit more than what we support
|
||||||
for group in output:
|
for group in self.tool.output:
|
||||||
groupname = group.keys()[0]
|
groupname = group.keys()[0]
|
||||||
settings = group[groupname]
|
settings = group[groupname]
|
||||||
includes = settings.get('includes', [])
|
includes = settings.get('includes', [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user