| |
@@ -17,10 +17,11 @@
|
| |
gi.require_version('Modulemd', '1.0')
|
| |
from gi.repository import Modulemd
|
| |
|
| |
+ from copr_common.rpm import splitFilename
|
| |
from .sign import create_user_keys, CoprKeygenRequestError
|
| |
from .createrepo import createrepo
|
| |
from .exceptions import CreateRepoError, CoprSignError
|
| |
- from .helpers import get_redis_logger, silent_remove, ensure_dir_exists, get_chroot_arch, cmd_debug
|
| |
+ from .helpers import get_redis_logger, silent_remove, ensure_dir_exists, get_chroot_arch, cmd_debug, format_filename
|
| |
from .sign import sign_rpms_in_dir, unsign_rpms_in_dir, get_pubkey
|
| |
|
| |
from .vm_manage.manager import VmManager
|
| |
@@ -416,12 +417,13 @@
|
| |
project_path = os.path.join(self.opts.destdir, ownername, projectname)
|
| |
self.log.info(modulemd_data)
|
| |
|
| |
- mmd = Modulemd.ModuleStream()
|
| |
- mmd.import_from_string(modulemd_data)
|
| |
- artifacts = Modulemd.SimpleSet()
|
| |
-
|
| |
for chroot in chroots:
|
| |
arch = get_chroot_arch(chroot)
|
| |
+ mmd = Modulemd.ModuleStream()
|
| |
+ mmd.import_from_string(modulemd_data)
|
| |
+ mmd.set_arch(arch)
|
| |
+ artifacts = Modulemd.SimpleSet()
|
| |
+
|
| |
srcdir = os.path.join(project_path, chroot)
|
| |
module_tag = "{}+{}-{}-{}".format(chroot, mmd.get_name(), (mmd.get_stream() or ''),
|
| |
(str(mmd.get_version()) or '1'))
|
| |
@@ -444,7 +446,8 @@
|
| |
for f in os.listdir(os.path.join(destdir, folder)):
|
| |
if not f.endswith(".rpm") or f.endswith(".src.rpm"):
|
| |
continue
|
| |
- artifacts.add(str(f.rstrip(".rpm")))
|
| |
+ artifact = format_filename(zero_epoch=True, *splitFilename(f))
|
| |
+ artifacts.add(artifact)
|
| |
|
| |
mmd.set_rpm_artifacts(artifacts)
|
| |
self.log.info("Module artifacts: %s", mmd.get_rpm_artifacts())
|
| |
https://github.com/rpm-software-management/rpm/issues/561