summaryrefslogtreecommitdiff
path: root/eclass/font.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
commit623ee73d661e5ed8475cb264511f683407d87365 (patch)
tree993eb27c93ec7a2d2d19550300d888fc1fed9e69 /eclass/font.eclass
parentceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (diff)
gentoo Easter resync : 12.04.2020
Diffstat (limited to 'eclass/font.eclass')
-rw-r--r--eclass/font.eclass36
1 files changed, 24 insertions, 12 deletions
diff --git a/eclass/font.eclass b/eclass/font.eclass
index 1287f2273454..bf24701f12fc 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: font.eclass
@@ -25,10 +25,10 @@ EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm
FONT_SUFFIX=${FONT_SUFFIX:-}
# @ECLASS-VARIABLE: FONT_S
-# @REQUIRED
+# @DEFAULT_UNSET
# @DESCRIPTION:
-# Space delimited list of directories containing the fonts.
-FONT_S=${FONT_S:-${S}}
+# Directory containing the fonts. If unset, ${S} is used instead.
+# Can also be an array of several directories.
# @ECLASS-VARIABLE: FONT_PN
# @DESCRIPTION:
@@ -159,27 +159,39 @@ font_pkg_setup() {
font_src_install() {
local dir suffix commondoc
- set -- ${FONT_S:-${S}}
- if [[ $# -gt 1 ]]; then
- # if we have multiple FONT_S elements then we want to recreate the dir
- # structure
+ if [[ $(declare -p FONT_S 2>/dev/null) == "declare -a"* ]]; then
+ # recreate the directory structure if FONT_S is an array
+ for dir in "${FONT_S[@]}"; do
+ pushd "${dir}" > /dev/null || die "pushd ${dir} failed"
+ insinto "${FONTDIR}/${dir#"${S}"}"
+ for suffix in ${FONT_SUFFIX}; do
+ doins *.${suffix}
+ done
+ font_xfont_config "${dir}"
+ popd > /dev/null || die
+ done
+ elif [[ ${FONT_S/ } != "${FONT_S}" ]]; then
+ # backwards compatibility code, can be removed after 2021-02-14
+ eqawarn "Using a space-separated list for FONT_S is deprecated."
+ eqawarn "Use a bash array instead if there are multiple directories."
for dir in ${FONT_S}; do
- pushd "${dir}" > /dev/null
+ pushd "${dir}" > /dev/null || die "pushd ${dir} failed"
insinto "${FONTDIR}/${dir//${S}/}"
for suffix in ${FONT_SUFFIX}; do
doins *.${suffix}
done
font_xfont_config "${dir}"
- popd > /dev/null
+ popd > /dev/null || die
done
else
- pushd "${FONT_S}" > /dev/null
+ pushd "${FONT_S:-${S}}" > /dev/null \
+ || die "pushd ${FONT_S:-${S}} failed"
insinto "${FONTDIR}"
for suffix in ${FONT_SUFFIX}; do
doins *.${suffix}
done
font_xfont_config
- popd > /dev/null
+ popd > /dev/null || die
fi
font_fontconfig