]> pd.if.org Git - zpackage/blobdiff - zpm-gc
switch to blake2
[zpackage] / zpm-gc
diff --git a/zpm-gc b/zpm-gc
index 2559f0d5724dbd4f7ac93bfaca1b5738a67dacd5..fdf8088b8c1abafa3f695b7b3ef30a0f7f23f996 100755 (executable)
--- 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