]> git.saurik.com Git - apt.git/blob - doc/acquire-additional-files.txt
ab833440b100f0e1ad0076f5d343725483d7635e
[apt.git] / doc / acquire-additional-files.txt
1 # Acquire additional files in 'update' operations
2
3 The download and verification of data from multiple sources in different
4 compression formats, with partial downloads and patches is an involved
5 process which is hard to implement correctly and securely.
6
7 APT frontends share the code and binaries to make this happen in libapt
8 with the Acquire system, supported by helpers shipped in the apt package
9 itself and additional transports in individual packages like
10 apt-transport-https.
11
12 For its own operation libapt needs or can make use of Packages, Sources
13 and Translation-* files, which it will acquire by default, but
14 a repository might contain more data files (e.g. Contents) a frontend
15 might want to use and would therefore need to be downloaded as well
16 (e.g. apt-file).
17
18 This file describes the configuration scheme such a frontend can use to
19 instruct the Acquire system to download those additional files.
20
21 Note that you can't download files from other sources. It must be files
22 in the same repository and below the Release file. The Release file must
23 also contain hashes for the file itself as well as for the compressed
24 file if wanted, otherwise a download isn't even tried!
25
26
27 # The Configuration Stanza
28
29 The Acquire system uses the same configuration settings to implement the
30 files it downloads by default. These settings are the default, but if
31 they would be written in a configuration file the configuration
32 instructing the Acquire system to download the Packages files would look
33 like this (see also apt.conf(5) manpage for configuration file syntax):
34
35 APT::Acquire::Targets::deb::Packages {
36 MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
37 ShortDescription "Packages";
38 Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
39
40 flatMetaKey "Packages";
41 flatDescription "$(SITE) $(RELEASE) Packages";
42
43 Optional "false";
44 };
45
46 All files which should be downloaded (nicknamed 'Targets') are mentioned
47 below the APT::Acquire::Targets scope. 'deb' is here the type of the
48 sources.list entry the file should be acquired for. The only other
49 supported value is hence 'deb-src'. Beware: You can't specify multiple
50 types here and you can't download the same MetaKey form multiple types!
51
52 After the type you can pick any valid and unique string which preferable
53 refers to the file it downloads (In the example we picked 'Packages').
54 This string is never shown or used.
55
56 All targets have three main properties you can define:
57 * MetaKey: The identifier of the file to be downloaded as used in the
58 Release file. It is also the relative location of the file from the
59 Release file. You can neither download from a different server
60 entirely (absolute URI) nor access directories above the Release file
61 (e.g. "../../").
62 * ShortDescription: Very short string intended to be displayed to the
63 user e.g. while reporting progress. apt will e.g. use this string in
64 the last line to indicate progress of e.g. the download of a specific
65 item.
66 * Description: A preferable human understandable and readable identifier
67 of which file is acquired exactly. Mainly used for progress reporting
68 and error messages. apt will e.g. use this string in the Get/Hit/Err
69 progress lines.
70
71 Additional optional properties:
72 * flat{MetaKey,Description}: APT supports two types of repositories:
73 dists-style repositories which are the default and by far the most
74 common which are named after the fact that the files are in an
75 elaborated directory structure. In contrast a flat-style repositories
76 lumps all files together in one directory. Support for these flat
77 repositories exists mainly for legacy purposes only. It is therefore
78 recommend to not set these values.
79 * Optional: The default value is 'true' and should be kept at this
80 value. If enabled the acquire system will skip the download if the
81 file isn't mentioned in the Release file. Otherwise this is treated as
82 a hard error and the update process fails.
83
84
85 Note that the acquire system will automatically choose to download
86 a compressed file if it is available and uncompress it for you, just as
87 it will also use pdiff patching if provided by the repository and
88 enabled by the user. You only have to ensure that the Release file
89 contains the information about the compressed files/pdiffs to make this
90 happen. NO properties have to be set to enable this.
91
92 # More examples
93
94 The stanzas for Translation-* files as well as for Sources files would
95 look like this:
96
97 APT::Acquire::Targets {
98 deb::Translations {
99 MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
100 ShortDescription "Translation-$(LANGUAGE)";
101 Description "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
102
103 flatMetaKey "$(LANGUAGE)";
104 flatDescription "$(SITE) $(RELEASE) Translation-$(LANGUAGE)";
105 };
106
107 deb-src::Sources {
108 MetaKey "$(COMPONENT)/source/Sources";
109 ShortDescription "Sources";
110 Description "$(SITE) $(RELEASE)/$(COMPONENT) Sources";
111
112 flatMetaKey "Sources";
113 flatDescription "$(SITE) $(RELEASE) Sources";
114
115 Optional "false";
116 };
117 };
118
119 # Substitution variables
120
121 As seen in the examples, properties can contain placeholders filled in
122 by the acquire system. The following variables are known; note that
123 unknown variables have no default value nor are they touched: They are
124 printed literally.
125
126 * $(SITE): An identifier of the site we access, e.g.
127 "http://example.org/".
128 * $(RELEASE): This is usually an archive- or codename, e.g. "stable" or
129 "stretch". Note that flat-style repositories do not have a archive-
130 or codename per-se, so the value might very well be just "/" or so.
131 * $(COMPONENT): as given in the sources.list, e.g. "main", "non-free" or
132 "universe". Note that flat-style repositories again do not really
133 have a meaningful value here.
134 * $(LANGUAGE): Values are all entries (expect "none") of configuration
135 option Acquire::Languages, e.g. "en", "de" or "de_AT".
136 * $(ARCHITECTURE): Values are all entries of configuration option
137 APT::Architectures (potentially modified by sources.list options),
138 e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src'
139 this variable has the value "source".