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 9A26E1382C5 for ; Thu, 25 Mar 2021 03:07:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC236E0798; Thu, 25 Mar 2021 03:07:47 +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 8807CE0798 for ; Thu, 25 Mar 2021 03:07:47 +0000 (UTC) Received: by mail-ej1-f53.google.com with SMTP id b7so565833ejv.1 for ; Wed, 24 Mar 2021 20:07:46 -0700 (PDT) X-Gm-Message-State: AOAM5320jd4pQ3MNxFBaLT8GIBOAbeT/73unilU8enIPex+gUeFNkb87 RfumEktzeSdsMswUWDG3CMh0F08dSilIN+RQf3s= X-Google-Smtp-Source: ABdhPJw8sU7VlUk4kTjqYyjym7F+yX+J5LczE0Qg862Ua9A82sMOPyL5qwU88jLpST62TWgAs5Y1eNVbsC8sld1PT3o= X-Received: by 2002:a17:906:51c3:: with SMTP id v3mr7041541ejk.497.1616641663229; Wed, 24 Mar 2021 20:07:43 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <20210224213026.1031-1-dilfridge@gentoo.org> In-Reply-To: From: Matt Turner Date: Wed, 24 Mar 2021 23:07:31 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-catalyst] [PATCH] Add option to generate BSD-style tagged hashes (can be verified by modern coreutils) To: gentoo-catalyst@lists.gentoo.org Cc: =?UTF-8?B?QW5kcmVhcyBLLiBIw7x0dGVs?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Archives-Salt: de266017-91f9-4914-beae-2619c319d7fc X-Archives-Hash: b27a0bb6998ad3899efee25471ed2a79 On Thu, Mar 18, 2021 at 7:40 AM Daniel Cordero wr= ote: > > On Wed, Feb 24, 2021 at 10:30:26PM +0100, Andreas K. H=C3=BCttel wrote: > > --- > > 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 =3D os.path.split(filepath)[1] > > - return f'# {name.upper()} HASH\n{h.hexdigest()} {filename}\n' > > + > > + if self.settings['digest_format'] =3D=3D 'bsd': > > GenBase.generate_hash is a @staticmethod, and no variable called 'self' > is passed to it: > > class GenBase(): > ... > @staticmethod > def generate_hash(filepath, name): > ... > > > Traceback (most recent call last): > File "/run/media/system/substrate/bindist/catalyst/bin/catalyst", line = 27, in > main(sys.argv[1:]) > File "/run/media/system/substrate/bindist/catalyst/catalyst/main.py", l= ine 256, in main > return _main(parser, opts) > File "/run/media/system/substrate/bindist/catalyst/catalyst/main.py", l= ine 366, in _main > success =3D build_target(addlargs) > File "/run/media/system/substrate/bindist/catalyst/catalyst/main.py", l= ine 79, in build_target > target =3D getattr(module, target)(conf_values, addlargs) > File "/run/media/system/substrate/bindist/catalyst/catalyst/targets/sta= ge1.py", line 24, in __init__ > StageBase.__init__(self, spec, addlargs) > File "/run/media/system/substrate/bindist/catalyst/catalyst/base/stageb= ase.py", line 183, in __init__ > self.set_source_path() > File "/run/media/system/substrate/bindist/catalyst/catalyst/base/stageb= ase.py", line 463, in set_source_path > self.generate_hash(self.settings["source_path"], "sha1") > File "/run/media/system/substrate/bindist/catalyst/catalyst/base/genbas= e.py", line 28, in generate_hash > if self.settings['digest_format'] =3D=3D 'bsd': > NameError: name 'self' is not defined > > > + return f'# {name.upper()} HASH\n{name.upper()} ({filename= }) =3D {h.hexdigest()}\n' > > + else: > > + return f'# {name.upper()} HASH\n{h.hexdigest()} {filenam= e}\n' > > > > def gen_contents_file(self, path): > > c =3D 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_O= PTIONS, LIST_XATTRS_OPTIONS > > valid_config_file_values =3D frozenset([ > > "compression_mode", > > "digests", > > + "digest_format", > > "distcc_hosts", > > "distdir", > > "envscript", > > @@ -35,6 +36,7 @@ confdefaults =3D { > > "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'], > > -- > > 2.30.1 > > > > I've fixed this. Not good...