pungi/pungi/phases/gather/sources/source_comps.py

47 lines
1.3 KiB
Python
Raw Normal View History

2015-02-10 13:19:34 +00:00
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://gnu.org/licenses/>.
2015-02-10 13:19:34 +00:00
"""
Get a package list based on comps.xml.
Input format:
see comps.dtd
Output:
set([(rpm_name, rpm_arch or None)])
"""
2015-03-12 21:12:38 +00:00
from pungi.wrappers.comps import CompsWrapper
import pungi.phases.gather.source
2015-02-10 13:19:34 +00:00
2015-03-12 21:12:38 +00:00
class GatherSourceComps(pungi.phases.gather.source.GatherSourceBase):
2015-02-10 13:19:34 +00:00
enabled = True
def __call__(self, arch, variant):
groups = set()
comps = CompsWrapper(self.compose.paths.work.comps(arch=arch))
if variant is not None and variant.groups:
# Get packages for a particular variant. If the variant has no
# groups listed, all groups will be used.
2015-02-10 13:19:34 +00:00
comps.filter_groups(variant.groups)
for i in comps.get_comps_groups():
groups.add(i.groupid)
return set(), groups