← Back to issue list

fix(deb): avoid re-downloading cached stage-packages

View original Github issue

Metadata

Project
craft-parts
Number
#1553
Type
pull request
State
open
Author
gcomneno
Labels
Created
2026-04-21 15:28:04+00:00
Updated
2026-05-21 12:40:36+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

## Summary Mitigate repeated `.deb` downloads from a warm cache in the `stage-packages` / apt-cache path. This wraps `package.candidate.fetch_binary(...)` with a narrow local patch for `apt.package._file_is_same`, using: - binary file mode - order-independent hash comparison so cached `.deb` files that already match the expected metadata are treated as cache hits. ## Context Refs #1495. This is intentionally scoped to the `stage-packages` / apt-cache download path. It is related to, but separate from, #1485, which reduces some `python-apt` usage in the installed-package check path. ## Testing - `ruff check craft_parts/packages/apt_cache.py tests/unit/packages/test_apt_cache.py` - `pytest -q tests/unit/packages/test_apt_cache.py -rs` - `pytest -q tests/unit/packages/test_deb.py -rs` - `pytest -q tests/unit/packages -rs`

Evaluation history

No evaluation history available.