From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LU5V4-0006tL-0O for garchives@archives.gentoo.org; Mon, 02 Feb 2009 20:34:34 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24035E0117; Mon, 2 Feb 2009 20:34:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id EED74E0117 for ; Mon, 2 Feb 2009 20:34:30 +0000 (UTC) Received: from [192.168.22.10] (ip68-4-152-120.oc.oc.cox.net [68.4.152.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 783D164F95 for ; Mon, 2 Feb 2009 20:34:30 +0000 (UTC) Message-ID: <498758E6.5080609@gentoo.org> Date: Mon, 02 Feb 2009 12:34:46 -0800 From: Zac Medico User-Agent: Thunderbird 2.0.0.19 (X11/20081209) 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 MIME-Version: 1.0 To: Gentoo Dev Subject: [gentoo-dev] [RFC] DIGESTS metadata variable for cache validation X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 39436ca9-f89b-4481-8426-e79c20874db1 X-Archives-Hash: cfa80e33ee5fa6f854120ddfb9b468b3 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'd like to add a new metadata cache value called DIGESTS which will contain a space separated list of digests which can be used to validate the metadata cache. Like INHERITED and DEFINED_PHASES [1], it will be automatically generated. The first digest in the list will correspond to the ebuild. If there are any inherited eclasses, the digests of those eclasses will follow in a space separated list, in the same order that they occur in the INHERITED variable. The value of the DIGESTS variable will be on line 18 of the metadata cache (just after DEFINED_PHASES). For the digest format, I suggest that we use the leftmost 10 hexadecimal digits of the SHA-1 digest. The rationale for limiting it to 10 digits (out of 40) is to save space. Due to the avalanche effect [2], 10 digits should be sufficient to ensure that problems resulting from hash collisions are extremely unlikely. The primary reason to use a digest for cache validation instead of a timestamp is that it allows the cache validation mechanism to work even if the tree is distributed with a protocol that does not preserve timestamps, such as git or subversion. This would make it possible to distribute metadata cache directly from git and subversion repositories (among others). Since a digest is inherently more expensive to obtain than a timestamp, package managers may use the Manifest entries as a digest cache, in order to avoid the need to compute digests of ebuilds during dependency calculations. Does the suggested approach seem reasonable? Would anybody like to suggest any changes? [1] http://archives.gentoo.org/gentoo-dev/msg_8c34d8efbc0d31ab28c517403dc83f62.xml [2] http://en.wikipedia.org/wiki/Avalanche_effect - -- Thanks, Zac -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkmHWOQACgkQ/ejvha5XGaOJeQCgouZGO+pbOgJYkzssRVhzMDwt Cq4AoN6NG7SmJ6XjEked1WnZ+CJPXVWj =JSDL -----END PGP SIGNATURE-----