* Updated French translation from Christian Perrier <bu...
[ntk/apt.git] / doc / apt-ftparchive.1.xml
CommitLineData
24f6490f
AL
1<?xml version="1.0" encoding="utf-8" standalone="no"?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4
5<!ENTITY % aptent SYSTEM "apt.ent">
6%aptent;
7
8]>
9
10<refentry>
11 &apt-docinfo;
12
13 <refmeta>
14 <refentrytitle>apt-ftparchive</refentrytitle>
15 <manvolnum>1</manvolnum>
16 </refmeta>
17
18 <!-- Man page title -->
19 <refnamediv>
20 <refname>apt-ftparchive</refname>
21 <refpurpose>Utility to generate index files</refpurpose>
22 </refnamediv>
23
24 <!-- Arguments -->
25 <refsynopsisdiv>
26 <cmdsynopsis>
27 <command>apt-ftparchive</command>
28 <arg><option>-hvdsq</option></arg>
29 <arg><option>--md5</option></arg>
30 <arg><option>--delink</option></arg>
31 <arg><option>--readonly</option></arg>
32 <arg><option>--contents</option></arg>
33 <arg><option>-o=<replaceable>config string</replaceable></option></arg>
34 <arg><option>-c=<replaceable>file</replaceable></option></arg>
35 <group choice="req">
36 <arg>packages<arg choice="plain" rep="repeat"><replaceable>path</replaceable></arg><arg><replaceable>override</replaceable><arg><replaceable>pathprefix</replaceable></arg></arg></arg>
37 <arg>sources<arg choice="plain" rep="repeat"><replaceable>path</replaceable></arg><arg><replaceable>override</replaceable><arg><replaceable>pathprefix</replaceable></arg></arg></arg>
38 <arg>contents <arg choice="plain"><replaceable>path</replaceable></arg></arg>
39 <arg>release <arg choice="plain"><replaceable>path</replaceable></arg></arg>
40 <arg>generate <arg choice="plain"><replaceable>config-file</replaceable></arg> <arg choice="plain" rep="repeat"><replaceable>section</replaceable></arg></arg>
41 <arg>clean <arg choice="plain"><replaceable>config-file</replaceable></arg></arg>
42 </group>
43 </cmdsynopsis>
44 </refsynopsisdiv>
45
46 <refsect1><title>Description</title>
47 <para><command>apt-ftparchive</command> is the command line tool that generates the index
48 files that APT uses to access a distribution source. The index files should
49 be generated on the origin site based on the content of that site.</para>
50
51 <para><command>apt-ftparchive</command> is a superset of the &dpkg-scanpackages; program,
52 incorporating its entire functionality via the <literal>packages</literal> command.
53 It also contains a contents file generator, <literal>contents</literal>, and an
54 elaborate means to 'script' the generation process for a complete
55 archive.</para>
56
57 <para>Internally <command>apt-ftparchive</command> can make use of binary databases to
58 cache the contents of a .deb file and it does not rely on any external
59 programs aside from &gzip;. When doing a full generate it automatically
60 performs file-change checks and builds the desired compressed output files.</para>
61
62 <para>Unless the <option>-h</option>, or <option>--help</option> option is given one of the
63 commands below must be present.</para>
64
65 <variablelist>
66 <varlistentry><term>packages</term>
67 <listitem><para>
68 The packages command generates a package file from a directory tree. It
69 takes the given directory and recursively searches it for .deb files,
70 emitting a package record to stdout for each. This command is
71 approximately equivalent to &dpkg-scanpackages;.</para>
72
73 <para>The option <option>--db</option> can be used to specify a binary caching DB.</para></listitem>
74 </varlistentry>
75
76 <varlistentry><term>sources</term>
77 <listitem><para>
78 The <literal>sources</literal> command generates a source index file from a directory tree.
79 It takes the given directory and recursively searches it for .dsc files,
80 emitting a source record to stdout for each. This command is approximately
81 equivalent to &dpkg-scansources;.</para>
82 <para>
83 If an override file is specified then a source override file will be
84 looked for with an extension of .src. The --source-override option can be
85 used to change the source override file that will be used.</para></listitem>
86 </varlistentry>
87
88 <varlistentry><term>contents</term>
89 <listitem><para>
90 The <literal>contents</literal> command generates a contents file from a directory tree. It
91 takes the given directory and recursively searches it for .deb files,
92 and reads the file list from each file. It then sorts and writes to stdout
93 the list of files matched to packages. Directories are not written to
94 the output. If multiple packages own the same file then each package is
95 separated by a comma in the output.</para>
96 <para>
97 The option <option>--db</option> can be used to specify a binary caching DB.</para></listitem>
98 </varlistentry>
99
100 <varlistentry><term>release</term>
101 <listitem><para>
102 The <literal>release</literal> command generates a Release file from a
103 directory tree. It recursively searches the given directory for
104 Packages, Packages.gz, Packages.bz2, Sources, Sources.gz,
105 Sources.bz2, Release and md5sum.txt files. It then writes to
106 stdout a Release file containing an MD5 digest and SHA1 digest
107 for each file.</para>
108 <para>
109 Values for the additional metadata fields in the Release file are
110 taken from the corresponding variables under
111 <literal>APT::FTPArchive::Release</literal>,
112 e.g. <literal>APT::FTPArchive::Release::Origin</literal>. The supported fields
113 are: <literal>Origin</literal>, <literal>Label</literal>, <literal>Suite</literal>,
114 <literal>Version</literal>, <literal>Codename</literal>, <literal>Date</literal>,
115 <literal>Architectures</literal>, <literal>Components</literal>, <literal>Description</literal>.</para></listitem>
116
117 </varlistentry>
118
119 <varlistentry><term>generate</term>
120 <listitem><para>
121 The <literal>generate</literal> command is designed to be runnable from a cron script and
122 builds indexes according to the given config file. The config language
123 provides a flexible means of specifying which index files are built from
124 which directories, as well as providing a simple means of maintaining the
125 required settings.</para></listitem>
126 </varlistentry>
127
128 <varlistentry><term>clean</term>
129 <listitem><para>
130 The <literal>clean</literal> command tidies the databases used by the given
131 configuration file by removing any records that are no longer necessary.</para></listitem>
132 </varlistentry>
133 </variablelist>
134 </refsect1>
135
136 <refsect1><title>The Generate Configuration</title>
137 <para>
138 The <literal>generate</literal> command uses a configuration file to describe the
139 archives that are going to be generated. It follows the typical ISC
140 configuration format as seen in ISC tools like bind 8 and dhcpd.
141 &apt-conf; contains a description of the syntax. Note that the generate
142 configuration is parsed in sectional manner, but &apt-conf; is parsed in a
143 tree manner. This only effects how the scope tag is handled.</para>
144
145 <para>
146 The generate configuration has 4 separate sections, each described below.</para>
147
148 <refsect2><title>Dir Section</title>
149 <para>
150 The <literal>Dir</literal> section defines the standard directories needed to
151 locate the files required during the generation process. These
152 directories are prepended to certain relative paths defined in later
153 sections to produce a complete an absolute path.</para>
154 <variablelist>
155 <varlistentry><term>ArchiveDir</term>
156 <listitem><para>
157 Specifies the root of the FTP archive, in a standard
158 Debian configuration this is the directory that contains the
159 <filename>ls-LR</filename> and dist nodes.</para></listitem>
160 </varlistentry>
161
162 <varlistentry><term>OverrideDir</term>
163 <listitem><para>
164 Specifies the location of the override files.</para></listitem>
165 </varlistentry>
166
167 <varlistentry><term>CacheDir</term>
168 <listitem><para>
169 Specifies the location of the cache files</para></listitem>
170 </varlistentry>
171
172 <varlistentry><term>FileListDir</term>
173 <listitem><para>
174 Specifies the location of the file list files,
175 if the <literal>FileList</literal> setting is used below.</para></listitem>
176 </varlistentry>
177 </variablelist>
178 </refsect2>
179
180 <refsect2><title>Default Section</title>
181 <para>
182 The <literal>Default</literal> section specifies default values, and settings
183 that control the operation of the generator. Other sections may override
184 these defaults with a per-section setting.</para>
185 <variablelist>
186 <varlistentry><term>Packages::Compress</term>
187 <listitem><para>
188 Sets the default compression schemes to use
189 for the Package index files. It is a string that contains a space
190 separated list of at least one of: '.' (no compression), 'gzip' and
191 'bzip2'. The default for all compression schemes is '. gzip'.</para></listitem>
192 </varlistentry>
193
194 <varlistentry><term>Packages::Extensions</term>
195 <listitem><para>
196 Sets the default list of file extensions that are package files.
197 This defaults to '.deb'.</para></listitem>
198 </varlistentry>
199
200 <varlistentry><term>Sources::Compress</term>
201 <listitem><para>
202 This is similar to <literal>Packages::Compress</literal>
203 except that it controls the compression for the Sources files.</para></listitem>
204 </varlistentry>
205
206 <varlistentry><term>Sources::Extensions</term>
207 <listitem><para>
208 Sets the default list of file extensions that are source files.
209 This defaults to '.dsc'.</para></listitem>
210 </varlistentry>
211
212 <varlistentry><term>Contents::Compress</term>
213 <listitem><para>
214 This is similar to <literal>Packages::Compress</literal>
215 except that it controls the compression for the Contents files.</para></listitem>
216 </varlistentry>
217
218 <varlistentry><term>DeLinkLimit</term>
219 <listitem><para>
220 Specifies the number of kilobytes to delink (and
221 replace with hard links) per run. This is used in conjunction with the
222 per-section <literal>External-Links</literal> setting.</para></listitem>
223 </varlistentry>
224
225 <varlistentry><term>FileMode</term>
226 <listitem><para>
227 Specifies the mode of all created index files. It
228 defaults to 0644. All index files are set to this mode with no regard
229 to the umask.</para></listitem>
230 </varlistentry>
231 </variablelist>
232 </refsect2>
233
234 <refsect2><title>TreeDefault Section</title>
235 <para>
236 Sets defaults specific to <literal>Tree</literal> sections. All of these
237 variables are substitution variables and have the strings $(DIST),
238 $(SECTION) and $(ARCH) replaced with their respective values.</para>
239
240 <variablelist>
241 <varlistentry><term>MaxContentsChange</term>
242 <listitem><para>
243 Sets the number of kilobytes of contents
244 files that are generated each day. The contents files are round-robined
245 so that over several days they will all be rebuilt.</para></listitem>
246 </varlistentry>
247
248 <varlistentry><term>ContentsAge</term>
249 <listitem><para>
250 Controls the number of days a contents file is allowed
251 to be checked without changing. If this limit is passed the mtime of the
252 contents file is updated. This case can occur if the package file is
253 changed in such a way that does not result in a new contents file
254 [override edit for instance]. A hold off is allowed in hopes that new
255 .debs will be installed, requiring a new file anyhow. The default is 10,
256 the units are in days.</para></listitem>
257 </varlistentry>
258
259 <varlistentry><term>Directory</term>
260 <listitem><para>
261 Sets the top of the .deb directory tree. Defaults to
262 <filename>$(DIST)/$(SECTION)/binary-$(ARCH)/</filename></para></listitem>
263 </varlistentry>
264
265 <varlistentry><term>SrcDirectory</term>
266 <listitem><para>
267 Sets the top of the source package directory tree. Defaults to
268 <filename>$(DIST)/$(SECTION)/source/</filename></para></listitem>
269 </varlistentry>
270
271 <varlistentry><term>Packages</term>
272 <listitem><para>
273 Sets the output Packages file. Defaults to
274 <filename>$(DIST)/$(SECTION)/binary-$(ARCH)/Packages</filename></para></listitem>
275 </varlistentry>
276
277 <varlistentry><term>Sources</term>
278 <listitem><para>
279 Sets the output Packages file. Defaults to
280 <filename>$(DIST)/$(SECTION)/source/Sources</filename></para></listitem>
281 </varlistentry>
282
283 <varlistentry><term>InternalPrefix</term>
284 <listitem><para>
285 Sets the path prefix that causes a symlink to be
286 considered an internal link instead of an external link. Defaults to
287 <filename>$(DIST)/$(SECTION)/</filename></para></listitem>
288 </varlistentry>
289
290 <varlistentry><term>Contents</term>
291 <listitem><para>
292 Sets the output Contents file. Defaults to
293 <filename>$(DIST)/Contents-$(ARCH)</filename>. If this setting causes multiple
294 Packages files to map onto a single Contents file (such as the default)
295 then <command>apt-ftparchive</command> will integrate those package files
296 together automatically.</para></listitem>
297 </varlistentry>
298
299 <varlistentry><term>Contents::Header</term>
300 <listitem><para>
301 Sets header file to prepend to the contents output.</para></listitem>
302 </varlistentry>
303
304 <varlistentry><term>BinCacheDB</term>
305 <listitem><para>
306 Sets the binary cache database to use for this
307 section. Multiple sections can share the same database.</para></listitem>
308 </varlistentry>
309
310 <varlistentry><term>FileList</term>
311 <listitem><para>
312 Specifies that instead of walking the directory tree,
313 <command>apt-ftparchive</command> should read the list of files from the given
314 file. Relative files names are prefixed with the archive directory.</para></listitem>
315 </varlistentry>
316
317 <varlistentry><term>SourceFileList</term>
318 <listitem><para>
319 Specifies that instead of walking the directory tree,
320 <command>apt-ftparchive</command> should read the list of files from the given
321 file. Relative files names are prefixed with the archive directory.
322 This is used when processing source indexs.</para></listitem>
323 </varlistentry>
324 </variablelist>
325 </refsect2>
326
327 <refsect2><title>Tree Section</title>
328 <para>
329 The <literal>Tree</literal> section defines a standard Debian file tree which
330 consists of a base directory, then multiple sections in that base
331 directory and finally multiple Architectures in each section. The exact
332 pathing used is defined by the <literal>Directory</literal> substitution variable.</para>
333 <para>
334 The <literal>Tree</literal> section takes a scope tag which sets the
335 <literal>$(DIST)</literal> variable and defines the root of the tree
336 (the path is prefixed by <literal>ArchiveDir</literal>).
337 Typically this is a setting such as <filename>dists/woody</filename>.</para>
338 <para>
339 All of the settings defined in the <literal>TreeDefault</literal> section can be
340 use in a <literal>Tree</literal> section as well as three new variables.</para>
341 <para>
342 When processing a <literal>Tree</literal> section <command>apt-ftparchive</command>
343 performs an operation similar to:
344<informalexample><programlisting>
345for i in Sections do
346 for j in Architectures do
347 Generate for DIST=scope SECTION=i ARCH=j
348</programlisting></informalexample></para>
349
350 <variablelist>
351 <varlistentry><term>Sections</term>
352 <listitem><para>
353 This is a space separated list of sections which appear
354 under the distribution, typically this is something like
355 <literal>main contrib non-free</literal></para></listitem>
356 </varlistentry>
357
358 <varlistentry><term>Architectures</term>
359 <listitem><para>
360 This is a space separated list of all the
361 architectures that appear under search section. The special architecture
362 'source' is used to indicate that this tree has a source archive.</para></listitem>
363 </varlistentry>
364
365 <varlistentry><term>BinOverride</term>
366 <listitem><para>
367 Sets the binary override file. The override file
368 contains section, priority and maintainer address information.</para></listitem>
369 </varlistentry>
370
371 <varlistentry><term>SrcOverride</term>
372 <listitem><para>
373 Sets the source override file. The override file
374 contains section information.</para></listitem>
375 </varlistentry>
376
377 <varlistentry><term>ExtraOverride</term>
378 <listitem><para>
379 Sets the binary extra override file.</para></listitem>
380 </varlistentry>
381
382 <varlistentry><term>SrcExtraOverride</term>
383 <listitem><para>
384 Sets the source extra override file.</para></listitem>
385 </varlistentry>
386 </variablelist>
387 </refsect2>
388
389 <refsect2><title>BinDirectory Section</title>
390 <para>
391 The <literal>bindirectory</literal> section defines a binary directory tree
392 with no special structure. The scope tag specifies the location of
393 the binary directory and the settings are similar to the <literal>Tree</literal>
394 section with no substitution variables or
395 <literal>Section</literal><literal>Architecture</literal> settings.</para>
396 <variablelist>
397 <varlistentry><term>Packages</term>
398 <listitem><para>
399 Sets the Packages file output.</para></listitem>
400 </varlistentry>
401
402 <varlistentry><term>SrcPackages</term>
403 <listitem><para>
404 Sets the Sources file output. At least one of
405 <literal>Packages</literal> or <literal>SrcPackages</literal> is required.</para></listitem>
406 </varlistentry>
407
408 <varlistentry><term>Contents</term>
409 <listitem><para>
410 Sets the Contents file output. (optional)</para></listitem>
411 </varlistentry>
412
413 <varlistentry><term>BinOverride</term>
414 <listitem><para>
415 Sets the binary override file.</para></listitem>
416 </varlistentry>
417
418 <varlistentry><term>SrcOverride</term>
419 <listitem><para>
420 Sets the source override file.</para></listitem>
421 </varlistentry>
422
423 <varlistentry><term>ExtraOverride</term>
424 <listitem><para>
425 Sets the binary extra override file.</para></listitem>
426 </varlistentry>
427
428 <varlistentry><term>SrcExtraOverride</term>
429 <listitem><para>
430 Sets the source extra override file.</para></listitem>
431 </varlistentry>
432
433 <varlistentry><term>BinCacheDB</term>
434 <listitem><para>
435 Sets the cache DB.</para></listitem>
436 </varlistentry>
437
438 <varlistentry><term>PathPrefix</term>
439 <listitem><para>
440 Appends a path to all the output paths.</para></listitem>
441 </varlistentry>
442
443 <varlistentry><term>FileList, SourceFileList</term>
444 <listitem><para>
445 Specifies the file list file.</para></listitem>
446 </varlistentry>
447 </variablelist>
448 </refsect2>
449 </refsect1>
450
451
452 <refsect1><title>The Binary Override File</title>
453 <para>The binary override file is fully compatible with &dpkg-scanpackages;. It
454 contains 4 fields separated by spaces. The first field is the package name,
455 the second is the priority to force that package to, the third is the
456 the section to force that package to and the final field is the maintainer
457 permutation field.</para>
458 <para>The general form of the maintainer field is:
459 <literallayout>old [// oldn]* => new</literallayout>
460 or simply,
461 <literallayout>new</literallayout>
462 The first form allows a double-slash separated list of old email addresses
463 to be specified. If any of those are found then new is substituted for the
464 maintainer field. The second form unconditionally substitutes the
465 maintainer field.</para>
466 </refsect1>
467
468
469 <refsect1><title>The Source Override File</title>
470 <para>
471 The source override file is fully compatible with &dpkg-scansources;. It
472 contains 2 fields separated by spaces. The first fields is the source
473 package name, the second is the section to assign it.</para>
474 </refsect1>
475
476 <refsect1><title>The Extra Override File</title>
477 <para>
478 The extra override file allows any arbitrary tag to be added or replaced
479 in the output. It has 3 columns, the first is the package, the second is
480 the tag and the remainder of the line is the new value.</para>
481 </refsect1>
482
483 <refsect1><title>options</title>
484 &apt-cmdblurb;
485
486 <variablelist>
487 <varlistentry><term><option>--md5</option></term>
488 <listitem><para>
489 Generate MD5 sums. This defaults to on, when turned off the generated
490 index files will not have MD5Sum fields where possible.
491 Configuration Item: <literal>APT::FTPArchive::MD5</literal></para></listitem>
492 </varlistentry>
493
494 <varlistentry><term><option>-d</option></term><term><option>--db</option></term>
495 <listitem><para>
496 Use a binary caching DB. This has no effect on the generate command.
497 Configuration Item: <literal>APT::FTPArchive::DB</literal>.</para></listitem>
498 </varlistentry>
499
500 <varlistentry><term><option>-q</option></term><term><option>--quiet</option></term>
501 <listitem><para>
502 Quiet; produces output suitable for logging, omitting progress indicators.
503 More q's will produce more quiet up to a maximum of 2. You can also use
504 <option>-q=#</option> to set the quiet level, overriding the configuration file.
505 Configuration Item: <literal>quiet</literal>.</para></listitem>
506 </varlistentry>
507
508 <varlistentry><term><option>--delink</option></term>
509 <listitem><para>
510 Perform Delinking. If the <literal>External-Links</literal> setting is used then
511 this option actually enables delinking of the files. It defaults to on and
512 can be turned off with <option>--no-delink</option>.
513 Configuration Item: <literal>APT::FTPArchive::DeLinkAct</literal>.</para></listitem>
514 </varlistentry>
515
516 <varlistentry><term><option>--contents</option></term>
517 <listitem><para>
518 Perform contents generation. When this option is set and package indexes
519 are being generated with a cache DB then the file listing will also be
520 extracted and stored in the DB for later use. When using the generate
521 command this option also allows the creation of any Contents files. The
522 default is on.
523 Configuration Item: <literal>APT::FTPArchive::Contents</literal>.</para></listitem>
524 </varlistentry>
525
526 <varlistentry><term><option>-s</option></term><term><option>--source-override</option></term>
527 <listitem><para>
528 Select the source override file to use with the <literal>sources</literal> command.
529 Configuration Item: <literal>APT::FTPArchive::SourceOverride</literal>.</para></listitem>
530 </varlistentry>
531
532 <varlistentry><term><option>--readonly</option></term>
533 <listitem><para>
534 Make the caching databases read only.
535 Configuration Item: <literal>APT::FTPArchive::ReadOnlyDB</literal>.</para></listitem>
536 </varlistentry>
537
538 &apt-commonoptions;
539
540 </variablelist>
541 </refsect1>
542
543<refsect1><title>Examples</title>
544
545<para>To create a compressed Packages file for a directory containing
546binary packages (.deb):
547
548<programlisting>
549<command>apt-ftparchive</command> packages <replaceable>directory</replaceable> | <command>gzip</command> > <filename>Packages.gz</filename>
550</programlisting></para>
551
552</refsect1>
553
554 <refsect1><title>See Also</title>
555 <para>&apt-conf;</para>
556 </refsect1>
557
558 <refsect1><title>Diagnostics</title>
559 <para><command>apt-ftparchive</command> returns zero on normal operation, decimal 100 on error.</para>
560 </refsect1>
561
562 &manbugs;
563 &manauthor;
564
565</refentry>