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 A15EE1382C5 for ; Sun, 28 Feb 2021 14:40:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DA738E07AE; Sun, 28 Feb 2021 14:40:05 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 C190FE07AE for ; Sun, 28 Feb 2021 14:40:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0852D34109E for ; Sun, 28 Feb 2021 14:39:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 45BB64F1 for ; Sun, 28 Feb 2021 14:39:47 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1614202018.483385348b32fab2230f596816b6e1d0b6489962.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/genbase.py catalyst/defaults.py X-VCS-Directories: catalyst/base/ catalyst/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 483385348b32fab2230f596816b6e1d0b6489962 X-VCS-Branch: master Date: Sun, 28 Feb 2021 14:39:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 078c69b7-0b77-4a4b-9864-6a8de7b7a2d9 X-Archives-Hash: a339a5addd14856916b1e31b8d7272bb commit: 483385348b32fab2230f596816b6e1d0b6489962 Author: Andreas K. Hüttel gentoo org> AuthorDate: Wed Feb 24 21:26:58 2021 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Wed Feb 24 21:26:58 2021 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=48338534 Add option to generate BSD-style tagged hashes (can be verified by modern coreutils) Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/genbase.py | 6 +++++- catalyst/defaults.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index c7dd87bc..52418877 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -24,7 +24,11 @@ class GenBase(): h.update(data) filename = os.path.split(filepath)[1] - return f'# {name.upper()} HASH\n{h.hexdigest()} {filename}\n' + + if self.settings['digest_format'] == 'bsd': + return f'# {name.upper()} HASH\n{name.upper()} ({filename}) = {h.hexdigest()}\n' + else: + return f'# {name.upper()} HASH\n{h.hexdigest()} {filename}\n' def gen_contents_file(self, path): c = self.settings['contents_map'] diff --git a/catalyst/defaults.py b/catalyst/defaults.py index ccb0a584..2cede562 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -11,6 +11,7 @@ from DeComp.definitions import DECOMPRESSOR_PROGRAM_OPTIONS, LIST_XATTRS_OPTIONS valid_config_file_values = frozenset([ "compression_mode", "digests", + "digest_format", "distcc_hosts", "distdir", "envscript", @@ -35,6 +36,7 @@ confdefaults = { "compressor_options": XATTRS_OPTIONS['linux'], "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'], "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER, + "digest_format": 'linux', "distdir": portage.settings['DISTDIR'], "icecream": "/var/cache/icecream", 'list_xattrs_opt': LIST_XATTRS_OPTIONS['linux'],