X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=db.sql;h=967cdb395390a8474aa37babf0295db76ddd630f;hb=b43ccedab337edb1d4c66cc1e65e2bfdf2d42a48;hp=48ff62587a052f0873fd9a1eb057e244aa396933;hpb=79885beec9c9d52d43d1c2dac0c981de280ac6f9;p=zpackage diff --git a/db.sql b/db.sql index 48ff625..967cdb3 100644 --- a/db.sql +++ b/db.sql @@ -278,6 +278,7 @@ create table elflibraries ( ) without rowid ; +create index elf_library_name_index on elflibraries(soname); create table elfneeded ( file text, -- hash of file @@ -287,6 +288,27 @@ create table elfneeded ( 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, @@ -373,6 +395,8 @@ create table repository ( priority integer not null default 1, refreshed integer -- last refresh time ); +-- force the url to be repourl/info.repo +-- package urls repourl/pkgid.zpm -- urls for downloading packages. possibly unneeded create table repository_packages ( @@ -570,4 +594,18 @@ union 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;