X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-gc;h=fdf8088b8c1abafa3f695b7b3ef30a0f7f23f996;hb=69491d14441cfc893e18e1c60c13c995b93002c9;hp=2559f0d5724dbd4f7ac93bfaca1b5738a67dacd5;hpb=09490cd2433e3c37a0d85220b4f12f01e6740d46;p=zpackage 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