Skip to content

Commit

Permalink
Fix repository format
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Nov 22, 2023
1 parent 7dc67f6 commit 3a84199
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tasks/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def run(
broken_packages = set()
failed_sources = set()

packages_cache = {}
libraries_cache = {}
packages_cache = []
libraries_cache = []

num_packages = 0
num_libraries = 0
Expand All @@ -151,7 +151,7 @@ def run(
except Exception as e:
print(f" Failed to fetch packages: {e}")
else:
packages_cache[repo_url] = packages
packages_cache.extend(packages)
if packages:
print(f" Fetched {len(packages)} packages.")
num_packages += len(packages)
Expand All @@ -161,7 +161,7 @@ def run(
except Exception as e:
print(f" Failed to fetch libraries: {e}")
else:
libraries_cache[repo_url] = libraries
libraries_cache.extend(libraries)
if libraries:
print(f" Fetched {len(libraries)} libraries.")
num_libraries += len(libraries)
Expand Down Expand Up @@ -211,6 +211,12 @@ def run(
duration = time.strftime("%H:%M:%S", time.gmtime(time.time() - begin_time))
print(f"Fetched {num_packages} packages and {num_libraries} libraries in {duration}.")

# drop sources lists as they are not valid in repositories
for cache in (packages_cache, broken_libraries):
for i in cache:
if "sources" in i:
del i["sources"]

json_content = json.dumps(
{
"$schema": "sublime://packagecontrol.io/schemas/repository",
Expand Down

0 comments on commit 3a84199

Please sign in to comment.