Remove 'module_' prefix from the disttag in module-build-macros.

This commit is contained in:
Jan Kaluza
2017-03-03 11:22:58 +01:00
parent b7a99c5da8
commit 6d74f32462
3 changed files with 9 additions and 6 deletions

View File

@@ -379,7 +379,6 @@ class KojiModuleBuilder(GenericBuilder):
@staticmethod
@module_build_service.utils.validate_koji_tag('disttag', pre='.', post='_')
def get_disttag_srpm(disttag):
#Taken from Karsten's create-distmacro-pkg.sh
@@ -1087,7 +1086,6 @@ class CoprModuleBuilder(GenericBuilder):
log.info(result.data["modulemd"])
@staticmethod
@module_build_service.utils.validate_koji_tag('disttag', pre='.', post='_')
def get_disttag_srpm(disttag):
# @FIXME
return KojiModuleBuilder.get_disttag_srpm(disttag)
@@ -1499,7 +1497,6 @@ mdpolicy=group:primary
return self.build_srpm(artifact_name, source, build_id)
@staticmethod
@module_build_service.utils.validate_koji_tag('disttag', pre='.', post='_')
def get_disttag_srpm(disttag):
# @FIXME
return KojiModuleBuilder.get_disttag_srpm(disttag)

View File

@@ -38,6 +38,13 @@ logging.basicConfig(level=logging.DEBUG)
def get_rpm_release_from_tag(tag):
# Remove the 'module-' prefix, because the disttag is too long
# otherwise. We for example hit that limit for KERNELRELEASE, which
# must be maximally 64 bytes long.
# See https://pagure.io/fm-orchestrator/issue/373 for more info.
if tag.startswith("module-"):
tag = tag[len("module-"):]
return tag.replace("-", "_")

View File

@@ -190,7 +190,6 @@ class TestModuleBuilder(GenericBuilder):
return TestModuleBuilder._build_id, state, reason, None
@staticmethod
@module_build_service.utils.validate_koji_tag('disttag', pre='.', post='_')
def get_disttag_srpm(disttag):
# @FIXME
return KojiModuleBuilder.get_disttag_srpm(disttag)
@@ -254,7 +253,7 @@ class TestBuild(unittest.TestCase):
# Check that components are tagged after the batch is built.
tag_groups = []
tag_groups.append([u'module-build-macros-0.1-1.module_testmodule_master_1.src.rpm-1-1'])
tag_groups.append([u'module-build-macros-0.1-1.testmodule_master_1.src.rpm-1-1'])
tag_groups.append([u'perl-Tangerine?#f25-1-1', u'perl-List-Compare?#f25-1-1'])
tag_groups.append([u'tangerine?#f25-1-1'])
@@ -266,7 +265,7 @@ class TestBuild(unittest.TestCase):
# Check that the components are added to buildroot after the batch
# is built.
buildroot_groups = []
buildroot_groups.append([u'module-build-macros-0.1-1.module_testmodule_master_1.src.rpm-1-1'])
buildroot_groups.append([u'module-build-macros-0.1-1.testmodule_master_1.src.rpm-1-1'])
buildroot_groups.append([u'perl-Tangerine?#f25-1-1', u'perl-List-Compare?#f25-1-1'])
buildroot_groups.append([u'tangerine?#f25-1-1'])