From a8aeaf6e851490861d97b8c5f5e64704d6914fd1 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 22 Sep 2018 16:02:26 +0800 Subject: [PATCH] dev-lang/GHC: fix manpage alternatives --- packages/dev-lang/GHC/GHC-8.2.2-r1.exheres-0 | 14 ++++++++++++++ packages/dev-lang/GHC/GHC-8.4.3-r1.exheres-0 | 19 ++++++++++--------- packages/dev-lang/GHC/GHC-8.6.1.exheres-0 | 18 ++++++++++-------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/packages/dev-lang/GHC/GHC-8.2.2-r1.exheres-0 b/packages/dev-lang/GHC/GHC-8.2.2-r1.exheres-0 index 363554b4..3deb8ccd 100644 --- a/packages/dev-lang/GHC/GHC-8.2.2-r1.exheres-0 +++ b/packages/dev-lang/GHC/GHC-8.2.2-r1.exheres-0 @@ -160,6 +160,20 @@ src_install() { /usr/$(exhost --target)/bin/hsc2hs{,-${SLOT}} \ /usr/$(exhost --target)/bin/runghc{,-${SLOT}} \ /usr/$(exhost --target)/bin/runhaskell /usr/$(exhost --target)/bin/runghc-${SLOT} + + if [[ -d ${IMAGE}/usr/share/man ]]; then + local file alternatives=() + for file in "${IMAGE}"/usr/share/man/*/*; do + alternatives+=( + ${file#${IMAGE}} + ${file#${IMAGE}}-${SLOT} + ) + done + + alternatives_for \ + ghc ${SLOT} ${SLOT} \ + "${alternatives[@]}" + fi } src_test_expensive() { diff --git a/packages/dev-lang/GHC/GHC-8.4.3-r1.exheres-0 b/packages/dev-lang/GHC/GHC-8.4.3-r1.exheres-0 index 21e5dad1..b8a724d8 100644 --- a/packages/dev-lang/GHC/GHC-8.4.3-r1.exheres-0 +++ b/packages/dev-lang/GHC/GHC-8.4.3-r1.exheres-0 @@ -158,18 +158,19 @@ src_install() { /usr/$(exhost --target)/bin/runghc{,-${SLOT}} \ /usr/$(exhost --target)/bin/runhaskell /usr/$(exhost --target)/bin/runghc-${SLOT} - # alternatives for manpages - local file alternatives=() - for file in "${IMAGE}"/usr/share/man/*/*; do - alternatives+=( + if [[ -d ${IMAGE}/usr/share/man ]]; then + local file alternatives=() + for file in "${IMAGE}"/usr/share/man/*/*; do + alternatives+=( ${file#${IMAGE}} ${file#${IMAGE}}-${SLOT} - ) - done + ) + done - alternatives_for \ - ghc ${SLOT} ${SLOT} \ - "${alternatives[@]}" + alternatives_for \ + ghc ${SLOT} ${SLOT} \ + "${alternatives[@]}" + fi } src_test_expensive() { diff --git a/packages/dev-lang/GHC/GHC-8.6.1.exheres-0 b/packages/dev-lang/GHC/GHC-8.6.1.exheres-0 index 21e5dad1..b917cf03 100644 --- a/packages/dev-lang/GHC/GHC-8.6.1.exheres-0 +++ b/packages/dev-lang/GHC/GHC-8.6.1.exheres-0 @@ -159,17 +159,19 @@ src_install() { /usr/$(exhost --target)/bin/runhaskell /usr/$(exhost --target)/bin/runghc-${SLOT} # alternatives for manpages - local file alternatives=() - for file in "${IMAGE}"/usr/share/man/*/*; do - alternatives+=( + if [[ -d ${IMAGE}/usr/share/man ]]; then + local file alternatives=() + for file in "${IMAGE}"/usr/share/man/*/*; do + alternatives+=( ${file#${IMAGE}} ${file#${IMAGE}}-${SLOT} - ) - done + ) + done - alternatives_for \ - ghc ${SLOT} ${SLOT} \ - "${alternatives[@]}" + alternatives_for \ + ghc ${SLOT} ${SLOT} \ + "${alternatives[@]}" + fi } src_test_expensive() {