add "equo database vacuum"
This tool is useful to shrink the client repository database by removing SQL indexes. Comes to help on ISO images creation
This commit is contained in:
@@ -205,6 +205,7 @@ myopts = [
|
||||
None,
|
||||
(1,'database',1,_('handles installed packages database')),
|
||||
(2,'check',2,_('check System Database for errors')),
|
||||
(2,'vacuum',2,_('remove System Database internal indexes to save space')),
|
||||
(2,'generate',1,'generate installed packages database using Portage database (Portage needed)'),
|
||||
(2,'resurrect',1,_('generate installed packages database using files on the system [last hope]')),
|
||||
(2,'depends',2,_('regenerate depends caching table')),
|
||||
|
||||
@@ -658,6 +658,18 @@ def database(options):
|
||||
return 0
|
||||
return 1
|
||||
|
||||
elif (options[0] == "vacuum"):
|
||||
|
||||
if Equo.clientDbconn != None:
|
||||
print_info(red(" @@ ")+"%s..." % (blue(_("Vacuum cleaning System Database")),), back = True)
|
||||
Equo.clientDbconn.dropAllIndexes()
|
||||
Equo.clientDbconn.vacuum()
|
||||
Equo.clientDbconn.commitChanges()
|
||||
print_info(red(" @@ ")+"%s." % (brown(_("Vacuum cleaned System Database")),))
|
||||
return 0
|
||||
print_warning(darkred(" !!! ")+blue("%s." % (_("No System Databases found"),)))
|
||||
return 1
|
||||
|
||||
else:
|
||||
return -10
|
||||
|
||||
|
||||
Reference in New Issue
Block a user