summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-03-31 08:06:04 +0100
committerSam James <sam@gentoo.org>2021-04-11 20:59:57 +0000
commita1c0c8e4cc2a6a95e459f81fec6d50860870a07c (patch)
tree7f88abaf7bb3bd864f0375ceb8082652ff69bb52
parentgnuconfig.eclass: provide basic @ECLASS block, docs (diff)
downloadgentoo-a1c0c8e4cc2a6a95e459f81fec6d50860870a07c.tar.gz
gentoo-a1c0c8e4cc2a6a95e459f81fec6d50860870a07c.tar.bz2
gentoo-a1c0c8e4cc2a6a95e459f81fec6d50860870a07c.zip
gnuconfig.eclass: use BDEPEND, BROOT where available (drop support for EAPI <5)
EPREFIX is only available in > EAPI 2 but let's take the opportuinty to clean up in general. We don't want to keep worrying about *very* old EAPI cases, especially given other eclasses either barely - or don't - support it. Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--eclass/gnuconfig.eclass31
1 files changed, 25 insertions, 6 deletions
diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
index 24f2714b6c18..173df6fd25e9 100644
--- a/eclass/gnuconfig.eclass
+++ b/eclass/gnuconfig.eclass
@@ -16,7 +16,13 @@
# other files that come with automake, e.g. depcomp, mkinstalldirs, etc.
#
-DEPEND="sys-devel/gnuconfig"
+case ${EAPI:-0} in
+ 5|6|7)
+ ;;
+ *)
+ die "EAPI ${EAPI} is unsupported!"
+ ;;
+esac
if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
_GNUCONFIG_CLASS=1
@@ -99,12 +105,25 @@ gnuconfig_do_update() {
# This searches the standard locations for the newest config.{sub|guess}, and
# returns the directory where they can be found.
gnuconfig_findnewest() {
- local locations=(
- "${EPREFIX}"/usr/share/misc/config.sub
- "${EPREFIX}"/usr/share/gnuconfig/config.sub
- "${EPREFIX}"/usr/share/automake*/config.sub
- "${EPREFIX}"/usr/share/libtool/config.sub
+ local locations=()
+ local prefix
+
+ case ${EAPI} in
+ 5|6)
+ prefix="${EPREFIX}"
+ ;;
+ *)
+ prefix="${BROOT}"
+ ;;
+ esac
+
+ locations+=(
+ "${prefix}"/usr/share/misc/config.sub
+ "${prefix}"/usr/share/gnuconfig/config.sub
+ "${prefix}"/usr/share/automake*/config.sub
+ "${prefix}"/usr/share/libtool/config.sub
)
+
grep -s '^timestamp' "${locations[@]}" | \
sort -r -n -t\' -k2 | \
sed -n '1{s,/config.sub:.*$,,;p;q}'