mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-19 10:27:07 +01:00
Updated for remove local data
This commit is contained in:
parent
b6dd41b533
commit
d1a965ddb2
2 changed files with 18 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue