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:
Fabio Erculiani
2009-03-28 20:42:13 +01:00
parent 12b0696c56
commit a5569db021
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -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')),
+12
View File
@@ -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