Updated for remove local data

This commit is contained in:
Dimitris Zlatanidis 2023-04-10 22:14:33 +03:00
parent b6dd41b533
commit d1a965ddb2
2 changed files with 18 additions and 0 deletions

View file

@ -7,6 +7,7 @@ Fixed:
- Alignment for package name and version
Added:
- Slots '__slots__' to improve speed
- Remove local repository data
4.7.6 - 04/04/2023
Fixed:

View file

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
import shutil
from pathlib import Path
from multiprocessing import Process, Queue
@ -667,4 +668,20 @@ class UpdateRepository(Configs):
]
Base.metadata.drop_all(bind=engine, tables=tables)
# Deletes local downloaded data.
self.delete_repositories_data()
print("Successfully cleared!\n\nYou need to run 'slpkg update' now.")
def delete_repositories_data(self):
""" Deletes local folders with the repository downloaded data. """
for repo in self.repos.repositories.keys():
repo_path: Path = Path(self.repos.repositories_path, repo)
if repo_path.exists():
shutil.rmtree(repo_path)
print(f"Deleted: '{repo_path}'")
print() # new line at the end