Don't delete updateinfo if it's same as new

This commit is contained in:
Mustafa Gezen 2023-02-04 01:50:40 +01:00
parent de3d7526f2
commit b8fa293e33
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1
1 changed files with 2 additions and 2 deletions

View File

@ -268,8 +268,8 @@ async def update_repomd_xml(repomd_xml_path: str, updateinfo: dict):
with open(repomd_xml_path, "w", encoding="utf-8") as f:
f.write(xml_str)
# Delete old updateinfo file
if existing_updateinfo_path:
# Delete old updateinfo file if not the same as the new one
if existing_updateinfo_path and existing_updateinfo_path != updateinfo_path:
try:
logger.info("Deleting %s", existing_updateinfo_path)
os.remove(existing_updateinfo_path)