public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Eli Schwartz <eschwartz@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 1/2] sec-keys.eclass: new eclass
Date: Thu, 28 Nov 2024 10:36:45 -0500	[thread overview]
Message-ID: <5abc6086-b2f8-4aa2-8298-a1a633586344@gentoo.org> (raw)
In-Reply-To: <ur06v8x3f@gentoo.org>


[-- Attachment #1.1: Type: text/plain, Size: 2526 bytes --]

On 11/28/24 5:35 AM, Ulrich Müller wrote:
>>>>>> On Wed, 27 Nov 2024, Eli Schwartz wrote:
> 
>> --- /dev/null
>> +++ b/eclass/sec-keys.eclass
>> @@ -0,0 +1,150 @@
>> +# Copyright 2024 Gentoo Authors
>> +# Distributed under the terms of the GNU General Public License v2
>> +
>> +# @ECLASS: sec-keys.eclass
>> +# @MAINTAINER:
>> +# Eli Schwartz <eschwartz@gentoo.org>
>> +# @AUTHOR:
>> +# Eli Schwartz <eschwartz@gentoo.org>
>> +# @SUPPORTED_EAPIS: 8
>> +# @BLURB: Provides a uniform way of handling ebuilds which package PGP key material
>> +# @DESCRIPTION:
>> +# This eclass provides a streamlined approach to finding suitable source material
>> +# for OpenPGP keys used by the verify-sig eclass. Its primary purpose is to permit
>> +# developers to easily and securely package new sec-keys/* packages. The eclass
>> +# removes the risk of developers accidentally packaging malformed key material, or
>> +# neglecting to notice when PGP identities have changed.
>> +#
>> +# To use the eclass, define SEC_KEYS_VALIDPGPKEYS to contain the fingerprint of
>> +# the key and the short name of the key's owner.
> 
> Please wrap these comment lines to a line length of 70-ish characters
> for readability.
> 
> Also, there should be two spaces after every full stop (except when it's
> followed by a newline), so groff can recognise the sentence end in the
> generated man page.


I usually do 80-ish for readability! Okay, I can do 70 too. :) Thanks
for the tip about the spaces, I don't usually write groff by hand.
Surprising that groff cannot handle this automatically, though.


>> +_sec_keys_set_globals() {
>> +	if [[ ${SEC_KEYS_VALIDPGPKEYS[*]} ]]; then
> 
> Why is the if needed? If the array is empty, the following for loop
> won't execute.


Not sure, perhaps an artifact of a previous revision that had different
handling. Let's remove it.


>> +	printf '%s\n' "${imported_keys[@]}" | sort > imported_keys.list || die
>> +	printf '%s\n' "${SEC_KEYS_VALIDPGPKEYS[@]%%:*}" | sort > allowed_keys.list || die
> 
> Maybe create these files in ${T} instead?


I'm not sure this is an important distinction. It's the main thing the
package works on. I could put GNUPGHOME in ${T} as well, if you like? :)

But keeping it in ${WORKDIR} makes it more straightforward for people to
look at manually when a failed build happens. And that's important when
dealing with the primary logic of a package (there's no source code to
compile here).



-- 
Eli Schwartz

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

      reply	other threads:[~2024-11-28 15:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27 20:30 [gentoo-dev] [PATCH 1/2] sec-keys.eclass: new eclass Eli Schwartz
2024-11-27 20:30 ` [gentoo-dev] [PATCH 2/2] sec-keys/openpgp-keys-gnutls: update to use sec-keys.eclass Eli Schwartz
2024-11-27 21:12 ` [gentoo-dev] [PATCH 1/2] sec-keys.eclass: new eclass Michał Górny
2024-11-27 21:52   ` Sam James
2024-11-28  4:24   ` Eli Schwartz
2024-11-27 21:57 ` Sam James
2024-11-28  4:17   ` Eli Schwartz
2024-11-28  4:32 ` [gentoo-dev] [PATCH v2 0/2] sec-keys.eclass Eli Schwartz
2024-11-28  4:32   ` [gentoo-dev] [PATCH v2 1/2] sec-keys.eclass: new eclass Eli Schwartz
2024-11-28 13:10     ` Michał Górny
2024-11-28 15:36       ` Eli Schwartz
2024-11-28 16:42         ` Michał Górny
2024-11-28 16:56         ` Sam James
2024-11-28 17:06           ` Michał Górny
2024-11-28 17:22             ` Sam James
2024-11-29 18:31         ` Robin H. Johnson
2024-11-29 19:02           ` Eli Schwartz
2024-11-29  7:30     ` Florian Schmaus
2024-11-28  4:32   ` [gentoo-dev] [PATCH v2 2/2] sec-keys/openpgp-keys-gnutls: update to use sec-keys.eclass Eli Schwartz
2024-11-28 10:35 ` [gentoo-dev] [PATCH 1/2] sec-keys.eclass: new eclass Ulrich Müller
2024-11-28 15:36   ` Eli Schwartz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5abc6086-b2f8-4aa2-8298-a1a633586344@gentoo.org \
    --to=eschwartz@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox