X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-gc;h=fdf8088b8c1abafa3f695b7b3ef30a0f7f23f996;hp=2559f0d5724dbd4f7ac93bfaca1b5738a67dacd5;hb=2ac486ab18adbbb84563eafc0d67fa8da6ca7822;hpb=4fb490d9107b747c86964d0d3925470b06d97c8c diff --git a/zpm-gc b/zpm-gc index 2559f0d..fdf8088 100755 --- a/zpm-gc +++ b/zpm-gc @@ -77,7 +77,20 @@ export ZPMDB # check for incorrect hash file content -# remove orphaned elf info +# removes old packages +zpm shell local.db.rehash "select package||'-'||version||'-'||release from package_age where age > 2 and status = 'updated'"|xargs -n1 zpm rmpackage -S installed -f local.db.rehash + +select +EL.file, PF.path, +PF.package || '-' || PF.version || '-' || PF.release as pkgid +from elfneeded EL +left join files F on F.hash = EL.file +left join packagefiles PF on PF.hash = EL.file +where F.hash is null +and EL.file is not null +and PF.path is not null +; + # remove failed packages for pkg in $(zpm list -s failed); do