summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2024-01-14 14:14:25 -0500
committerMichael Orlitzky <mjo@gentoo.org>2024-01-22 06:29:22 -0500
commitf2a9af36a8fa484a62b116d322a4c483a05407e6 (patch)
treea6821447ef67beca2247444739c0775095041340 /eclass
parentgap-pkg.eclass: improve comment about which docs we install (diff)
downloadgentoo-f2a9af36a8fa484a62b116d322a4c483a05407e6.tar.gz
gentoo-f2a9af36a8fa484a62b116d322a4c483a05407e6.tar.bz2
gentoo-f2a9af36a8fa484a62b116d322a4c483a05407e6.zip
gap-pkg.eclass: use nullglob instead of working around it
Suggested-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/gap-pkg.eclass26
1 files changed, 15 insertions, 11 deletions
diff --git a/eclass/gap-pkg.eclass b/eclass/gap-pkg.eclass
index ecb73a9e27d7..6f50444bfa12 100644
--- a/eclass/gap-pkg.eclass
+++ b/eclass/gap-pkg.eclass
@@ -46,6 +46,9 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+# For eshopts_push and eshopts_pop
+inherit estack
+
# Some packages have additional homepages, but pretty much every GAP
# package can be found at this URL.
HOMEPAGE="https://www.gap-system.org/Packages/${PN}.html"
@@ -292,6 +295,9 @@ gap-pkg_src_test() {
gap-pkg_src_install() {
einstalldocs
+ # So we don't have to "test -f" on the result of every glob.
+ eshopts_push -s nullglob
+
# Install the "normal" documentation from the doc directory. This
# includes anything the interactive GAP help might need in addition
# to the documentation intended for direct user consumption.
@@ -310,8 +316,7 @@ gap-pkg_src_install() {
# the bibliography is in BibXMLext format, but you may wind up
# with some additional GAPDoc (XML) source files as a result.
for f in *.{bib,lab,six,tex,txt,xml}; do
- # The -f test avoids needing nullglob when no files match.
- [[ -f "${f}" ]] && doins "${f}"
+ doins "${f}"
done
# The PDF docs are also potentially used by the interface, since
@@ -319,10 +324,8 @@ gap-pkg_src_install() {
# then afterwards we symlink them to their proper Gentoo
# locations
for f in *.pdf; do
- if [[ -f "${f}" ]]; then
- doins "${f}"
- dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/${f}"
- fi
+ doins "${f}"
+ dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/${f}"
done
popd > /dev/null || die
@@ -340,10 +343,8 @@ gap-pkg_src_install() {
# See above
for f in *.{htm,html,css,js,png}; do
- if [[ -f "${f}" ]]; then
- doins "${f}"
- dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/html/${f}"
- fi
+ doins "${f}"
+ dosym -r "${docdir}/${f}" "/usr/share/doc/${PF}/html/${f}"
done
popd > /dev/null || die
@@ -352,9 +353,12 @@ gap-pkg_src_install() {
# Any GAP source files that live in the top-level directory.
insinto $(gap-pkg_dir)
for f in *.g; do
- [[ -f "${f}" ]] && doins "${f}"
+ doins "${f}"
done
+ # We're done globbing
+ eshopts_pop
+
# The gap and lib dirs that usually also contain GAP code.
[[ -d gap ]] && doins -r gap
[[ -d lib ]] && doins -r lib