gather: Drop kobo.plugins usage from GatherMethod
Relates: https://pagure.io/pungi/issue/1488 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
83458f26c2
commit
0f4b0577f7
@ -51,11 +51,8 @@ def get_gather_source(name):
|
|||||||
|
|
||||||
def get_gather_method(name):
|
def get_gather_method(name):
|
||||||
import pungi.phases.gather.methods
|
import pungi.phases.gather.methods
|
||||||
from .method import GatherMethodContainer
|
|
||||||
|
|
||||||
GatherMethodContainer.register_module(pungi.phases.gather.methods)
|
return pungi.phases.gather.methods.ALL_METHODS[name.lower()]
|
||||||
container = GatherMethodContainer()
|
|
||||||
return container["GatherMethod%s" % name]
|
|
||||||
|
|
||||||
|
|
||||||
class GatherPhase(PhaseBase):
|
class GatherPhase(PhaseBase):
|
||||||
|
@ -14,15 +14,6 @@
|
|||||||
# along with this program; if not, see <https://gnu.org/licenses/>.
|
# along with this program; if not, see <https://gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import kobo.plugins
|
class GatherMethodBase(object):
|
||||||
|
|
||||||
|
|
||||||
class GatherMethodBase(kobo.plugins.Plugin):
|
|
||||||
def __init__(self, compose):
|
def __init__(self, compose):
|
||||||
self.compose = compose
|
self.compose = compose
|
||||||
|
|
||||||
|
|
||||||
class GatherMethodContainer(kobo.plugins.PluginContainer):
|
|
||||||
@classmethod
|
|
||||||
def normalize_name(cls, name):
|
|
||||||
return name.lower()
|
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
# -*- 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 .method_deps import GatherMethodDeps
|
||||||
|
from .method_nodeps import GatherMethodNodeps
|
||||||
|
from .method_hybrid import GatherMethodHybrid
|
||||||
|
|
||||||
|
ALL_METHODS = {
|
||||||
|
"deps": GatherMethodDeps,
|
||||||
|
"nodeps": GatherMethodNodeps,
|
||||||
|
"hybrid": GatherMethodHybrid,
|
||||||
|
}
|
@ -31,8 +31,6 @@ import pungi.phases.gather.method
|
|||||||
|
|
||||||
|
|
||||||
class GatherMethodDeps(pungi.phases.gather.method.GatherMethodBase):
|
class GatherMethodDeps(pungi.phases.gather.method.GatherMethodBase):
|
||||||
enabled = True
|
|
||||||
|
|
||||||
def __call__(
|
def __call__(
|
||||||
self,
|
self,
|
||||||
arch,
|
arch,
|
||||||
|
@ -60,8 +60,6 @@ class FakePackage(object):
|
|||||||
|
|
||||||
|
|
||||||
class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase):
|
class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase):
|
||||||
enabled = True
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(GatherMethodHybrid, self).__init__(*args, **kwargs)
|
super(GatherMethodHybrid, self).__init__(*args, **kwargs)
|
||||||
self.package_maps = {}
|
self.package_maps = {}
|
||||||
|
@ -28,8 +28,6 @@ from kobo.pkgset import SimpleRpmWrapper, RpmWrapper
|
|||||||
|
|
||||||
|
|
||||||
class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
|
class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
|
||||||
enabled = True
|
|
||||||
|
|
||||||
def __call__(self, arch, variant, *args, **kwargs):
|
def __call__(self, arch, variant, *args, **kwargs):
|
||||||
fname = "gather-nodeps-%s" % variant.uid
|
fname = "gather-nodeps-%s" % variant.uid
|
||||||
if self.source_name:
|
if self.source_name:
|
||||||
|
Loading…
Reference in New Issue
Block a user