12 zpm-shell tmp/$PF < db.sql
14 okexit direct schema load || bailout 'cannot load schema'
19 pragma foreign_keys = off;
20 insert into packagefiles
21 (package,version,release,path,mode,username,groupname,hash)
23 ('foo','1',1,'/nopath','0644','root','root','fakehash')
25 } | zpm-shell $PF 2>/dev/null
27 okexit basic packagefile insert
30 pragma foreign_keys = off;
31 insert into packagefiles
32 (package,version,release,path,mode,username,groupname,hash)
34 ('foo','1',1,'/nopath','0644','root','root',NULL)
36 } | zpm-shell $PF 2>/dev/null
38 failsok regular with null hash rejected
41 pragma foreign_keys = off;
42 insert into packagefiles
43 (package,version,release,path,mode,username,groupname,hash)
45 ('foo','1',1,'/nopath','0644','root',NULL,'fakehash')
47 } | zpm-shell $PF 2>/dev/null
49 failsok null groupname rejected
51 #zpm-shell $PF '.tables'
54 pragma foreign_keys = off;
55 insert into packagefiles
56 (package,version,release,path,mode,username,groupname,hash)
58 ('foo','1',1,'/nopath','0644',NULL,'root','fakehash')
60 } | zpm-shell $PF 2>/dev/null
62 failsok null username rejected
64 # check the library logic
67 zpm-shell $PF "insert into packages (package,version,release,status)
68 values ('$1','$2',1,NULL)"
76 zpm-shell $PF "insert into packagefiles (package,version,release,path,hash)
77 values ('$1','$2',1,'$path','$hash');"
78 zpm-shell $PF "insert into elflibraries (file,soname)
79 values ('$hash','$soname');"
82 zpm-shell $PF "insert into elfneeded (file,needed)
83 values ('$hash','$dep');"
91 zpm-shell $PF "insert into packagefiles (package,version,release,path,hash)
92 values ('$1','$2',1,'$path','$hash');"
95 zpm-shell $PF "insert into elfneeded (file,needed)
96 values ('$hash','$dep');"
101 fakepkg foo 1.0 libfoo 1
102 fakepkg foo 2.0 libfoo 2
107 fakelib foo 1.0 foo 1 bar 1
108 fakelib foo 2.0 foo 2 bar 1
109 fakelib bar 1.0 bar 1
110 fakelib bar 2.0 bar 2
111 fakeprg hw 1.0 hw foo 1
112 fakeprg hw 2.0 hw foo 1
115 zpm-shell $PF 'select * from elfneeded'
117 zpm-shell $PF 'select * from elflibraries'