]> pd.if.org Git - zpackage/commitdiff
remove unused elf tables, add elf summary view
authorNathan Wagner <nw@hydaspes.if.org>
Mon, 1 Oct 2018 16:27:25 +0000 (16:27 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 6 Oct 2018 18:25:42 +0000 (18:25 +0000)
db.sql
lib/zpm.c

diff --git a/db.sql b/db.sql
index 350bdd090b08d2102d4fd05ab9412249b8ed12b8..a9e2a5e0e10f4626003c227709b93658b5a29ad2 100644 (file)
--- a/db.sql
+++ b/db.sql
@@ -264,20 +264,13 @@ create table pathtags (
 without rowid
 ;
 
-create table elfinfo (
-       file    text primary key, -- hash of blob
-       elftype text
-)
-without rowid
-;
-
-create table elfdeps (
-       file    text,
-       soname  text,
-       dependency text,
-       primary key (file, soname, dependency)
-)
-without rowid
+create view elfdeps as
+select PF.pkgid, PF.status, PF.path, N.needed as needs,
+PL.path as library, PL.pkgid provider, PL.status as library_status
+from packagefiles_status PF
+join elfneeded N on N.file = PF.hash
+left join elflibraries L on N.needed = L.soname
+left join packagefiles_status PL on PL.hash = L.file
 ;
 
 -- TODO just elf information?
index b7d97776659c5c7b22bc6aec59462b2b2e58a138..50594477bc33cc59261a6f04102a21f4773b0134 100644 (file)
--- a/lib/zpm.c
+++ b/lib/zpm.c
@@ -562,10 +562,6 @@ static int set_elf_info(sqlite3 *db, char *hash, char *content, size_t length) {
                int rc;
 
                /* clear existing for this hash */
-               if (!run_for_hash(db, "delete from elfinfo where file = ?", hash)) {
-                       SQLERP(db, "error clearing elf info");
-                       return 0;
-               }
 
                if (!run_for_hash(db, "delete from elflibraries where file = ?", hash)) {
                        SQLERP(db, "error clearing elf library");