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

[master] deb: move packaging revision before distro information #818

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jan 11, 2023

Commit f8299f2 introduced the $pkgRevision
in the package version, but we now actually had two separate escape hatches
for when we needed to do a packaging-only update; one before the packaging
version, and one after the distro-ID (VERSION_ID). The latter one was confusing,
as it appeared to be part of the distro-version (e.g. 22.04.0).

This patch removes the additional version, and moves it to the start, and updates
the default to use "1", which aligns with the "_release" used for RPM packages,
and may help with warnings that the package version is not an "upstream" (debian)
version.

Comparing same version old vs new (works because we now use 1 as default):

dpkg --compare-versions "23.0.0~rc.1-1~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-0~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
OK

Comparing newer version (new format) vs older version (old format) is ok:

dpkg --compare-versions "23.0.0~rc.2-1~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-0~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
OK

Comparing same version, but newer $pkgRevision (either new format <-> old-format,
or new-format <-> new-format) is also ok:

dpkg --compare-versions "23.0.0~rc.1-2~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-1~ubuntu.22.04~jammy" && echo "OK" || echo "KO"
OK

dpkg --compare-versions "23.0.0~rc.1-2~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-1~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
OK

@thaJeztah
Copy link
Member Author

For good measure, as I keep zooming in myself each time to spot ~ (tilde) vs - (hyphen); the format is:

23.0.0<tilde>rc.1-0<tilde>ubuntu.22.04<tilde>jammy

@thaJeztah
Copy link
Member Author

/cc @tianon @crazy-max

@crazy-max
Copy link
Member

Somewhat related, I recall I had created an issue on buildx-packaging repo about this: docker/packaging#85

Distro Release Filename
centos 7 docker-buildx-plugin-0.8.1-centos7.x86_64.rpm
centos 8 docker-buildx-plugin-0.8.1-centos8.x86_64.rpm
fedora 33 docker-buildx-plugin-0.8.1-fedora33.x86_64.rpm
fedora 34 docker-buildx-plugin-0.8.1-fedora34.x86_64.rpm
fedora 35 docker-buildx-plugin-0.8.1-fedora35.x86_64.rpm
fedora 36 docker-buildx-plugin-0.8.1-fedora36.x86_64.rpm
debian 10 docker-buildx-plugin_0.8.1-debian10_amd64.deb
debian 11 docker-buildx-plugin_0.8.1-debian11_amd64.deb
alpine r0 docker-buildx-plugin_0.8.1-r0_x86_64.apk
raspbian 10 docker-buildx-plugin_0.8.1-raspbian10_amd64.deb
raspbian 11 docker-buildx-plugin_0.8.1-raspbian11_amd64.deb
ubuntu 1804 docker-buildx-plugin_0.8.1-ubuntu1804_amd64.deb
ubuntu 2004 docker-buildx-plugin_0.8.1-ubuntu2004_amd64.deb
ubuntu 2110 docker-buildx-plugin_0.8.1-ubuntu2110_amd64.deb
ubuntu 2204 docker-buildx-plugin_0.8.1-ubuntu2204_amd64.deb

@thaJeztah
Copy link
Member Author

Ah!

cat > "debian/changelog" <<-EOF
$debSource (${EPOCH}${EPOCH_SEP}${DEB_VERSION}-0~${DISTRO}.${VERSION_ID}.${pkgRevision}~${SUITE}) $SUITE; urgency=low
$debSource (${EPOCH}${EPOCH_SEP}${DEB_VERSION}-${pkgRevision}~${DISTRO}.${VERSION_ID}~${SUITE}) $SUITE; urgency=low
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussing with Tianon; we can use 1 as default, which would align with the _release in the RPM packages (which are 1-based)

@tianon
Copy link
Contributor

tianon commented Jan 11, 2023

23.0.0<tilde>rc.1<hyphen>0<tilde>ubuntu.22.04<tilde>jammy is decent 🙂

replacing the 0 with 1 is also 100% sane and reasonable here
and even probably more correct

ie, 23.0.0<tilde>rc.1<hyphen>1<tilde>ubuntu.22.04<tilde>jammy

Commit f8299f2 introduced the `$pkgRevision`
in the package version, but we now actually had two separate escape hatches
for when we needed to do a packaging-only update; one before the packaging
version, and one after the distro-ID (VERSION_ID). The latter one was confusing,
as it appeared to be part of the distro-version (e.g. `22.04.0`).

This patch removes the additional version, and moves it to the start, and updates
the default to use "1", which aligns with the "_release" used for RPM packages,
and may help with warnings that the package version is not an "upstream" (debian)
version.

Comparing same version old vs new (works because we now use 1 as default):

    dpkg --compare-versions "23.0.0~rc.1-1~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-0~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
    OK

Comparing newer version (new format) vs older version (old format) is ok:

    dpkg --compare-versions "23.0.0~rc.2-1~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-0~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
    OK

Comparing same version, but newer $pkgRevision (either new format <-> old-format,
or new-format <-> new-format) is also ok:

    dpkg --compare-versions "23.0.0~rc.1-2~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-1~ubuntu.22.04~jammy" && echo "OK" || echo "KO"
    OK

    dpkg --compare-versions "23.0.0~rc.1-2~ubuntu.22.04~jammy" ">>" "23.0.0~rc.1-1~ubuntu.22.04.0~jammy" && echo "OK" || echo "KO"
    OK

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah changed the title [RFC] deb: move packaging revision before distro information [master] deb: move packaging revision before distro information Jan 11, 2023
@thaJeztah
Copy link
Member Author

@tianon updated 👍

@thaJeztah
Copy link
Member Author

Let me bring this one in; I'll push the same changes for plugins later

@thaJeztah thaJeztah merged commit ce7b189 into docker:master Jan 11, 2023
@thaJeztah thaJeztah deleted the move_pkgrevision branch January 11, 2023 18:19
@thaJeztah
Copy link
Member Author

Ah! Looks like I need to make some changes in our release-verify step in the release pipeline;

23:03:08 INFO: Searching repository for VERSION '23.0.0-rc.2'
23:03:08 INFO: apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2.*-0~debian' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
23:03:08 
23:03:08 ERROR: '23.0.0-rc.2' not found amongst apt-cache madison results

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.

3 participants