From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0CD6B138334 for ; Thu, 24 Oct 2019 11:51:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0D854E0831; Thu, 24 Oct 2019 11:51:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B0F39E082B for ; Thu, 24 Oct 2019 11:51:15 +0000 (UTC) Received: from localhost.localdomain (c134-66.icpnet.pl [85.221.134.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id BDD9D34BFFE; Thu, 24 Oct 2019 11:51:13 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] glep-0075: Update for reference implementation Date: Thu, 24 Oct 2019 13:50:48 +0200 Message-Id: <20191024115048.7408-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.23.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 23274358-250f-435b-b86e-31c9e6e659eb X-Archives-Hash: 9c43506f8f9e1e56b774377d0551e69d 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 --- 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