Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the by-hash per-repository option (to support broken mirrors) #185

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chutzimir
Copy link
Contributor

@chutzimir chutzimir commented Dec 5, 2023

Closes #181

Allow ignoring by-hash for mirrors which announce it but do not support it

This adds support for by-hash as documented in man sources.list

By-Hash (by-hash) can have the value yes, no or force and controls if APT should try to acquire indexes via a URI constructed from a hashsum of the expected file instead of using the well-known stable filename of the index. Using this can avoid hashsum mismatches, but requires a supporting mirror. A yes or no value activates/disables the use of this feature if this source indicates support for it, while force will enable the feature regardless of what the source indicates. Defaults to the value of the option of the same name for a specific index file defined in the Acquire::IndexTargets scope, which itself defaults to the value of configuration option Acquire::By-Hash which defaults to yes.

Convert these to hashes so we can add fields when we need.
…rt it

This adds support for `by-hash` as documented in `man sources.list`

> By-Hash (`by-hash`) can have the value yes, no or force and controls
> if APT should try to acquire indexes via a URI constructed from a
> hashsum of the expected file instead of using the well-known stable
> filename of the index. Using this can avoid hashsum mismatches, but
> requires a supporting mirror. A yes or no value activates/disables the
> use of this feature if this source indicates support for it, while force
> will enable the feature regardless of what the source indicates.
> Defaults to the value of the option of the same name for a specific
> index file defined in the Acquire::IndexTargets scope, which itself
> defaults to the value of configuration option Acquire::By-Hash which
> defaults to yes.
This combination did not work previously:
```
no-hash=no,arch=amd64
```

With this fix the above, and the following three work:

```
arch=amd64
no-hash=no
arch=amd64,no-hash=no
```
@chutzimir chutzimir changed the title Add a config option to ignore the Acquire-By-Hash setting Add support for the by-hash per-repository option (to support broken mirrors) Dec 6, 2023
nE0sIghT added a commit to nE0sIghT/apt-mirror2 that referenced this pull request Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant