From b9c6ac5c62b122e9ed8d8caade1820e50cf1ee3c Mon Sep 17 00:00:00 2001 From: taoky Date: Sat, 10 Aug 2024 19:39:00 +0800 Subject: [PATCH] Add verification for v1_html and symlink --- shadowmire.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shadowmire.py b/shadowmire.py index 08ecc14..604dc5e 100755 --- a/shadowmire.py +++ b/shadowmire.py @@ -491,14 +491,20 @@ class SyncBase: continue package_simple_path = self.simple_dir / package_name html_simple = package_simple_path / "index.html" + htmlv1_simple = package_simple_path / "index.v1_html" json_simple = package_simple_path / "index.v1_json" - if not (html_simple.exists() and json_simple.exists()): + if not ( + html_simple.exists() and json_simple.exists() and htmlv1_simple.exists() + ): logger.info( - "add %s as it does not have index.html or index.v1_json", + "add %s as it does not have index.html, index.v1_html or index.v1_json", package_name, ) to_update.append(package_name) continue + if not html_simple.is_symlink(): + html_simple.unlink() + html_simple.symlink_to("index.v1_html") hrefs_html = get_package_urls_from_index_html(html_simple) hrefsize_json = get_package_urls_size_from_index_json(json_simple) if (