mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-21 20:51:27 +00:00
Check against basename before deleting
This commit is contained in:
parent
b8fa293e33
commit
5dde117301
@ -269,7 +269,8 @@ async def update_repomd_xml(repomd_xml_path: str, updateinfo: dict):
|
||||
f.write(xml_str)
|
||||
|
||||
# Delete old updateinfo file if not the same as the new one
|
||||
if existing_updateinfo_path and existing_updateinfo_path != updateinfo_path:
|
||||
updinfo_base = os.path.basename(existing_updateinfo_path)
|
||||
if existing_updateinfo_path and updinfo_base != updateinfo_path:
|
||||
try:
|
||||
logger.info("Deleting %s", existing_updateinfo_path)
|
||||
os.remove(existing_updateinfo_path)
|
||||
|
Loading…
Reference in New Issue
Block a user