app-emulation/containerd: fix cache problem

Prior to this, "${P}" would match upstream gentoo's distfile cache of
containerd, and that tarball would be used regardless of our SRC_URI
changing as we bumped the commit hash.

That resulted in us having an incorrect version of containerd installed
(and lying about the commit hash in --version to boot. Yikes!)

This fixes it by ensuring our package name actually uniquely identifies
the containerd package.

The choice to use the number of commits since the version as the patch
number is fairly arbitrary, but seemed like a sane and comparable number
to choose.
Due to containerd's somewhat fragile versioning, this number is not
technically unique (since there the v0.2.3 bump is commit to multiple
branches), but we can deal with issues if they happen.

Alternative fixes, such as FETCH_RESTRICT or other means of fooling the
cache logic, are more error prone and less faithful to portage's intent
that ${P} does uniquely identify an upstream source.

A different fix would be to use a CROS_WORKON style process for
containerd. There's no particular reason that approach is being avoided
other than the need to hack on containerd has so far been fairly small.
We can be more sloppy with versioning if/when we switch containerd over
to that process.

The choice to rename to 0.2.3 is because that commit (see
containerd/version.go) chooses to call itself 0.2.3, though it's newer
than the v0.2.5 tag. Docker 1.12 actually used a commit that contained
the 0.2.5 tag.
This commit is contained in:
Euan Kemp 2017-02-17 18:06:47 -08:00 committed by Euan Kemp
parent 5e273c5f26
commit f24eae8fde
3 changed files with 7 additions and 2 deletions

View File

@ -1 +1 @@
DIST containerd-0.2.5.tar.gz 1003500 SHA256 88e099af66b50abe7f2159f13bdab793fa5199d8d5b9a9ef7a68171abb4359be SHA512 ba1e074bb7556a7c4be4d68dc62aa2fa4b823682c209d1609c1f11518a7b7167139ea159d31e0b21ba190d83115a67e5e45b54b6a4770742d49e9e561309551f WHIRLPOOL eb3622ba99c4d4806bda9a45853422a5b0b884869ed3be4c3caec4c20f49027e8db78b9885eca7bc83a0f3b08e9a66eca950390f0eda1ef2535fd3ab41623bf4
DIST containerd-0.2.3_p85.tar.gz 1021240 SHA256 77ea44af1531d46b22f0444eb506590d1b7e5a9fe891cc6f8e36db5c2aef2d80 SHA512 df782f44f53a39dbec5be281c98b1457d86d902e44451b995c35143f843e0233ac72dfea44407e47a39931bbedfa0537cf0e597d68509e3ae21311be0cc20cd6 WHIRLPOOL 322a577ed865dcac7d1185b7f7e67e59190de9f8898c6e14b7b99ada2e069652d20723f5f746fbe476586a4a3d204dc1e0563f325ea4cc0aa968e26c09debf34

View File

@ -12,8 +12,13 @@ if [[ ${PV} == *9999 ]]; then
EGIT_REPO_URI="https://${GITHUB_URI}.git"
inherit git-r3
else
# Update the patch number when setting commit.
# The patch number is arbitrarily chosen as the number of commits since the
# tagged version.
# e.g. git log ${base_version}..${EGIT_COMMIT} --oneline | wc -l
# Note: 0.2.3 in the docker-1.13.x branch is not tagged, use 973f21f
EGIT_COMMIT="aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1"
SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
SRC_URI="https://${GITHUB_URI}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
KEYWORDS="amd64 arm64"
inherit vcs-snapshot
fi