eclass/gnuconfig: Sync with Gentoo

It's from Gentoo commit 1bb3b5e672ba80e446b4c9dc27918a80c97c1be9.
This commit is contained in:
Flatcar Buildbot 2024-07-01 07:15:05 +00:00 committed by Mathieu Tortuyaux
parent c61ff0d71e
commit 6054a9fd55
No known key found for this signature in database
GPG Key ID: AC5CCFB52545D9B8

View File

@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors # Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnuconfig.eclass # @ECLASS: gnuconfig.eclass
@ -6,7 +6,7 @@
# Sam James <sam@gentoo.org> # Sam James <sam@gentoo.org>
# @AUTHOR: # @AUTHOR:
# Will Woods <wwoods@gentoo.org> # Will Woods <wwoods@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8 # @SUPPORTED_EAPIS: 6 7 8
# @BLURB: Refresh bundled gnuconfig files (config.guess, config.sub) # @BLURB: Refresh bundled gnuconfig files (config.guess, config.sub)
# @DESCRIPTION: # @DESCRIPTION:
# This eclass is used to automatically update files that typically come with # This eclass is used to automatically update files that typically come with
@ -17,16 +17,32 @@
# #
case ${EAPI:-0} in case ${EAPI:-0} in
5|6|7|8) ;; 6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac esac
if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
_GNUCONFIG_CLASS=1 _GNUCONFIG_CLASS=1
BDEPEND="sys-devel/gnuconfig" # @ECLASS_VARIABLE: GNUCONFIG_DEPEND
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Contains dependency on gnuconfig in *DEPEND format.
GNUCONFIG_DEPEND="sys-devel/gnuconfig"
[[ ${EAPI} == [56] ]] && DEPEND="${BDEPEND}" # @ECLASS_VARIABLE: GNUCONFIG_AUTO_DEPEND
# @PRE_INHERIT
# @DESCRIPTION:
# Set to 'no' to disable automatically adding to DEPEND. This lets
# ebuilds form conditional depends by using ${GNUCONFIG_DEPEND} in
# their own DEPEND string.
: "${GNUCONFIG_AUTO_DEPEND:=yes}"
if [[ ${GNUCONFIG_AUTO_DEPEND} != "no" ]] ; then
case ${EAPI} in
6) DEPEND=${GNUCONFIG_DEPEND} ;;
*) BDEPEND=${GNUCONFIG_DEPEND} ;;
esac
fi
# @FUNCTION: gnuconfig_update # @FUNCTION: gnuconfig_update
# @USAGE: [file1 file2 ...] # @USAGE: [file1 file2 ...]
@ -106,7 +122,7 @@ gnuconfig_findnewest() {
local prefix local prefix
case ${EAPI} in case ${EAPI} in
5|6) 6)
prefix="${EPREFIX}" prefix="${EPREFIX}"
;; ;;
*) *)