pkgset: Only reuse valid old repo

Instead of just checking that the repo directory exists, make sure the
repodata subdirectory is in there. If it's missing, then createrepo_c
has nothing to use anyway, and it may help avoid issues.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-10-17 09:17:36 +02:00
parent 4f96164ec7
commit 6771a21916

View File

@ -77,7 +77,7 @@ def get_create_global_repo_cmd(compose, path_prefix, repo_dir_global, pkgset):
repo_dir, os.path.abspath(compose.topdir).rstrip("/") + "/" repo_dir, os.path.abspath(compose.topdir).rstrip("/") + "/"
) )
old_repo_dir = os.path.join(old_compose_path, rel_path) old_repo_dir = os.path.join(old_compose_path, rel_path)
if os.path.isdir(old_repo_dir): if os.path.isdir(os.path.join(old_repo_dir, "repodata")):
compose.log_info("Using old repodata from: %s", old_repo_dir) compose.log_info("Using old repodata from: %s", old_repo_dir)
update_md_path = old_repo_dir update_md_path = old_repo_dir