pkgset: Drop kobo.plugins usage from GatherSources
Relates: https://pagure.io/pungi/issue/1488 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
39b847094a
commit
83458f26c2
@ -45,11 +45,8 @@ from pungi.phases.createrepo import add_modular_metadata
|
||||
|
||||
def get_gather_source(name):
|
||||
import pungi.phases.gather.sources
|
||||
from .source import GatherSourceContainer
|
||||
|
||||
GatherSourceContainer.register_module(pungi.phases.gather.sources)
|
||||
container = GatherSourceContainer()
|
||||
return container["GatherSource%s" % name]
|
||||
return pungi.phases.gather.sources.ALL_SOURCES[name.lower()]
|
||||
|
||||
|
||||
def get_gather_method(name):
|
||||
|
@ -14,15 +14,6 @@
|
||||
# along with this program; if not, see <https://gnu.org/licenses/>.
|
||||
|
||||
|
||||
import kobo.plugins
|
||||
|
||||
|
||||
class GatherSourceBase(kobo.plugins.Plugin):
|
||||
class GatherSourceBase(object):
|
||||
def __init__(self, compose):
|
||||
self.compose = compose
|
||||
|
||||
|
||||
class GatherSourceContainer(kobo.plugins.PluginContainer):
|
||||
@classmethod
|
||||
def normalize_name(cls, name):
|
||||
return name.lower()
|
||||
|
@ -0,0 +1,26 @@
|
||||
# -*- 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/>.
|
||||
|
||||
from .source_comps import GatherSourceComps
|
||||
from .source_json import GatherSourceJson
|
||||
from .source_module import GatherSourceModule
|
||||
from .source_none import GatherSourceNone
|
||||
|
||||
ALL_SOURCES = {
|
||||
"comps": GatherSourceComps,
|
||||
"json": GatherSourceJson,
|
||||
"module": GatherSourceModule,
|
||||
"none": GatherSourceNone,
|
||||
}
|
@ -30,8 +30,6 @@ import pungi.phases.gather.source
|
||||
|
||||
|
||||
class GatherSourceComps(pungi.phases.gather.source.GatherSourceBase):
|
||||
enabled = True
|
||||
|
||||
def __call__(self, arch, variant):
|
||||
groups = set()
|
||||
if not self.compose.conf.get("comps_file"):
|
||||
|
@ -37,8 +37,6 @@ import pungi.phases.gather.source
|
||||
|
||||
|
||||
class GatherSourceJson(pungi.phases.gather.source.GatherSourceBase):
|
||||
enabled = True
|
||||
|
||||
def __call__(self, arch, variant):
|
||||
json_path = self.compose.conf.get("gather_source_mapping")
|
||||
if not json_path:
|
||||
|
@ -26,8 +26,6 @@ import pungi.phases.gather.source
|
||||
|
||||
|
||||
class GatherSourceModule(pungi.phases.gather.source.GatherSourceBase):
|
||||
enabled = True
|
||||
|
||||
def __call__(self, arch, variant):
|
||||
groups = set()
|
||||
packages = set()
|
||||
|
@ -29,7 +29,5 @@ import pungi.phases.gather.source
|
||||
|
||||
|
||||
class GatherSourceNone(pungi.phases.gather.source.GatherSourceBase):
|
||||
enabled = True
|
||||
|
||||
def __call__(self, arch, variant):
|
||||
return set(), set()
|
||||
|
Loading…
Reference in New Issue
Block a user