summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-emacs/puppet-mode/files/puppet-mode-0.3-version.patch20
-rw-r--r--eclass/eutils.eclass16
-rw-r--r--eclass/l10n.eclass53
-rw-r--r--eclass/rpm.eclass33
-rw-r--r--eclass/strip-linguas.eclass67
5 files changed, 98 insertions, 91 deletions
diff --git a/app-emacs/puppet-mode/files/puppet-mode-0.3-version.patch b/app-emacs/puppet-mode/files/puppet-mode-0.3-version.patch
deleted file mode 100644
index 513329dec1a2..000000000000
--- a/app-emacs/puppet-mode/files/puppet-mode-0.3-version.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/puppet-mode.el.~1~ 2014-03-13 16:30:50.000000000 +0100
-+++ b/puppet-mode.el 2017-06-30 14:38:22.749240233 +0200
-@@ -72,8 +72,6 @@
-
-
- ;;;; Requirements
--(require 'pkg-info)
--
- (require 'cl-lib)
- (require 'rx)
- (require 'align)
-@@ -165,7 +163,7 @@
- if called interactively, or if SHOW-VERSION is non-nil, otherwise
- just return nil."
- (interactive (list t))
-- (let ((version (pkg-info-version-info 'puppet-mode)))
-+ (let ((version "@VERSION@"))
- (when show-version
- (message "Puppet Mode version: %s" version))
- version))
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 2d90c35d9ade..207d05e7f975 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -23,12 +23,12 @@ if [[ -z ${_EUTILS_ECLASS} ]]; then
_EUTILS_ECLASS=1
# implicitly inherited (now split) eclasses
-case ${EAPI:-0} in
+case ${EAPI} in
5|6)
- inherit desktop edos2unix epatch estack l10n ltprune multilib \
- preserve-libs toolchain-funcs vcs-clean wrapper
+ inherit desktop edos2unix epatch estack ltprune multilib \
+ preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper
;;
- 7) inherit edos2unix l10n wrapper ;;
+ 7) inherit edos2unix strip-linguas wrapper ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -172,10 +172,9 @@ in_iuse() {
has "${flag}" "${liuse[@]#[+-]}"
}
-fi
+fi # EAPI 5
-case ${EAPI:-0} in
-5|6)
+if [[ ${EAPI} == [56] ]] ; then
# @FUNCTION: eqawarn
# @USAGE: [message]
@@ -190,7 +189,6 @@ if ! declare -F eqawarn >/dev/null ; then
}
fi
-;;
-esac
+fi # EAPI [56]
fi
diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass
index 5cf3931b7bf5..b1dff96ded12 100644
--- a/eclass/l10n.eclass
+++ b/eclass/l10n.eclass
@@ -15,11 +15,13 @@
# determining the cross-section between the user's set LINGUAS and what
# is offered by the package.
-case ${EAPI:-0} in
- [567]) ;;
+case ${EAPI} in
+ 5|6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+inherit strip-linguas
+
if [[ -z ${_L10N_ECLASS} ]]; then
_L10N_ECLASS=1
@@ -130,51 +132,4 @@ l10n_get_locales() {
printf "%s" "${locs}"
}
-# @FUNCTION: strip-linguas
-# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
-# @DESCRIPTION:
-# Make sure that LINGUAS only contains languages that a package can
-# support. The first form allows you to specify a list of LINGUAS.
-# The -i builds a list of po files found in all the directories and uses
-# the intersection of the lists. The -u builds a list of po files found
-# in all the directories and uses the union of the lists.
-strip-linguas() {
- local ls newls nols
- if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
- local op=$1; shift
- ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
- local d f
- for d in "$@" ; do
- if [[ ${op} == "-u" ]] ; then
- newls=${ls}
- else
- newls=""
- fi
- for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do
- if [[ ${op} == "-i" ]] ; then
- has ${f} ${ls} && newls="${newls} ${f}"
- else
- has ${f} ${ls} || newls="${newls} ${f}"
- fi
- done
- ls=${newls}
- done
- else
- ls="$@"
- fi
-
- nols=""
- newls=""
- for f in ${LINGUAS} ; do
- if has ${f} ${ls} ; then
- newls="${newls} ${f}"
- else
- nols="${nols} ${f}"
- fi
- done
- [[ -n ${nols} ]] \
- && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols}
- export LINGUAS=${newls:1}
-}
-
fi
diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass
index 351d7974877e..77db8e808796 100644
--- a/eclass/rpm.eclass
+++ b/eclass/rpm.eclass
@@ -4,11 +4,13 @@
# @ECLASS: rpm.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: convenience class for extracting RPMs
-case ${EAPI:-0} in
- [567]) inherit eutils ;;
+case ${EAPI} in
+ 5|6) inherit epatch eutils ;; # eutils for eqawarn
+ 7) inherit eutils ;; # not needed, but ebuilds may still rely on it
+ 8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -19,9 +21,9 @@ _RPM_ECLASS=1
inherit estack
-case "${EAPI:-0}" in
- [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
- *) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
+case ${EAPI} in
+ 5|6) DEPEND="app-arch/rpm2targz" ;;
+ *) BDEPEND="app-arch/rpm2targz" ;;
esac
# @FUNCTION: rpm_unpack
@@ -34,15 +36,16 @@ rpm_unpack() {
for a in "$@" ; do
echo ">>> Unpacking ${a} to ${PWD}"
if [[ ${a} == ./* ]] ; then
- : nothing to do -- path is local
- elif [[ ${a} == ${DISTDIR}/* ]] ; then
- ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you'
+ : # nothing to do -- path is local
+ elif [[ ${a} == "${DISTDIR}"/* ]] ; then
+ eqawarn 'do not use ${DISTDIR} with rpm_unpack -- it is added for you'
elif [[ ${a} == /* ]] ; then
- ewarn 'QA: do not use full paths with rpm_unpack -- use ./ paths instead'
+ eqawarn 'do not use full paths with rpm_unpack -- use ./ paths instead'
else
a="${DISTDIR}/${a}"
fi
- rpm2tar -O "${a}" | tar xf - || die "failure unpacking ${a}"
+ rpm2tar -O "${a}" | tar xf -
+ assert "failure unpacking ${a}"
done
}
@@ -64,9 +67,9 @@ srcrpm_unpack() {
# unpack everything
local a
- for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz,pxz} *.zip *.ZIP ; do
+ for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz} *.zip *.ZIP ; do
unpack "./${a}"
- rm -f "${a}"
+ rm -f "${a}" || die
done
eshopts_pop
@@ -90,11 +93,15 @@ rpm_src_unpack() {
# @FUNCTION: rpm_spec_epatch
# @USAGE: [spec]
+# @DEPRECATED: none
# @DESCRIPTION:
# Read the specified spec (defaults to ${PN}.spec) and attempt to apply
# all the patches listed in it. If the spec does funky things like moving
# files around, well this won't handle that.
rpm_spec_epatch() {
+ # no epatch in EAPI 7 and later
+ [[ ${EAPI} == [56] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}"
+
local p spec=$1
local dir
diff --git a/eclass/strip-linguas.eclass b/eclass/strip-linguas.eclass
new file mode 100644
index 000000000000..718341b4a626
--- /dev/null
+++ b/eclass/strip-linguas.eclass
@@ -0,0 +1,67 @@
+# Copyright 2004-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: strip-linguas.eclass
+# @MAINTAINER:
+# Ulrich Müller <ulm@gentoo.org>
+# @AUTHOR:
+# Mike Frysinger <vapier@gentoo.org>
+# @SUPPORTED_EAPIS: 5 6 7 8
+# @BLURB: convenience function for LINGUAS support
+
+case ${EAPI} in
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
+_STRIP_LINGUAS_ECLASS=1
+
+# @FUNCTION: strip-linguas
+# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
+# @DESCRIPTION:
+# Make sure that LINGUAS only contains languages that a package can
+# support. The first form allows you to specify a list of LINGUAS.
+# The -i builds a list of po files found in all the directories and uses
+# the intersection of the lists. The -u builds a list of po files found
+# in all the directories and uses the union of the lists.
+strip-linguas() {
+ local d f ls newls nols
+
+ if [[ $1 == "-i" ]] || [[ $1 == "-u" ]]; then
+ local op=$1; shift
+ ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
+ for d; do
+ if [[ ${op} == "-u" ]]; then
+ newls=${ls}
+ else
+ newls=""
+ fi
+ for f in $(find "${d}" -name '*.po' -exec basename {} .po ';'); do
+ if [[ ${op} == "-i" ]]; then
+ has ${f} ${ls} && newls+=" ${f}"
+ else
+ has ${f} ${ls} || newls+=" ${f}"
+ fi
+ done
+ ls=${newls}
+ done
+ else
+ ls="$@"
+ fi
+
+ nols=""
+ newls=""
+ for f in ${LINGUAS}; do
+ if has ${f} ${ls}; then
+ newls+=" ${f}"
+ else
+ nols+=" ${f}"
+ fi
+ done
+ [[ -n ${nols} ]] \
+ && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols}
+ export LINGUAS=${newls:1}
+}
+
+fi