Skip to content

Commit

Permalink
Import module metadata in reposync
Browse files Browse the repository at this point in the history
  • Loading branch information
cbbayburt committed Apr 5, 2024
1 parent 226ad45 commit 953e113
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/spacewalk/satellite_tools/reposync.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
dumpEMAIL_LOG,
log2background,
)
from spacewalk.satellite_tools.appstreams import ModuleMdImporter

translation = gettext.translation("spacewalk-backend-server", fallback=True)
_ = translation.gettext
Expand Down Expand Up @@ -751,10 +752,14 @@ def sync(self, update_repodata=True):
# this fetch also the normal xml primary file
repo_checksum_type = plugin.get_md_checksum_type()

modulemd_importer = None
if not self.no_packages:
self.import_groups(plugin)
if repo_type == "yum":
self.import_modules(plugin)
modulemd_path = self.import_modules(plugin)
if modulemd_path:
modulemd_importer = ModuleMdImporter(self.channel["id"], modulemd_path)
modulemd_importer.validate()
ret = self.import_packages(
plugin, data["id"], url, is_non_local_repo
)
Expand All @@ -763,6 +768,9 @@ def sync(self, update_repodata=True):
if not self.no_errata:
self.import_updates(plugin)

if modulemd_importer:
modulemd_importer.import_module_metadata()

self.import_mediaproducts(plugin)

# only for repos obtained from the DB
Expand Down Expand Up @@ -1128,7 +1136,7 @@ def import_groups(self, plug):
def import_modules(self, plug):
modulesfile = plug.get_modules()
if modulesfile:
self.copy_metadata_file(plug, modulesfile, "modules", relative_modules_dir)
return self.copy_metadata_file(plug, modulesfile, "modules", relative_modules_dir)

def import_mediaproducts(self, plug):
mediaproducts = plug.get_mediaproducts()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Import module metadata during reposync

0 comments on commit 953e113

Please sign in to comment.