FS#18917 - [ghc] ghc.install :: test if directory exists

Attached to Project: Arch Linux
Opened by orbisvicis (orbisvicis) - Thursday, 01 April 2010, 22:55 GMT
Last edited by Thomas Dziedzic (tomd123) - Saturday, 03 March 2012, 17:06 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Vesa Kaihlavirta (vegai)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
"/usr/share/haskell might not necessarily exist, so ghc.install should be modified somewhat like:

if [ -d "/usr/share/haskell/"]; then
__cd "/usr/share/haskell/"
__for a in *; do
____ghc-pkg unregister --force "$a" &> /dev/null
__done
__cd - > /dev/null ## dunno what this does, is it useful?
fi


Additional info:
* package version(s)
extra/ghc 6.12.1-4
This task depends upon

Closed by  Thomas Dziedzic (tomd123)
Saturday, 03 March 2012, 17:06 GMT
Reason for closing:  Fixed
Additional comments about closing:  ghc 7.4.1
Comment by orbisvicis (orbisvicis) - Sunday, 11 April 2010, 06:20 GMT
Fixed ghc.install
Also attached is a list of pre_upgrade() alternatives, using awk,bash,head/tail,egrep,sed or perl. The dependent packages are all in [core], so it really shouldn't matter.
Comment by orbisvicis (orbisvicis) - Sunday, 11 April 2010, 19:26 GMT
This time, I fix the reported bug, not any others
Comment by Kyle Keen (keenerd) - Sunday, 20 February 2011, 01:34 GMT
Still is an issue, despite two pkgrel bumps.

A simpler fix would be to add
install -d "$pkgdir/usr/share/haskell"
to the pkgbuild.

Also, you've got a || return 1
Comment by Magnus Therning (magus) - Saturday, 12 March 2011, 07:04 GMT
This is still an issue in ghc-7.0.2-1.
Comment by Vesa Kaihlavirta (vegai) - Sunday, 13 March 2011, 11:11 GMT
install -d $pkgdir/usr/share/haskell added in -2
Comment by orbisvicis (orbisvicis) - Friday, 06 May 2011, 19:59 GMT
There are several problems addressed by this report or mentioned in the comments:
1] "/usr/share/haskell" might not necessarily exist. Two possible fixes where (first option picked):
. install -d "$pkgdir/usr/share/haskell"
. if [ -d "/usr/share/haskell/"]; then
[x] fixed

2] Pass the specific package version to ghc-pkg unregister (if multiple packages are installed). Two possible options:
. for package in $(perl -ne 'if ($_ =~ m/id: (.*)-.*/){print $1."\n";}' /usr/share/haskell/*/register.sh); do
. for unreg in /usr/sharehaskell/*/unregster.sh; do "$a"; done
The second option manually calls the installed unregister script which contains the appropriate package version
[ ] undecided

3] still a " || return 1" in the PKGBUILD, not needed since "set -e" enabled
Comment by Vesa Kaihlavirta (vegai) - Wednesday, 23 November 2011, 15:51 GMT
I see your point, but I'm somewhat reluctant to run all those scripts under /usr/share/haskell/* automatically as root.

Loading...