apt-ftparchive.1.sgml 19 KB

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