Learn more about these different git repos.
Other Git URLs
(Replacing https://pagure.io/fm-orchestrator/issue/717)
It's currently unclear how tools other than DNF (e.g. fedmod's modulemd generator) should be querying repo metadata to determine:
This is a tracking issue to cover:
Nick, you are my hero. :green_heart:
@ttomecek I'm currently trying to update https://pagure.io/modularity/fedmod to do this right, so I have a certain vested interest in the matter ;)
Bringing the most important discovery from https://pagure.io/modularity/fedmod/issue/9 over: the repository level module metadata format is just a gzipped concatenated stream of all of the individual modulemd files included when creating the repo.
The relevant modulemd function is https://modulemd.readthedocs.io/en/latest/modulemd.html#modulemd.loads_all
Summarising what I learned in writing https://pagure.io/modularity/fedmod/pull-request/11:
rpm:data[@type='modules']/rpm:location
http://linux.duke.edu/metadata/repo
modulemd.loads_all
Some example code for use with metadata stored locally:
import gzip import modulemd from lxml import etree metadata_dir = PATH_TO_LOCAL_DIRECTORY repomd_fname = os.path.join(metadata_dir, "repodata", "repomd.xml") repomd_xml = etree.parse(repomd_fname) repo_modulemd = repomd_xml.find("rpm:data[@type='modules']/rpm:location", {"rpm": "http://linux.duke.edu/metadata/repo"}) if repo_modulemd is None: raise RuntimeError("No 'modules' entry found in repomd.xml. Is the metadata for a non-modular repo?") repo_modulemd_fname = os.path.join(metadata_dir, repo_modulemd.attrib["href"]) with gzip.open(repo_modulemd_fname, "r") as modules_yaml_gz: modules_yaml = modules_yaml_gz.read() modules = modulemd.loads_all(modules_yaml)
The current way to do this is to use the modulemd v2.
Metadata Update from @asamalik: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.