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
|
2016-09-21 12:49:13 +00:00
|
|
|
# along with this program; if not, see <https://gnu.org/licenses/>.
|
2015-02-10 13:19:34 +00:00
|
|
|
|
|
|
|
|
2015-03-12 21:12:38 +00:00
|
|
|
from pungi.phases.base import PhaseBase
|
2015-02-10 13:19:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PkgsetPhase(PhaseBase):
|
|
|
|
"""PKGSET"""
|
2020-02-03 03:50:06 +00:00
|
|
|
|
2015-02-10 13:19:34 +00:00
|
|
|
name = "pkgset"
|
|
|
|
|
2020-06-10 10:01:02 +00:00
|
|
|
def __init__(self, compose, *args, **kwargs):
|
|
|
|
super(PkgsetPhase, self).__init__(compose, *args, **kwargs)
|
|
|
|
self.compose = compose
|
2019-09-18 11:54:18 +00:00
|
|
|
self.package_sets = []
|
2019-09-23 07:17:51 +00:00
|
|
|
self.path_prefix = None
|
2019-09-18 11:54:18 +00:00
|
|
|
|
2015-02-10 13:19:34 +00:00
|
|
|
def run(self):
|
2017-09-05 08:01:21 +00:00
|
|
|
from . import sources
|
2020-02-03 03:50:06 +00:00
|
|
|
|
2021-01-27 14:46:28 +00:00
|
|
|
SourceClass = sources.ALL_SOURCES[self.compose.conf["pkgset_source"].lower()]
|
|
|
|
|
2019-07-26 14:06:53 +00:00
|
|
|
self.package_sets, self.path_prefix = SourceClass(self.compose)()
|
2020-06-10 10:01:02 +00:00
|
|
|
|
|
|
|
def validate(self):
|
|
|
|
extra_tasks = self.compose.conf.get("pkgset_koji_scratch_tasks", None)
|
|
|
|
sigkeys = tuple(self.compose.conf["sigkeys"] or [None])
|
|
|
|
if extra_tasks is not None and None not in sigkeys and "" not in sigkeys:
|
|
|
|
raise ValueError(
|
|
|
|
"Unsigned packages must be allowed to use the "
|
|
|
|
'"pkgset_koji_scratch_tasks" option'
|
|
|
|
)
|