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
Opened by orbisvicis (orbisvicis) - Thursday, 01 April 2010, 22:55 GMT
Last edited by Thomas Dziedzic (tomd123) - Saturday, 03 March 2012, 17:06 GMT
|
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
Saturday, 03 March 2012, 17:06 GMT
Reason for closing: Fixed
Additional comments about closing: ghc 7.4.1
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.
regex.install.test (2.3 KiB)
A simpler fix would be to add
install -d "$pkgdir/usr/share/haskell"
to the pkgbuild.
Also, you've got a || return 1
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