Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:catalyst-3.0-stable commit in: catalyst/base/, doc/
Date: Sat, 01 Oct 2022 16:20:23
Message-Id: 1664641177.804d9f20534d0bc504f873a893596f79c8837f46.dilfridge@gentoo
1 commit: 804d9f20534d0bc504f873a893596f79c8837f46
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 1 15:28:24 2022 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 1 16:19:37 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=804d9f20
7
8 catalyst: generate .sha256 file if any digest is enabled
9
10 Backport from master branch
11
12 checksum format is simple one, identical to one
13 sha256sum from coreutils produces, lines starting with # are ignored.
14
15 example:[1]
16
17 xxxx..... stage3-....tar.xz
18
19 systemd upstream calls it suse-style .sha256 files.[0]
20 infra already supports inline signing of files.
21
22 Bug: https://bugs.gentoo.org/821568
23 [0] https://github.com/systemd/systemd/blob/aedec452b9e5dd197881f2164fb205dfe8bfdcec/src/import/pull-common.c#L236
24 [1] https://mirrors.edge.kernel.org/opensuse/distribution/leap/15.0/iso/openSUSE-Leap-15.0-DVD-x86_64.iso.sha256
25 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
26 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
27
28 catalyst/base/genbase.py | 2 ++
29 doc/catalyst-config.5.txt | 3 ++-
30 2 files changed, 4 insertions(+), 1 deletion(-)
31
32 diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py
33 index 0909a475..94b02f26 100644
34 --- a/catalyst/base/genbase.py
35 +++ b/catalyst/base/genbase.py
36 @@ -52,3 +52,5 @@ class GenBase(object):
37 for j in array:
38 digest = hash_map.generate_hash(f, hash_=j)
39 myf.write(digest)
40 + with io.open(path + '.sha256', 'w', encoding='utf-8') as sha256file:
41 + sha256file.write(hash_map.generate_hash(path, hash_='sha256'))
42
43 diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
44 index 76ac4a29..ef52941e 100644
45 --- a/doc/catalyst-config.5.txt
46 +++ b/doc/catalyst-config.5.txt
47 @@ -55,7 +55,8 @@ Basic configuration
48 Create a `.DIGESTS` file containing the hash output from any of the
49 supported options below. Adding them all may take a long time.
50 (example: `md5 sha1 sha512 whirlpool`). See the *SUPPORTED HASHES*
51 -section for a list of supported hashes.
52 +section for a list of supported hashes. Enabling ANY digest will
53 +generate a `.sha256` file in addition to the `.DIGESTS` file.
54
55 *contents*::
56 Create a `.CONTENTS` file listing the contents of the file. If this