Re: [gentoo-dev] Lua eclasses: support EAPI 8

2021-06-29 Thread Mike Gilbert
On Tue, Jun 29, 2021 at 2:55 PM William Hubbs  wrote:
>
> On Wed, Jun 16, 2021 at 10:34:18AM +0100, Marek Szuba wrote:
> > Nothing special here. RESTRICT manipulation in lua-utils still uses +=
> > on purpose, for consistency with how other variables are handled there
> > as well as in order to avoid wasting CPU cycles on an EAPI version
> > check for something that ultimately achieves the same.
>
> I was on vacation for a number of days so didn't have a chance to check
> on this.
>
> Is portage stable already supporting eapi 8? if so when did that happen?
> If not we can't support it in eclasses yet.

That's not true at all. You can't stabilize ebuilds with EAPI=8, but
there is no reason to hold off on merging eclass changes.



Re: [gentoo-dev] Lua eclasses: support EAPI 8

2021-06-29 Thread Ulrich Mueller
> On Tue, 29 Jun 2021, William Hubbs wrote:

> Is portage stable already supporting eapi 8? if so when did that
> happen?

portage-3.0.20 was the first version supporting EAPI 8, and 3.0.20-r6
is currently being stabilised. [1]

> If not we can't support it in eclasses yet.

I don't think that we ever had such a restriction. How would we test
support for a new EAPI in Portage, if we wouldn't allow ebuilds and
eclasses using it?

Ulrich

[1] https://bugs.gentoo.org/796503


signature.asc
Description: PGP signature


Re: [gentoo-dev] Lua eclasses: support EAPI 8

2021-06-29 Thread William Hubbs
On Wed, Jun 16, 2021 at 10:34:18AM +0100, Marek Szuba wrote:
> Nothing special here. RESTRICT manipulation in lua-utils still uses +=
> on purpose, for consistency with how other variables are handled there
> as well as in order to avoid wasting CPU cycles on an EAPI version
> check for something that ultimately achieves the same.

I was on vacation for a number of days so didn't have a chance to check
on this.

Is portage stable already supporting eapi 8? if so when did that happen?
If not we can't support it in eclasses yet.

Thanks,

William



signature.asc
Description: PGP signature


[gentoo-dev] [PATCH] verify-sig.eclass: Enable EAPI 8 support

2021-06-29 Thread Michał Górny
No changes beside EAPI guards, full eclass included for review
convenience.

Signed-off-by: Michał Górny 
---
 eclass/verify-sig.eclass | 16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index e3ef7f240283..7f89e5388ba3 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -1,271 +1,265 @@
-# Copyright 2020 Gentoo Authors
+# Copyright 2020-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: verify-sig.eclass
 # @MAINTAINER:
 # Michał Górny 
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: Eclass to verify upstream signatures on distfiles
 # @DESCRIPTION:
 # verify-sig eclass provides a streamlined approach to verifying
 # upstream signatures on distfiles.  Its primary purpose is to permit
 # developers to easily verify signatures while bumping packages.
 # The eclass removes the risk of developer forgetting to perform
 # the verification, or performing it incorrectly, e.g. due to additional
 # keys in the local keyring.  It also permits users to verify
 # the developer's work.
 #
 # To use the eclass, start by packaging the upstream's key
 # as app-crypt/openpgp-keys-*.  Then inherit the eclass, add detached
 # signatures to SRC_URI and set VERIFY_SIG_OPENPGP_KEY_PATH.  The eclass
 # provides verify-sig USE flag to toggle the verification.
 #
 # Example use:
 # @CODE
 # inherit verify-sig
 #
 # SRC_URI="https://example.org/${P}.tar.gz
 #   verify-sig? ( https://example.org/${P}.tar.gz.sig )"
 # BDEPEND="
 #   verify-sig? ( app-crypt/openpgp-keys-example )"
 #
 # VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/example.asc
 # @CODE
 
-case "${EAPI:-0}" in
-   0|1|2|3|4|5|6)
-   die "Unsupported EAPI=${EAPI} (obsolete) for ${ECLASS}"
-   ;;
-   7)
-   ;;
-   *)
-   die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
-   ;;
+case ${EAPI} in
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 EXPORT_FUNCTIONS src_unpack
 
 if [[ ! ${_VERIFY_SIG_ECLASS} ]]; then
 
 IUSE="verify-sig"
 
 BDEPEND="
verify-sig? (
app-crypt/gnupg
>=app-portage/gemato-16
)"
 
 # @ECLASS-VARIABLE: VERIFY_SIG_OPENPGP_KEY_PATH
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Path to key bundle used to perform the verification.  This is required
 # when using default src_unpack.  Alternatively, the key path can be
 # passed directly to the verification functions.
 
 # @ECLASS-VARIABLE: VERIFY_SIG_OPENPGP_KEYSERVER
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Keyserver used to refresh keys.  If not specified, the keyserver
 # preference from the key will be respected.  If no preference
 # is specified by the key, the GnuPG default will be used.
 
 # @ECLASS-VARIABLE: VERIFY_SIG_OPENPGP_KEY_REFRESH
 # @USER_VARIABLE
 # @DESCRIPTION:
 # Attempt to refresh keys via WKD/keyserver.  Set it to "yes"
 # in make.conf to enable.  Note that this requires working Internet
 # connection.
 : ${VERIFY_SIG_OPENPGP_KEY_REFRESH:=no}
 
 # @FUNCTION: verify-sig_verify_detached
 # @USAGE:   []
 # @DESCRIPTION:
 # Read the detached signature from  and verify  against
 # it.   can either be passed directly, or it defaults
 # to VERIFY_SIG_OPENPGP_KEY_PATH.  The function dies if verification
 # fails.
 verify-sig_verify_detached() {
local file=${1}
local sig=${2}
local key=${3:-${VERIFY_SIG_OPENPGP_KEY_PATH}}
 
[[ -n ${key} ]] ||
die "${FUNCNAME}: no key passed and VERIFY_SIG_OPENPGP_KEY_PATH 
unset"
 
local extra_args=()
[[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} == yes ]] || extra_args+=( -R )
[[ -n ${VERIFY_SIG_OPENPGP_KEYSERVER+1} ]] && extra_args+=(
--keyserver "${VERIFY_SIG_OPENPGP_KEYSERVER}"
)
 
# GPG upstream knows better than to follow the spec, so we can't
# override this directory.  However, there is a clean fallback
# to GNUPGHOME.
addpredict /run/user
 
local filename=${file##*/}
[[ ${file} == - ]] && filename='(stdin)'
einfo "Verifying ${filename} ..."
gemato gpg-wrap -K "${key}" "${extra_args[@]}" -- \
gpg --verify "${sig}" "${file}" ||
die "PGP signature verification failed"
 }
 
 # @FUNCTION: verify-sig_verify_message
 # @USAGE:   []
 # @DESCRIPTION:
 # Verify that the file ('-' for stdin) contains a valid, signed PGP
 # message and write the message into  ('-' for stdout).
 #  can either be passed directly, or it defaults
 # to VERIFY_SIG_OPENPGP_KEY_PATH.  The function dies if verification
 # fails.  Note that using output from  is important as it
 # prevents the injection of unsigned data.
 verify-sig_verify_message() {
local file=${1}
local output_file=${2}
local key=${3:-${VERIFY_SIG_OPENPGP_KEY_PATH}}
 
[[ -n ${key} ]] ||