Anchor VERSION match on the Docker epoch to avoid distro-version hits - #571
Open
fudianchn wants to merge 1 commit into
Open
Anchor VERSION match on the Docker epoch to avoid distro-version hits#571fudianchn wants to merge 1 commit into
fudianchn wants to merge 1 commit into
Conversation
|
这是一封自动回复邮件。已经收到您的来信,我会尽快回复。
|
fudianchn
force-pushed
the
fix-version-selection-distro-match
branch
2 times, most recently
from
August 13, 2026 04:27
5a33dc2 to
7509207
Compare
…o-version hits Anchor the apt-cache madison grep on the version field separator with an optional Docker epoch (5:), so VERSION matches the start of the package version instead of the distro version inside the release suffix. Packages published before 18.03 carry no epoch and keep matching. Closes docker#526 Signed-off-by: 付典 <fudianchn@gmail.com>
fudianchn
force-pushed
the
fix-version-selection-distro-match
branch
from
August 15, 2026 15:19
7509207 to
47885b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Ubuntu noble,
VERSION=24.0installs the latest Docker (28.4.0) instead of the requested 24.0 (#526):The grep matches
VERSIONanywhere in the madison line, so24.0matches the24.04in5:28.4.0-1~ubuntu.24.04~noble, andhead -1then resolves to 28.4.0.Fix
Anchor the grep on the madison version field, with the Docker epoch (
5:) optional:Applied to both the
docker-ceanddocker-ce-clilookups. The version field always starts right after the|separator, so the pattern binds to the start of the package version and cannot match the distro version embedded in the release suffix. The epoch is optional because deb packages before 18.03 (17.x) were published without the5:epoch, and those pins keep working.Verification
Simulated
apt-cache madison docker-ceoutput (noble) with both 28.4.0 and 24.0.2 present,VERSION=24.0:grep '24.0'(before)5:28.4.0-1~ubuntu.24.04~noble(wrong: matched 24.04)grep -E ' \| (5:)?24.0'(after)5:24.0.9-1~ubuntu.24.04~noble(correct)grep -E ' \| (5:)?17.03'(after, pre-epoch package)17.03.2~ce-0~ubuntu-xenial(correct)And when 24.0 is genuinely unavailable, the anchored grep matches nothing -> the script hits its existing
ERROR: '$VERSION' not found amongst apt-cache madison resultspath and exits 1, instead of silently installing the latest.bash -n install.shpasses; the matching table above is produced by running the exact pipeline frominstall.shagainst the simulated madison output. The repository CI (including shellcheck) has not run on this fork PR yet and will execute once approved.Closes #526