From c6a76af95b76c0049b246cb2b2a4519fa848f34e Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 17 Feb 2022 11:31:51 +0100 Subject: [PATCH] eclass/portability: Sync with gentoo It's from gentoo commit 5eae2995e46c6dc23f85bd0839eb9a1028ebea91. --- .../portage-stable/eclass/portability.eclass | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/portability.eclass b/sdk_container/src/third_party/portage-stable/eclass/portability.eclass index c56f03fb87..1cc36757b6 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/portability.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/portability.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: portability.eclass @@ -6,14 +6,19 @@ # base-system@gentoo.org # @AUTHOR: # Diego Pettenò +# @SUPPORTED_EAPIS: 5 6 7 # @BLURB: This eclass is created to avoid using non-portable GNUisms inside ebuilds +case ${EAPI:-0} in + [567]) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + if [[ -z ${_PORTABILITY_ECLASS} ]]; then _PORTABILITY_ECLASS=1 # @FUNCTION: treecopy # @USAGE: [orig2 orig3 ....] -# @RETURN: # @DESCRIPTION: # mimic cp --parents copy, but working on BSD userland as well treecopy() { @@ -67,8 +72,8 @@ seq() { # Screw it, do the output ourselves while :; do - [[ $max < $min && $step > 0 ]] && break - [[ $min < $max && $step < 0 ]] && break + [[ $max -lt $min && $step -gt 0 ]] && break + [[ $min -lt $max && $step -gt 0 ]] && break echo $min : $(( min += step )) done @@ -118,7 +123,6 @@ get_bmake() { # @FUNCTION: get_mounts # @USAGE: # @RETURN: table of mounts in form "point node fs opts" -# @MAINTAINER: # @DESCRIPTION: # Portable method of getting mount names and points. # Returns as "point node fs options"