eclass/gnuconfig: Sync with Gentoo

It's from Gentoo commit a1a498f47f0568471f944df8a96732c4dd8f6287.
This commit is contained in:
Krzesimir Nowak 2022-06-30 09:52:20 +02:00
parent 6d8c8b22d1
commit e5aa53ef82

View File

@ -1,14 +1,12 @@
# Copyright 1999-2021 Gentoo Authors # Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 0 and 4.
# @ECLASS: gnuconfig.eclass # @ECLASS: gnuconfig.eclass
# @MAINTAINER: # @MAINTAINER:
# Sam James <sam@gentoo.org> # Sam James <sam@gentoo.org>
# @AUTHOR: # @AUTHOR:
# Will Woods <wwoods@gentoo.org> # Will Woods <wwoods@gentoo.org>
# @SUPPORTED_EAPIS: 0 4 5 6 7 8 # @SUPPORTED_EAPIS: 5 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
@ -19,7 +17,7 @@
# #
case ${EAPI:-0} in case ${EAPI:-0} in
0|4|5|6|7|8) ;; 5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac esac
@ -28,7 +26,7 @@ if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
BDEPEND="sys-devel/gnuconfig" BDEPEND="sys-devel/gnuconfig"
[[ ${EAPI:-0} == [0456] ]] && DEPEND="${BDEPEND}" [[ ${EAPI} == [56] ]] && DEPEND="${BDEPEND}"
# @FUNCTION: gnuconfig_update # @FUNCTION: gnuconfig_update
# @USAGE: [file1 file2 ...] # @USAGE: [file1 file2 ...]
@ -86,9 +84,9 @@ gnuconfig_do_update() {
if [[ -n ${targetlist} ]] ; then if [[ -n ${targetlist} ]] ; then
for target in ${targetlist} ; do for target in ${targetlist} ; do
[[ -L ${target} ]] && rm -f "${target}" [[ -L ${target} ]] && rm -f "${target}"
einfo " Updating ${target/$startdir\//}" ebegin " Updating ${target/$startdir\//}"
cp -f "${configsubs_dir}/${file}" "${target}" cp -f "${configsubs_dir}/${file}" "${target}"
eend $? eend $? || die
done done
else else
ewarn " No ${file} found in ${startdir}, skipping ..." ewarn " No ${file} found in ${startdir}, skipping ..."
@ -107,8 +105,8 @@ gnuconfig_findnewest() {
local locations=() local locations=()
local prefix local prefix
case ${EAPI:-0} in case ${EAPI} in
0|4|5|6) 5|6)
prefix="${EPREFIX}" prefix="${EPREFIX}"
;; ;;
*) *)