From 5dde1173016190c3db86a8834b8206552b09c942 Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Sat, 4 Feb 2023 01:54:32 +0100 Subject: [PATCH] Check against basename before deleting --- apollo/publishing_tools/apollo_tree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apollo/publishing_tools/apollo_tree.py b/apollo/publishing_tools/apollo_tree.py index 2a6dcdf..ca6148b 100644 --- a/apollo/publishing_tools/apollo_tree.py +++ b/apollo/publishing_tools/apollo_tree.py @@ -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)