1 Packages are sqlite databases
3 get application id and userver
9 associate path with package
10 associate blob with path?
11 extract blob to a path
12 compare blob to filesystem path
13 create package with info
17 record elf information about blob
20 sign a package? What are we verifying?
27 files, just a table of file contents, hash to content,
28 avoids redundancy. possibly type? size? internal compression?
29 blobs might make more sense as a name.
31 package files: table of pathnames in a package, with metadata
32 file hash, type (directory, file, symlink, etc), permissions,
33 owner, group, acls?, config file, and package name...
37 mode integer, -- perms, use text for octal rep?
38 hash text, -- what should go here, null for dir
39 mtime integer -- seconds since epoch, but allow finer?
42 create table packagefiles (
44 subpackage text, -- libs, dev, client, server, whatever
46 filetype text -- e.g. config, etc?
49 -- TODO just elf information?
50 create table libraries (
57 create table librarydeps (
61 soname text -- soname of dependency
64 -- package scripts: table of package, stage, file
65 create table scripts (
71 -- package dependencies: table of package, dependency, dep type (package, soname)
72 create table packagedeps (
75 requires text, -- package name
76 subreq text, -- if requires only a sub package, probably most common for libs
82 create table provides (
85 label text -- a capability label
88 create table requires (
91 label text -- a capability label
94 create table packages (
96 version text, -- the upstream version string
97 release integer, -- the local release number
101 licenses text, -- hash of actual license? need table for more than one?
107 create table packagegroups (
112 packages: table of package info
113 name, version, release,
114 tied package? i.e. another package/version/release this one goes with.
116 Actual Package Install DB:
117 --------------------------
120 package, name, version, release, install ts, uninstall/upgrade ts
123 from package files table in package, plus install info
128 insert into DB.packages the package info from the .zpkg file, leave install date null
129 extract the pre-install script and run it. abort if exit failure
130 insert into the contents table info from the ZP.packagefiles table
131 for each file in the new contents, extract the file to a temporary location
132 in the same directory, rename into place, update as installed
133 for each file in the old contents, remove the file if it's not in the new contents
134 delete the row from the contents table
135 update the uninstall and install ts as a single transaction
136 extract and run post-install script
138 pre/post install scripts get arguments:
139 package name, new version, new release, old version, old release
140 old version/release only if upgrade.