mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-17 06:11:35 +01:00
Updated for clean data
This commit is contained in:
parent
6ab626cab2
commit
36a6f444c4
3 changed files with 16 additions and 11 deletions
|
@ -47,8 +47,8 @@ Deletes all the downloaded SlackBuilds scripts and sources.
|
|||
.P
|
||||
.B -T, clean-data
|
||||
.RS
|
||||
Sometimes is necessary to clean all the data from the database.
|
||||
Run this command to drop all the tables from the database and run '\fIslpkg update\fR' to recreate.
|
||||
Sometimes is necessary to clean all the repositories data from the database.
|
||||
Run this command to delete all the data and run '\fIslpkg update\fR' to recreate.
|
||||
.RE
|
||||
.P
|
||||
.B -g, configs
|
||||
|
|
|
@ -27,18 +27,18 @@ class UpdateRepository(Configs, Utilities):
|
|||
|
||||
self.flags: list = flags
|
||||
self.session = Session
|
||||
self.view = ViewMessage(self.flags)
|
||||
|
||||
self.progress = ProgressBar()
|
||||
self.color = self.colour()
|
||||
|
||||
self.endc: str = self.color['endc']
|
||||
self.flag_generate: list = ['-G', '--generate-only']
|
||||
self.flag_drop_all: list = ['-A', '--drop-all']
|
||||
|
||||
def sbo(self) -> None:
|
||||
""" Updated the sbo repository. """
|
||||
view = ViewMessage(self.flags)
|
||||
|
||||
view.question()
|
||||
self.view.question()
|
||||
|
||||
if self.ponce_repo:
|
||||
|
||||
|
@ -125,9 +125,14 @@ class UpdateRepository(Configs, Utilities):
|
|||
self.session.query(SBoTable).delete()
|
||||
self.session.commit()
|
||||
|
||||
@staticmethod
|
||||
def drop_the_tables():
|
||||
def drop_the_tables(self):
|
||||
""" Drop all the tables from the database. """
|
||||
Base.metadata.drop_all(bind=engine, tables=[PonceTable.__table__,
|
||||
SBoTable.__table__,
|
||||
LogsDependencies.__table__])
|
||||
print('All the data from the database will be deleted.')
|
||||
self.view.question()
|
||||
|
||||
tables: list = [PonceTable.__table__,
|
||||
SBoTable.__table__]
|
||||
|
||||
Base.metadata.drop_all(bind=engine, tables=tables)
|
||||
|
||||
print("Successfully cleared!\n\nYou need to run 'slpkg update' now.")
|
||||
|
|
|
@ -48,7 +48,7 @@ class Usage(Configs):
|
|||
f' {self.cyan}-g, configs{self.endc} Edit the configuration file.\n'
|
||||
f' {self.cyan}-L, clean-logs{self.endc} Clean dependencies log tracking.\n'
|
||||
f' {self.cyan}-D, clean-tmp{self.endc} Delete all the downloaded sources.\n'
|
||||
f' {self.cyan}-T, clean-data{self.endc} Clean all the data from the database.\n'
|
||||
f' {self.cyan}-T, clean-data{self.endc} Clean all the repositories data.\n'
|
||||
f' {self.cyan}-b, build{self.endc} [packages...] Build only the packages.\n'
|
||||
f' {self.cyan}-i, install{self.endc} [packages...] Build and install the packages.\n'
|
||||
f' {self.cyan}-d, download{self.endc} [packages...] Download only the scripts and sources.\n'
|
||||
|
|
Loading…
Reference in a new issue