1 Star 0 Fork 93

yanan-rock / anaconda

forked from src-openEuler / anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-do-not-test-if-repo-is-valid-based-on-treeinfo-file.patch 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
zhuqingfu 提交于 2020-09-17 11:22 . do not require treeinfo
From 6cee8e5a59a9c424d2bc79b5474a749c4f786b40 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Fri, 19 Jun 2020 14:12:21 +0200
Subject: [PATCH] Do not test if repo is valid based on .treeinfo file
(#1844287)
Not all repositories need to have .treeinfo file. When it is not a compose but
only a third party repo it's probably created by just running createrepo_c which
does not create this file. We do not want to disable these repositories.
So instead check that repodata/repomd.xml file is present. Based on my
discussion with DNF/RPM developers it seems like the best approach.
Resolves: rhbz#1844287
Resolves: rhbz#1849093
Reported-by: Adam Williamson <awilliam@redhat.com>
---
pyanaconda/payload/image.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/payload/image.py b/pyanaconda/payload/image.py
index b76b33db40..4b6d0c7bb9 100644
--- a/pyanaconda/payload/image.py
+++ b/pyanaconda/payload/image.py
@@ -28,6 +28,7 @@
from blivet.size import Size
from pyanaconda import isys
+from pyanaconda.core.util import join_paths
from pyanaconda.errors import errorHandler, ERROR_RAISE, InvalidImageSizeError, MissingImageError
from pyanaconda.modules.common.constants.objects import DEVICE_TREE
from pyanaconda.modules.common.constants.services import STORAGE
@@ -129,16 +130,15 @@ def find_first_iso_image(path, mount_path="/mnt/install/cdimage"):
def verify_valid_installtree(path):
- """Check if the given path is a valid installtree repository
+ """Check if the given path is a valid installtree repository.
:param str path: install tree path
:returns: True if repository is valid false otherwise
:rtype: bool
"""
- # TODO: This can be enhanced to check for repodata folder.
- if os.path.exists(os.path.join(path, ".treeinfo")):
- return True
- elif os.path.exists(os.path.join(path, "treeinfo")):
+ repomd_path = join_paths(path, "repodata/repomd.xml")
+
+ if os.path.exists(repomd_path) and os.path.isfile(repomd_path):
return True
return False
1
https://gitee.com/yanan-rock/anaconda.git
git@gitee.com:yanan-rock/anaconda.git
yanan-rock
anaconda
anaconda
master

搜索帮助