From 5a40c0fb2a8d6a610dd255d002b13f63686c0512 Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: May 17 2018 20:40:55 +0000 Subject: [PATCH 1/3] Fix problem resolving relative paths to updates repo Remote repo URLs need to end with a / for the resolution code to work properly. --- diff --git a/src/_fedmod/_fetchrepodata.py b/src/_fedmod/_fetchrepodata.py index c883a73..3cfe68d 100644 --- a/src/_fedmod/_fetchrepodata.py +++ b/src/_fedmod/_fetchrepodata.py @@ -48,7 +48,7 @@ def _define_repo(remote_prefix, local_cache_name, arch=None): else: local_arch_path = arch if "updates" in remote_prefix: - remote_arch_path = arch + remote_arch_path = arch + "/" else: remote_arch_path = os.path.join(arch, "os/") remote_repo_url = os.path.join(remote_prefix, remote_arch_path) From 5135ae0f36a2de04570379d2c56529f7eb3dba2d Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: May 17 2018 20:40:55 +0000 Subject: [PATCH 2/3] depchase: Handle duplicate packages in the pool When we add in the Fedora updates repository, then we need to handle having multiple copies of a package in the pool when we look up a SRPM - pick the one with the newest EVR. --- diff --git a/src/_fedmod/_depchase.py b/src/_fedmod/_depchase.py index dc69031..bb83871 100644 --- a/src/_fedmod/_depchase.py +++ b/src/_fedmod/_depchase.py @@ -3,6 +3,7 @@ import collections import configparser import itertools +import functools import logging import os import sys @@ -235,17 +236,14 @@ def get_srpm_for_rpm(pool, pkg): found = sel.solvables() num_results = len(found) s = None - if num_results == 1: - s = found[0] - elif num_results == 2: - # Handle x86 32-bit vs 64-bit multilib packages - first, second = found - if first.arch == "x86_64" and second.arch == "i686": - s = first - elif first.arch == "i686" and second.arch == "x86_64": - s = second - if s is None: - raise RuntimeError("More matching solvables were found, {}".format(found)) + + # Handle x86 32-bit vs 64-bit multilib packages + have_x86_64 = any(x.arch == "x86_64" for x in found) + have_i686 = any(x.arch == "i686" for x in found) + if have_x86_64 and have_i686: + found = [x for x in found if x.arch == "x86_64"] + + found = sorted(found, key=functools.cmp_to_key(lambda a, b: a.evrcmp(b))) s = found[0] return get_sourcepkg(s, only_name=True) From 04e3d8ad1ab970a36e8e60e50d832f215e4aa7aa Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: May 17 2018 20:40:55 +0000 Subject: [PATCH 3/3] Enable the Fedora updates repository The modular updates repository has been disabled until code is written to properly merge module sets, but we should still enable the normal updates repository. --- diff --git a/src/_fedmod/_fetchrepodata.py b/src/_fedmod/_fetchrepodata.py index 3cfe68d..a6b0e9f 100644 --- a/src/_fedmod/_fetchrepodata.py +++ b/src/_fedmod/_fetchrepodata.py @@ -64,8 +64,8 @@ _SOURCE_MODULE_INFO = _define_repo(_F28_MODULAR_REPO, "f28-modular") #_SOURCE_MODULE_UPDATES_INFO = _define_repo(_F28_MODULAR_UPDATES_REPO, "f28-modular-updates") _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") +_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, @@ -73,8 +73,8 @@ _ALL_REPOS = ( # _SOURCE_MODULE_UPDATES_INFO, _x86_64_PACKAGE_INFO, _SOURCE_PACKAGE_INFO, -# _x86_64_UPDATES_INFO, -# _SOURCE_UPDATES_INFO, + _x86_64_UPDATES_INFO, + _SOURCE_UPDATES_INFO, ) _LOOKUP_CACHES = { @@ -200,8 +200,8 @@ class LocalMetadataCache: 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): @@ -228,6 +228,6 @@ def load_cached_repodata(dataset_name): 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, ) diff --git a/src/_fedmod/_repodata.py b/src/_fedmod/_repodata.py index c66ad23..1ba0952 100644 --- a/src/_fedmod/_repodata.py +++ b/src/_fedmod/_repodata.py @@ -274,8 +274,7 @@ def setup_repos(): srcrepo = Repo("distro-source", dataset.source_repo_cache) repo = Repo("distro", dataset.arch_repo_cache) repo.srcrepo = srcrepo - # updates_srcrepo = Repo("distro-updates-source", dataset.source_updates_cache) - # updates_repo = Repo("distro-updates", dataset.arch_updates_cache) - # updates_repo.srcrepo = updates_srcrepo - # return [repo, srcrepo, updates_repo] - return [repo, srcrepo] + updates_srcrepo = Repo("distro-updates-source", dataset.source_updates_cache) + updates_repo = Repo("distro-updates", dataset.arch_updates_cache) + updates_repo.srcrepo = updates_srcrepo + return [repo, srcrepo, updates_repo, updates_srcrepo]