without rowid
;
+create view package_libraries as
+select distinct PF.pkgid, EL.soname
+from packagefiles_pkgid PF join elflibraries EL on PF.hash = EL.file
+;
+
+create view package_libraries_needed as
+with pkglibs as (
+ select distinct EN.needed as soname, PF.pkgid
+ from elfneeded EN
+ join packagefiles_pkgid PF on PF.hash = EN.file
+ ),
+ pkgprovides as (
+ select distinct EL.soname, PF.pkgid
+ from elflibraries EL
+ join packagefiles_pkgid PF on PF.hash = EL.file
+ )
+ select distinct PL.pkgid,PL.soname, PP.soname is not null as selfsatisfied
+ from pkglibs PL
+ left join pkgprovides PP on PL.pkgid = PP.pkgid and PL.soname = PP.soname
+;
+
-- package scripts: table of package, stage, file
create table scripts (
package text,
select 'preserve' as op, *, null, null, null from preserve
;
+/*
+ * tables for repository info, essentially materalized views
+ */
+create table repository_libs (
+ pkgid text,
+ soname text
+);
+
+create table repository_libsneeded (
+ pkgid text,
+ soname text,
+ selfsat integer
+);
+
commit;