]> git.deb.at Git - deb/packages.git/blob - BACKEND
Packages needs libtimedate-perl
[deb/packages.git] / BACKEND
1 Most package data is available via sleepycat databases. Those have been
2 specifically crafted for efficient lookup, and reasonable times to generate
3 them, so that both the daily cronjobs and the actual pagerequests take only a
4 moderate amount of CPU and I/O
5
6 The only pages that are really generated staticly are the pages listing all
7 packages in a given section.
8
9
10 This is a brief overview of the available databases:
11
12 *********************************************************
13 Generated by means of Packages.gz files:
14 *********************************************************
15
16 | packages_small.db:
17 |  key: packagename
18 |  value: \0 separated tuples of "archive suite arch component section priority version shortdescription"
19 |          (so you can split on spaces in 8 pieces, but need to not split further
20 |          because shortdescription can have spaces)
21   Notes: - maybe add did right before shortdescription?
22                  - for each suite, newest package is shown first, and (suite,
23                    architecture) is unique, the newest one is choosen. Once you find
24                    the right suite, you know you've got the newest, once you found
25                    your (suite,arch), you know you've found the only unique such entry
26                  - The very first element is different (TODO: maybe should be
27                    different DB then?), a \01 separated hash of suite -> provided-by,
28                    like "suite1\01prov1 prov2\01suite2\01prov1"
29
30 | package_postfixes.db:
31 |  key: a postfix string of a package name
32 |  value: \0-separated list of prefixes that can preseed this postfix with '^'
33 |         instead of the empty string in case a postfix happens to (also?) be
34 |         a full package name
35  Note: value can also be \01<decimal number>, meaning there were <decimal
36  number> different packages with that postfix (always more than 100)
37
38 | packages_descriptions.db:
39 |  key: "packagename version arch"
40 |  value: a unique description id, did
41  
42 | descriptions.db:
43 |  key: did
44 |  value: description, first line being short, the rest being long [no
45 |            newline transformation]
46
47 | descriptions_packages.db:
48 |  key: did
49 |  value: one or more occurances of: "packagename version arch", separated by \0
50
51 | packages_all_$suite.db:
52 |  key: "packagename arch version"
53 |  value: \0-separated pairs of key\0value items, with key being always
54 |         lowercase and having most normal Packages.gz entries, except:
55 |         - source: always available, contains straight source package name
56 |         - description: has did (description id) only
57 |         - archive: notes source archive
58
59 | sources_packages.db:
60 |  key: sourcepackagename
61 |  value: \0 separated tuples of "archive suite package version arch"
62
63   Note: this also comes from the Packages.gz files, and not from Sources.gz
64   files, for accuracy.
65
66 *********************************************************
67 Generated by means of Sources.gz files:
68 *********************************************************
69
70 | sources_small.db:
71 |  key: sourcename
72 |  value: \0 separated tuples of "archive suite component section priority version"
73
74 | source_postfixes.db:
75 |  key: a postfix string of a source name
76 |  value: \0-separated list of prefixes that can preseed this postfix with '^'
77 |         instead of the empty string in case a postfix happens to (also?) be
78 |         a full package name
79  Note: value can also be \01<decimal number>, meaning there were <decimal
80  number> different packages with that postfix (always more than 100)
81
82 | sources_all_$suite.db:
83 |  key: "archive suite sourcename"
84 |  value: \0-separated pairs of key\0value items, with key being always
85 |         lowercase and having most normal Sources.gz entries, except:
86 |         - files: \01 separated list of "md5 size filename"
87   Note: different key from packages_all, is that needed?
88
89 *********************************************************
90 Generated by means of Contents-$arch.gz files:
91 *********************************************************
92
93 This one is tricky, because it deals with about 1G of raw uncompressed data
94 per suite. Not all data is updated every day though, so dealing with that
95 efficiently pays off.
96
97 Each sourcefile will create a filelists_$suite_$arch.db, with prefix
98 compression. The last updated one will have a symlink from _all.db to it, to
99 help filelist queries for 'all' packages.
100
101 reverse_$suite_$arch.txt will be the reversed pathnames for that file,
102 lowercased, sorted, with packagename:arch following it.
103
104 For each suite, the suite-wide indices can then be updated by reading the 11
105 or so reverse_$suite_$arch.txt in sorted order with sort -m. Same pathnames
106 can be put together, and stored in reverse_$suite.db; filenames are then also
107 incidently coming by grouped uniquely (but reverse sorted, not normal sorted),
108 and can be written out linearly to filenames_$suite.txt
109