Skip to content

Commit

Permalink
shadowmire.py: update to taoky/shadowmire@0a6a958
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Chen <[email protected]>
  • Loading branch information
Harry-Chen committed Aug 14, 2024
1 parent b4f0196 commit ecb6e46
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions shadowmire.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def do_update(
hrefs = get_existing_hrefs(package_simple_path)
existing_hrefs = [] if hrefs is None else hrefs
# Download JSON meta
file_url = urljoin(self.upstream, f"/json/{package_name}")
file_url = urljoin(self.upstream, f"json/{package_name}")
success, resp = download(
self.session, file_url, self.jsonmeta_dir / (package_name + ".new")
)
Expand All @@ -851,7 +851,7 @@ def do_update(
logger.info("removing file %s (if exists)", p)
package_path = Path(normpath(package_simple_path / p))
package_path.unlink(missing_ok=True)
package_simple_url = urljoin(self.upstream, f"/simple/{package_name}/")
package_simple_url = urljoin(self.upstream, f"simple/{package_name}/")
for href in remote_hrefs:
url = urljoin(package_simple_url, href)
dest = Path(normpath(package_simple_path / href))
Expand All @@ -871,12 +871,9 @@ def do_update(
# generate indexes
self.write_meta_to_simple(package_simple_path, meta)

last_serial = get_local_serial(package_simple_path)
if not last_serial:
logger.warning("cannot get valid package serial from %s", package_name)
else:
if use_db:
self.local_db.set(package_name, last_serial)
last_serial: int = meta["last_serial"]
if use_db:
self.local_db.set(package_name, last_serial)

return last_serial

Expand Down

0 comments on commit ecb6e46

Please sign in to comment.