summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2019-10-07 08:27:31 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2019-10-16 10:44:26 +0200
commit678696c203795311ce8756b04a2c1cbfefab49d9 (patch)
tree388e53ba3e0a7e9ce28542f166da61b749c05b36 /eclass/font.eclass
parentfont.eclass: Port to EAPI-7 (diff)
downloadgentoo-678696c203795311ce8756b04a2c1cbfefab49d9.tar.gz
gentoo-678696c203795311ce8756b04a2c1cbfefab49d9.tar.bz2
gentoo-678696c203795311ce8756b04a2c1cbfefab49d9.zip
font.eclass: Add error handling where applicable
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass/font.eclass')
-rw-r--r--eclass/font.eclass35
1 files changed, 20 insertions, 15 deletions
diff --git a/eclass/font.eclass b/eclass/font.eclass
index 18dcb3f14b41..f77f62291df8 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -68,16 +68,16 @@ font_xfont_config() {
local dir_name
if in_iuse X && use X ; then
dir_name="${1:-${FONT_PN}}"
- ebegin "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
- rm -f "${ED%/}/${FONTDIR}/${1//${S}/}"/{fonts.{dir,scale},encodings.dir}
- mkfontscale "${ED%/}/${FONTDIR}/${1//${S}/}"
+ rm -f "${ED%/}/${FONTDIR}/${1//${S}/}"/{fonts.{dir,scale},encodings.dir} \
+ || die "failed to prepare ${FONTDIR}/${1//${S}/}"
+ einfo "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
+ mkfontscale "${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.scale"
mkfontdir \
-e ${EPREFIX}/usr/share/fonts/encodings \
-e ${EPREFIX}/usr/share/fonts/encodings/large \
- "${ED%/}/${FONTDIR}/${1//${S}/}"
- eend $?
- if [[ -e fonts.alias ]] ; then
- doins fonts.alias
+ "${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir"
+ if [[ -e fonts.alias ]]; then
+ doins fonts.alias || die "failed to install fonts.alias" # TODO old EAPI cleanup
fi
fi
}
@@ -90,7 +90,9 @@ font_fontconfig() {
if [[ -n ${FONT_CONF[@]} ]]; then
insinto /etc/fonts/conf.avail/
for conffile in "${FONT_CONF[@]}"; do
- [[ -e ${conffile} ]] && doins ${conffile}
+ if [[ -e ${conffile} ]]; then
+ doins ${conffile} || die "failed to install conf file" # TODO old EAPI cleanup
+ fi
done
fi
}
@@ -132,11 +134,12 @@ font_cleanup_dirs() {
# media-fonts/font-alias. any other fonts.alias files will have
# already been unmerged with their packages.
for g in ${genfiles}; do
- [[ ${g} != fonts.alias && ( -e ${d}/${g} || -L ${d}/${g} ) ]] \
- && rm "${d}"/${g}
+ if [[ ${g} != fonts.alias && ( -e ${d}/${g} || -L ${d}/${g} ) ]] ; then
+ rm "${d}"/${g} || eerror "failed to remove ${d}/${g}"
+ fi
done
# if there's nothing left remove the directory
- find "${d}" -maxdepth 0 -type d -empty -exec rmdir '{}' \;
+ find "${d}" -maxdepth 0 -type d -empty -delete || eerror "failed to purge ${d}"
fi
done
eend 0
@@ -161,7 +164,9 @@ font_pkg_setup() {
# make sure we get no collisions
# setup is not the nicest place, but preinst doesn't cut it
- [[ -e "${EROOT%/}/${FONTDIR}/fonts.cache-1" ]] && rm -f "${EROOT%/}/${FONTDIR}/fonts.cache-1"
+ if [[ -e "${EROOT%/}/${FONTDIR}/fonts.cache-1" ]] ; then
+ rm "${EROOT%/}/${FONTDIR}/fonts.cache-1" || die "failed to remove fonts.cache-1"
+ fi
}
# @FUNCTION: font_src_install
@@ -178,7 +183,7 @@ font_src_install() {
pushd "${dir}" > /dev/null
insinto "${FONTDIR}/${dir//${S}/}"
for suffix in ${FONT_SUFFIX}; do
- doins *.${suffix}
+ doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup
done
font_xfont_config "${dir}"
popd > /dev/null
@@ -187,7 +192,7 @@ font_src_install() {
pushd "${FONT_S}" > /dev/null
insinto "${FONTDIR}"
for suffix in ${FONT_SUFFIX}; do
- doins *.${suffix}
+ doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup
done
font_xfont_config
popd > /dev/null
@@ -195,7 +200,7 @@ font_src_install() {
font_fontconfig
- [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; }
+ [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; } # TODO old EAPI cleanup
# install common docs
for commondoc in COPYRIGHT README{,.md,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt; do