3 # garbage collect a package database
6 db=${1:-${ZPMDB:-/var/lib/zpm/local.db}}
9 echo must specify database file
16 # check for incorrect hash file content
18 # remove orphaned elf info
20 # remove failed packages
21 for pkg in $(zpm list -s failed); do
22 zpm log -i -a 'gc removing' -t "$pkg"
26 for pkg in $(zpm list -s dryrun); do
27 zpm log -i -a 'gc removing' -t "$pkg"
31 # remove incomplete packages
33 # remove outdated packages, unless preserved
34 # TODO need 'rstatus' flag
36 # remove removed packages, unless preserved
38 # remove orphaned rows in files table
39 # references in packagefiles, notes, scripts, possibly others
41 # remove old logs, given by date
45 # remove install history by date
47 # remove history for removed packages
49 # remove command history by date
51 # compactify the database file