fix matching of package versions on debian, ubuntu, and raspbian#330
Merged
Conversation
The version-format of the packages changed in the docker-ce-packaging repo; docker/docker-ce-packaging@39772a7 Which caused the script to fail when specifying a version: INFO: Searching repository for VERSION '23.0.0-rc.2' INFO: apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2.*-0~debian' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3 ERROR: '23.0.0-rc.2' not found amongst apt-cache madison results Looking at that search, it seemed like it was overly strict; - matching the distro (debian, ubuntu, or raspbian), which should not be needed, assuming the package repository has been set up correctly (which the script does in earlier steps). - matching the "0" prefix, which was intended to be used a package-revision (so to allow for packaging-only releases). That part definitely shouldn't be done, as it would not match later revisions (1, 2, 3) This patch simplifies the matching, and only searches for the package name, and the version specified, which should satisfy the requirement; apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3 5:23.0.0~rc.2-1~ubuntu.22.04~jammy apt-cache madison 'docker-ce-cli' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3 5:23.0.0~rc.2-1~ubuntu.22.04~jammy With this patch applied, the installation succeeds: cat install.sh | DOWNLOAD_URL=https://download-stage.docker.com CHANNEL=test VERSION=23.0.0-rc.2 REPO_FILE=docker-ce-staging.repo sh ... INFO: Searching repository for VERSION '23.0.0-rc.2' INFO: apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3 INFO: apt-cache madison 'docker-ce-cli' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3 + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce=5:23.0.0~rc.2-1~ubuntu.22.04~jammy docker-ce-cli=5:23.0.0~rc.2-1~ubuntu.22.04~jammy containerd.io docker-compose-plugin docker-scan-plugin docker-buildx-plugin >/dev/null Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
thx! bringing this one in, and I'll trigger a deploy of the script |
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.
The version-format of the packages changed in the docker-ce-packaging repo; docker/docker-ce-packaging@39772a7
Which caused the script to fail when specifying a version:
Looking at that search, it seemed like it was overly strict;
This patch simplifies the matching, and only searches for the package name, and the version specified, which should satisfy the requirement;
With this patch applied, the installation succeeds: