Skip to content

[master] deb: fix plugin versions to have correct format for deb packages#820

Merged
thaJeztah merged 1 commit into
docker:masterfrom
thaJeztah:fix_buildx_version
Jan 11, 2023
Merged

[master] deb: fix plugin versions to have correct format for deb packages#820
thaJeztah merged 1 commit into
docker:masterfrom
thaJeztah:fix_buildx_version

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

We already had code for this in the RPM packages, but were missing this in the deb variants. Because of this, pre-release packages used a hyphen (-) as separator for pre-releases, which get sorted as a "higher" version than a non-pre-release:

dpkg --compare-versions "0.10.0" ">>" "0.10.0-rc2" && echo "OK" || echo "KO"
KO

With this patch, the packages have a correctly formatted version, using a tilde (~) as separator for the pre-release suffix:

make DOCKER_CLI_REF=f163d2441e214176db89c63ffc557012113e28d8 DOCKER_ENGINE_REF=9fd3a437a6027637301b0952f7578644d7dff321 VERSION=23.0.0-rc.2 ubuntu-jammy

tree deb/debbuild/
deb/debbuild/
└── ubuntu-jammy
    ├── docker-buildx-plugin_0.10.0~rc2~ubuntu-jammy_arm64.deb
    ├── docker-ce-cli_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
    ├── docker-ce-rootless-extras_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
    ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy.dsc
    ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy.tar.gz
    ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.buildinfo
    ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.changes
    ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
    └── docker-compose-plugin_2.15.1~ubuntu-jammy_arm64.deb

Using a tilde makes sure that pre-releases are sorted correctly:

dpkg --compare-versions "0.10.0" ">>" "0.10.0~rc2" && echo "OK" || echo "KO"
OK

The version reported through docker buildx version still uses the version as tagged in the repository (using a hyphen (-));

make IMAGE=ubuntu:jammy verify

+ verify_binaries
...
+ docker buildx version
github.com/docker/buildx v0.10.0-rc2 64e4c19
...

We already had code for this in the RPM packages, but were missing this
in the deb variants. Because of this, pre-release packages used a hyphen
(-) as separator for pre-releases, which get sorted as a "higher" version
than a non-pre-release:

    dpkg --compare-versions "0.10.0" ">>" "0.10.0-rc2" && echo "OK" || echo "KO"
    KO

With this patch, the packages have a correctly formatted version, using
a tilde (~) as separator for the pre-release suffix:

    make DOCKER_CLI_REF=f163d2441e214176db89c63ffc557012113e28d8 DOCKER_ENGINE_REF=9fd3a437a6027637301b0952f7578644d7dff321 VERSION=23.0.0-rc.2 ubuntu-jammy

    tree deb/debbuild/
    deb/debbuild/
    └── ubuntu-jammy
        ├── docker-buildx-plugin_0.10.0~rc2~ubuntu-jammy_arm64.deb
        ├── docker-ce-cli_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
        ├── docker-ce-rootless-extras_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy.dsc
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy.tar.gz
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.buildinfo
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.changes
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
        └── docker-compose-plugin_2.15.1~ubuntu-jammy_arm64.deb

Using a tilde makes sure that pre-releases are sorted correctly:

    dpkg --compare-versions "0.10.0" ">>" "0.10.0~rc2" && echo "OK" || echo "KO"
    OK

The version reported through `docker buildx version` still uses the version
as tagged in the repository (using a hyphen (-));

    make IMAGE=ubuntu:jammy verify

    + verify_binaries
    ...
    + docker buildx version
    github.com/docker/buildx v0.10.0-rc2 64e4c19
    ...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

@crazy-max @tianon ptal (one more change coming after this)

@thaJeztah
Copy link
Copy Markdown
Member Author

Thx! Let me get this one in, and work on the final bits 👍

@thaJeztah thaJeztah merged commit 4609f20 into docker:master Jan 11, 2023
@thaJeztah thaJeztah deleted the fix_buildx_version branch January 11, 2023 16:51
@thaJeztah thaJeztah changed the title deb: fix plugin versions to have correct format for deb packages [master] deb: fix plugin versions to have correct format for deb packages Jan 11, 2023
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.

2 participants