From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH] glep-0075: Update for reference implementation
Date: Thu, 24 Oct 2019 13:50:48 +0200 [thread overview]
Message-ID: <20191024115048.7408-1-mgorny@gentoo.org> (raw)
Fill in the reference implementation section. Reduce the requirements
for cutoffs to support only multiples of 4, as there is no point
in making the implementation more complex for something we aren't using
anyway. Fix a typo.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
glep-0075.rst | 38 +++++++++++++++++++++++++++++---------
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/glep-0075.rst b/glep-0075.rst
index 31553e7..4586463 100644
--- a/glep-0075.rst
+++ b/glep-0075.rst
@@ -7,8 +7,8 @@ Type: Standards Track
Status: Draft
Version: 1
Created: 2018-01-26
-Last-Modified: 2018-12-01
-Post-History: 2018-01-27
+Last-Modified: 2019-10-24
+Post-History: 2018-01-27, 2019-10-24
Content-Type: text/x-rst
---
@@ -100,11 +100,14 @@ and the policies for introducing new hashes are covered by GLEP 59
The cutoffs list specifies one or more integers separated by colons
(``:``), indicating the number of bits (starting with the most
significant bit) of the hash used to form subsequent subdirectory names.
-For example, the list of ``2:4`` would indicate that top-level directory
-names are formed using 2 most significant bits of the hash (resulting
-in 2² = 4 directories), and each of this directories would have
-subdirectories formed using the next 4 bits of the hash (resulting
-in 2⁴ = 16 subdirectories each).
+For example, the list of ``4:8`` would indicate that top-level directory
+names are formed using 4 most significant bits of the hash (resulting
+in 2⁴ = 16 directories), and each of this directories would have
+subdirectories formed using the next 8 bits of the hash (resulting
+in 2⁸ = 256 subdirectories each).
+
+The implementations are only required to support cutoffs being multiples
+of 4. Support for other values is optional.
The exact algorithm for determining the distfile location follows:
@@ -296,6 +299,16 @@ relatively low complexity and being reasonably future-proof.
(x — content checksum, + — filename checksum)
+Cutoff values
+-------------
+The original draft allowed any cutoff values. This was changed since
+multiples of 4 are much easier to implement — they can be trivially cut
+from hexadecimal representation of the hash value. This representation
+is commonly used by hash function implementations, including the Portage
+utility functions, pkgcore utility functions (snakeoil) and ``b2sum``
+utility from coreutils.
+
+
Layout file
-----------
The presence of control file has been suggested in the original
@@ -363,7 +376,14 @@ to an appropriate subdirectory.
Reference Implementation
========================
-TODO.
+The support for this specification has been implemented in Portage,
+as of version 2.3.77. This includes both fetching distfiles,
+and maintaining mirrors via ``emirrordist``. The implementation
+supports both listed layouts, with all hash functions supported
+by Portage and cutoffs being multiples of 4.
+
+As of 2019-10-18, the Gentoo Infrastructure team has successfully
+deployed the ``filename-hash BLAKE2B 8`` layout on Gentoo mirrors.
References
@@ -389,7 +409,7 @@ References
for each directory computed in a way to have the files distributed evenly'
(https://archives.gentoo.org/gentoo-dev/message/611bdaa76be049c1d650e8995748e7b8)
-.. [#PKGNAME] Jason Zamal's reply including 'using the same dir layout
+.. [#PKGNAME] Jason Zaman's reply including 'using the same dir layout
as the packages themselves)
(https://archives.gentoo.org/gentoo-dev/message/f26ed870c3a6d4ecf69a821723642975)
--
2.23.0
next reply other threads:[~2019-10-24 11:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 11:50 Michał Górny [this message]
2019-10-24 20:39 ` [gentoo-dev] [PATCH] glep-0075: Update for reference implementation Ulrich Mueller
2019-10-24 21:00 ` Hanno Böck
2019-10-25 6:26 ` Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191024115048.7408-1-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox