| |
@@ -1,4 +1,5 @@
|
| |
"""_fetchrepodata: Map yum/dnf repo metadata to local lookup caches"""
|
| |
+ import gzip
|
| |
import json
|
| |
import logging
|
| |
import os
|
| |
@@ -19,12 +20,12 @@
|
| |
log = logging.getLogger(__name__)
|
| |
|
| |
FALLBACK_STREAM = 'master'
|
| |
- STREAM = 'f27'
|
| |
+ STREAM = 'f28'
|
| |
ARCH = 'x86_64'
|
| |
- _F27_BIKESHED_REPO = "https://dl.fedoraproject.org/pub/fedora/linux/modular/development/bikeshed/Server/"
|
| |
- _F27_MAIN_REPO = "https://dl.fedoraproject.org/pub/fedora/linux/development/27/Everything/"
|
| |
- _F27_UPDATES_REPO = "https://dl.fedoraproject.org/pub/fedora/linux/updates/27/"
|
| |
- _F27_BOOTSTRAP_MODULEMD = "https://src.fedoraproject.org/modules/bootstrap/raw/master/f/bootstrap.yaml"
|
| |
+ _F28_MODULAR_REPO = "https://dl.fedoraproject.org/pub/fedora/linux/development/28/Modular/"
|
| |
+ _F28_MAIN_REPO = "https://dl.fedoraproject.org/pub/fedora/linux/development/28/Everything/"
|
| |
+ # F28 updates repo is empty until F28 is released, and the structure is still evolving
|
| |
+ #_F28_UPDATES_REPO = "https://dl.fedoraproject.org/pub/fedora/linux/updates/28/Everything/"
|
| |
|
| |
class MissingMetadata(Exception):
|
| |
"""Reports failure to find the local metadata cache"""
|
| |
@@ -56,27 +57,25 @@
|
| |
return RepoPaths(remote_repo_url, remote_metadata_url,
|
| |
local_cache_path, local_metadata_path)
|
| |
|
| |
- _x86_64_MODULE_INFO = _define_repo(_F27_BIKESHED_REPO, "f27-modules", ARCH)
|
| |
- _SOURCE_MODULE_INFO = _define_repo(_F27_BIKESHED_REPO, "f27-modules")
|
| |
- _x86_64_PACKAGE_INFO = _define_repo(_F27_MAIN_REPO, "f27-packages", ARCH)
|
| |
- _SOURCE_PACKAGE_INFO = _define_repo(_F27_MAIN_REPO, "f27-packages")
|
| |
- _x86_64_UPDATES_INFO = _define_repo(_F27_UPDATES_REPO, "f27-updates", ARCH)
|
| |
- _SOURCE_UPDATES_INFO = _define_repo(_F27_UPDATES_REPO, "f27-updates")
|
| |
+ _x86_64_MODULE_INFO = _define_repo(_F28_MODULAR_REPO, "f28-modular", ARCH)
|
| |
+ _SOURCE_MODULE_INFO = _define_repo(_F28_MODULAR_REPO, "f28-modular")
|
| |
+ _x86_64_PACKAGE_INFO = _define_repo(_F28_MAIN_REPO, "f28-packages", ARCH)
|
| |
+ _SOURCE_PACKAGE_INFO = _define_repo(_F28_MAIN_REPO, "f28-packages")
|
| |
+ #_x86_64_UPDATES_INFO = _define_repo(_F28_UPDATES_REPO, "f28-updates", ARCH)
|
| |
+ #_SOURCE_UPDATES_INFO = _define_repo(_F28_UPDATES_REPO, "f28-updates")
|
| |
_ALL_REPOS = (
|
| |
_x86_64_MODULE_INFO,
|
| |
_SOURCE_MODULE_INFO,
|
| |
_x86_64_PACKAGE_INFO,
|
| |
_SOURCE_PACKAGE_INFO,
|
| |
- _x86_64_UPDATES_INFO,
|
| |
- _SOURCE_UPDATES_INFO,
|
| |
+ # _x86_64_UPDATES_INFO,
|
| |
+ # _SOURCE_UPDATES_INFO,
|
| |
)
|
| |
- _BOOTSTRAP_MODULEMD = os.path.join(CACHEDIR, "f27-bootstrap.yaml")
|
| |
|
| |
_LOOKUP_CACHES = {
|
| |
- "_BOOTSTRAP_COMPONENTS_CACHE": os.path.join(CACHEDIR, "f27-bootstrap-cache.json"),
|
| |
- "_MODULE_FORWARD_LOOKUP_CACHE": os.path.join(CACHEDIR, "f27-module-contents-cache.json"),
|
| |
- "_SRPM_REVERSE_LOOKUP_CACHE": os.path.join(CACHEDIR, "f27-srpm-to-module-cache.json"),
|
| |
- "_RPM_REVERSE_LOOKUP_CACHE": os.path.join(CACHEDIR, "f27-rpm-to-module-cache.json"),
|
| |
+ "_MODULE_FORWARD_LOOKUP_CACHE": os.path.join(CACHEDIR, "f28-module-contents-cache.json"),
|
| |
+ "_SRPM_REVERSE_LOOKUP_CACHE": os.path.join(CACHEDIR, "f28-srpm-to-module-cache.json"),
|
| |
+ "_RPM_REVERSE_LOOKUP_CACHE": os.path.join(CACHEDIR, "f28-rpm-to-module-cache.json"),
|
| |
}
|
| |
|
| |
METADATA_SECTIONS = ("filelists", "primary", "modules")
|
| |
@@ -150,23 +149,6 @@
|
| |
with open(cache_fname, "r") as cache_file:
|
| |
return json.load(cache_file)
|
| |
|
| |
- def _download_bootstrap_modulemd():
|
| |
- from ._depchase import make_pool, get_rpms_for_srpms
|
| |
- print("Downloading build bootstrap module details")
|
| |
- _download_one_file(_F27_BOOTSTRAP_MODULEMD, _BOOTSTRAP_MODULEMD)
|
| |
- # TODO: Cache the modulemd file hash, and only regenerate the cache
|
| |
- # if that has changed
|
| |
- mmd = modulemd.ModuleMetadata()
|
| |
- mmd.load(_BOOTSTRAP_MODULEMD)
|
| |
- pool = make_pool("x86_64")
|
| |
- bootstrap_rpms = set()
|
| |
- rpms = get_rpms_for_srpms(pool, mmd.components.rpms)
|
| |
- for rpmname in rpms:
|
| |
- bootstrap_rpms.add(rpmname)
|
| |
- for srpmname in mmd.components.rpms:
|
| |
- bootstrap_rpms.add(srpmname)
|
| |
- _write_cache("_BOOTSTRAP_COMPONENTS_CACHE", list(bootstrap_rpms))
|
| |
-
|
| |
def _write_lookup_caches():
|
| |
metadata_dir = os.path.join(_x86_64_MODULE_INFO.local_cache_path)
|
| |
repomd_fname = os.path.join(metadata_dir, "repodata", "repomd.xml")
|
| |
@@ -197,7 +179,6 @@
|
| |
"""Downloads the latest repo metadata"""
|
| |
for repo_definition in _ALL_REPOS:
|
| |
_download_metadata_files(repo_definition)
|
| |
- _download_bootstrap_modulemd()
|
| |
_write_lookup_caches()
|
| |
|
| |
@attributes
|
| |
@@ -206,17 +187,16 @@
|
| |
cache_dir = attrib(str)
|
| |
srpm_to_modules = attrib(dict)
|
| |
rpm_to_modules = attrib(dict)
|
| |
- bootstrap_components = attrib(set)
|
| |
module_to_packages = attrib(dict)
|
| |
source_repo_cache = attrib(str)
|
| |
arch_repo_cache = attrib(str)
|
| |
- source_updates_cache = attrib(str)
|
| |
- arch_updates_cache = attrib(str)
|
| |
+ # source_updates_cache = attrib(str)
|
| |
+ # arch_updates_cache = attrib(str)
|
| |
|
| |
|
| |
def load_cached_repodata(dataset_name):
|
| |
- if dataset_name != "f27-bikeshed-x86_64":
|
| |
- raise RuntimeError("Data sets other than 'f27-bikeshed-x86_64' are not yet supported")
|
| |
+ if dataset_name != "f28-x86_64":
|
| |
+ raise RuntimeError("Data sets other than 'f28-x86_64' are not yet supported")
|
| |
# Check whether or not fetch-metadata has been run at all
|
| |
metadata_dir = os.path.join(_x86_64_MODULE_INFO.local_cache_path)
|
| |
repomd_fname = os.path.join(metadata_dir, "repodata", "repomd.xml")
|
| |
@@ -235,10 +215,9 @@
|
| |
cache_dir = CACHEDIR,
|
| |
srpm_to_modules = _read_cache("_SRPM_REVERSE_LOOKUP_CACHE"),
|
| |
rpm_to_modules = _read_cache("_RPM_REVERSE_LOOKUP_CACHE"),
|
| |
- bootstrap_components = _read_cache("_BOOTSTRAP_COMPONENTS_CACHE"),
|
| |
module_to_packages = _read_cache("_MODULE_FORWARD_LOOKUP_CACHE"),
|
| |
source_repo_cache = _SOURCE_PACKAGE_INFO.local_cache_path,
|
| |
arch_repo_cache = _x86_64_PACKAGE_INFO.local_cache_path,
|
| |
- source_updates_cache = _SOURCE_UPDATES_INFO.local_cache_path,
|
| |
- arch_updates_cache = _x86_64_UPDATES_INFO.local_cache_path,
|
| |
+ # source_updates_cache = _SOURCE_UPDATES_INFO.local_cache_path,
|
| |
+ # arch_updates_cache = _x86_64_UPDATES_INFO.local_cache_path,
|
| |
)
|
| |
Here's a basic set of patches that get fedmod working again on top of F28 branched and the modular repository. Module generation is considerably simplified with hybrid modularity.
Some more fine-tuning is necessary - fedmod doesn't have any handling for modules with multiple streams - like we have with nodejs. And probably if a package is available both in the base package set and in modules the default should be to just use the package in the base package set, which is the opposite of what happens here.
But this gets things to the point where fedmod runs and the tests pass and should be a good basis for further work.