From a19f606aad717fe5c9c69237c3af53feb547115e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 22 Feb 2023 14:14:52 +0100 Subject: Initial support for snapshot servers, apt --snapshot option Provide snapshot support for offical Debian and Ubuntu archives. There are two ways to enable snapshots for sources: 1. Add Snapshot: yes to your sources file ([snapshot=yes]). This will allow you to specify a snapshot to use when updating or installing using the --snapshot,-S option. 2. Add Snapshot: ID to your sources files to request a specific snapshot for this source. Snapshots are discovered using Label and Origin fields in the Release file of the main source, hence you need to have updated the source at least once before you can use snapshots. The Release file may also declare a snapshots server to use, similar to Changelogs, it can contain a Snapshots field with the values: 1. `Snapshots: https://example.com/@SNAPSHOTID@` where `@SNAPSHOTID@` is a placeholder that is replaced with the requested snapshot id 2. `Snapshots: no` to disable snapshot support for this source. Requesting snapshots for this source will result in a failure to load the source. The implementation adds a SHADOWED option to deb source entries, and marks the main entry as SHADOWED when a snapshot has been requested, which will cause it to be updated, but not included in the generated cache. The concern here was that we need to keep generating the shadowed entries because the cleanup in `apt update` deletes any files not queued for download, so we gotta keep downloading the main source. This design is not entirely optimal, but avoids the pitfalls of having to reimplement list cleanup. Gaps: - Ubuntu Pro repositories and PPAs are not yet supported. --- doc/apt.conf.5.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc/apt.conf.5.xml') diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 189fb7d7d..e815a58a1 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -211,6 +211,10 @@ APT::Compressor::rev { version is available. Contains release name, codename or release version. Examples: 'stable', 'testing', 'unstable', '&debian-stable-codename;', '&debian-testing-codename;', '4.0', '5.0*'. See also &apt-preferences;. + + Snapshot to use for all repositories configured with Snapshot: yes. See also &sources-list;, the option that sets this value, and below. + + Ignore held packages; this global option causes the problem resolver to @@ -647,6 +651,26 @@ APT::Compressor::rev { this source can't be used to acquire changelog files from. Another source will be tried if available in this case. + + + scope + + Like changelogs, snapshots can only be acquired if an URI is known from where to get them. + Preferable the Release file indicates this in a 'Snapshots' field. If this isn't + available the Label/Origin field of the Release file is used to check if a + Acquire::Snapshots::URI::Label::LABEL or + Acquire::Snapshots::URI::Origin::ORIGIN option + exists and if so this value is taken. The value in the Release file can be overridden + with Acquire::Snapshots::URI::Override::Label::LABEL + or Acquire::Snapshots::URI::Override::Origin::ORIGIN. + + The value should be a normal URI to a directory, except that the snapshot ID replaced with the + placeholder @SNAPSHOTID. + + The special value 'no' is available for this option indicating that + this source cannot be used to acquire snapshots from. Another source will be tried + if available in this case. + -- cgit v1.2.3-70-g09d2