instructing the Acquire system to download the Packages files would look
like this (see also apt.conf(5) manpage for configuration file syntax):
- APT::Acquire::Targets::deb::Packages {
+ Acquire::IndexTargets::deb::Packages {
MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
ShortDescription "Packages";
- Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
+ Description "$(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
flatMetaKey "Packages";
- flatDescription "$(SITE) $(RELEASE) Packages";
+ flatDescription "$(RELEASE) Packages";
Optional "false";
};
All files which should be downloaded (nicknamed 'Targets') are mentioned
-below the APT::Acquire::Targets scope. 'deb' is here the type of the
+below the Acquire::IndexTargets scope. 'deb' is here the type of the
sources.list entry the file should be acquired for. The only other
supported value is hence 'deb-src'. Beware: You can't specify multiple
types here and you can't download the same (evaluated) MetaKey from
After the type you can pick any valid and unique string which preferable
refers to the file it downloads (In the example we picked 'Packages').
This string is used as identifier for the target class and accessible as
-'Created-By' e.g. in the "apt-get files" output as detailed below.
+'Created-By' e.g. in the "apt-get indextargets" output as detailed below.
All targets have three main properties you can define:
* MetaKey: The identifier of the file to be downloaded as used in the
of which file is acquired exactly. Mainly used for progress reporting
and error messages. apt will e.g. use this string in the Get/Hit/Err
progress lines.
+ An identifier of the site accessed as seen in the sources.list (e.g.
+ "http://example.org/debian" or "file:/path/to/a/repository") is
+ automatically prefixed for this property.
+
Additional optional properties:
* flat{MetaKey,Description}: APT supports two types of repositories:
use pdiff patching if provided by the repository and enabled by the
user. You only have to ensure that the Release file contains the
information about the compressed files/pdiffs to make this happen.
-NO properties have to be set to enable this.
+*NO* properties have to be set to enable this!
+
+
+Additional properties exist, but these should *NOT* be set by frontends
+requesting files. They exist for internal and end-user usage only:
+* PDiffs: controls if apt will try to use pdiffs for this target.
+ Defaults to the value of Acquire::PDiffs which is true by default.
+ Can be overridden per-source by the sources.list option of the same
+ name. See the documentation for both of these for details.
# More examples
The stanzas for Translation-* files as well as for Sources files would
look like this:
-APT::Acquire::Targets {
+Acquire::IndexTargets {
deb::Translations {
MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
ShortDescription "Translation-$(LANGUAGE)";
- Description "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
+ Description "$(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
flatMetaKey "$(LANGUAGE)";
- flatDescription "$(SITE) $(RELEASE) Translation-$(LANGUAGE)";
+ flatDescription "$(RELEASE) Translation-$(LANGUAGE)";
};
deb-src::Sources {
MetaKey "$(COMPONENT)/source/Sources";
ShortDescription "Sources";
- Description "$(SITE) $(RELEASE)/$(COMPONENT) Sources";
+ Description "$(RELEASE)/$(COMPONENT) Sources";
flatMetaKey "Sources";
- flatDescription "$(SITE) $(RELEASE) Sources";
+ flatDescription "$(RELEASE) Sources";
Optional "false";
};
unknown variables have no default value nor are they touched: They are
printed as-is.
-* $(SITE): An identifier of the site we access as seen in sources.list,
- e.g. "http://example.org/debian" or "file:/path/to/a/repository". You
- can't use this field in {,flat}MetaKey, it is for description proposes
- only.
* $(RELEASE): This is usually an archive- or codename, e.g. "stable" or
"stretch". Note that flat-style repositories do not have a archive-
or codename per-se, so the value might very well be just "/" or so.
rather than each and every one of them potentially downloads and uses
its own copy somewhere on disk.
-"apt-get files" can be used to get the location as well as other
+"apt-get indextargets" can be used to get the location as well as other
information about all files downloaded (aka: you will see Packages,
Sources and Translation-* files here as well). Provide a line of the
default output format as parameter to filter out all entries which do
uppercase and wrapped in $(), as in the configuration file.
To get all the filenames of all Translation-en files you can e.g. call:
- apt-get files --format '$(FILENAME)' "Created-By: Translations" "Language: en"
+ apt-get indextargets --format '$(FILENAME)' "Created-By: Translations" "Language: en"
+
+The line-based filtering and the formating is rather crude and feature-
+less by design, so it is recommend to use dedicated and more powerful
+tools like 'grep-dctrl'.
Accessing this information via libapt is done by reading the
sources.lists (pkgSourceList), iterating over the metaIndex objects this
creates and calling GetIndexTargets() on them. See the sourcecode of
-"apt-get files" for a complete example.
+"apt-get indextargets" for a complete example.
Note that by default targets are not listed if they weren't downloaded.
If you want to see all targets, you can use the --no-release-info, which