-
Notifications
You must be signed in to change notification settings - Fork 24
/
catalog.txt
105 lines (74 loc) · 3.57 KB
/
catalog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
pkg
CATALOG AND INVENTORY OPERATIONS
[Suspended] Premise 1: From the client's perspective, the catalog is just
another package. (It's only special in that its contents drive
automatic package operations.)
Because we pull catalogs from multiple repositories, managing N
packages for N repositories seems overcomplicated.
Premise 2: From the server perspective, the catalog is a file whose
contents are updated as a result of the set of packaging operations that
have occurred within the server's repository. (No operation ever
affects the catalog directly.)
1. Server catalog
The primary content of the catalog is the relationships between
packages. We've already said that there are packages that depend on
other packages and packages that incorporate other packages. These
latter packages, the base- and stack-style packages, are really packages
that, in addition to listing a set of packages, also freeze those
packages, such that it takes a relaxation of the base/stack package for
the client to modify the incorporated packages.
The detailed manifest for each package contains the dependencies,
contents, and actions. But, as it seems that the set of incorporation
relationships are of particular interest for reporting and determining
package retrieval ordering, we place incorporation dependencies in the
catalog as well.
It's reasonably clear that the package repository needs to have
observations of package popularity, so that the most aged packages can
be purged, once unneeded.
2. Client catalog and client inventory
The client catalog is a compilation of package sourcing information from
a collection of repositories, in the form of one server catalog per
repository. Its purpose is to advertise what package versions are
"available", which means that it is the union of the repositories it
sources.
In contrast, the client inventory is the set of packages currently in an
installation state on the system, stored in some representation. One
form of this representation will be in the form of a server catalog.
The inventory is stored under
/var/pkg/db
If some instance of [email protected] is installed, we would have a directory
/var/pkg/db/pkg/[publisher?]/which/2.16
publisher
manifest
state
XXX Can we have two packages with the same name, but from different
publishers?
An open question is whether we store one or more reverse indices in the
inventory. We could have indices into basenames, pathnames, and
contents, which would look something like:
/var/pkg/db/index/
{basename,path}/
[escaped basename or full path]/
named links to content files
content/
[SHA1 hash of contents] -> package directory
Unfortunately, since FILE_MAX < PATH_MAX, the escaped representation for
full paths is insufficient, and we might need to provide a hash-based
directory name, and a metadata file with the full path.
2.1. Multiple catalogs
If a package is available from two or more repositories, we have a
choice: we can prefer a repository (as we would for a request for a
first installation of a package), or we can store both catalogue
entries.
In a directory-based approach, we might have
/var/pkg/catalog/repository_publisher/category/package/versions
with example
/var/pkg/catalog/pkg.opensolaris.org/application/which/2.16
/var/pkg/catalog/blueslugs.com/application/which/2.16
In a file-based approach, we would have
/var/pkg/catalog/[escaped_catalog_URL]
...
XXX Investigate efficiency of encoding versions as entries in
a file versus encoding as separate files
XXX Are FMRI-level categories actually a help, or is a detailed,
hierarchical namespace going to get in the way?