Roman Garcia writes:
> Hi,
> 
>  I'm running a linux box (kernel 2.0.27, Slackware distribution 3.0).
> I have installed sucessfully ghc 0.29, but I can't to install 2.02, due
> that it misspell the directories (it adds an period in the middle).
> Thanks in advance. Roman.
> 

Sigh, the `mkdirhier' that ships with GHC is broken (having . in file
paths is fine, the script's problem is that it doesn't correctly
unravel anything but the simplest file paths).

I've appended a substitute that works better (derived from Noah Friedman's
mkinstalldirs script), replace mkdirhier with this and have another go.

--Sigbjorn

#!/bin/sh

#
# create a hierarchy of directories, a mixture between
# the glafp-utils/mkdirhier/ and Noah Friedman's mkinstalldirs
#

errs=0

for f in $*; do
    parts=`echo ":$f" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    path="";
    for p in $parts; do
        path="$path$p"
        case "$path" in
          -* ) path=./$path ;;
        esac

        if test ! -d "$path"; then
           echo "mkdir $path" #1>&2

           mkdir "$path" || lasterr=$?
           
           if test ! -d "$path"; then
              errs=$lasterr
           fi 
        fi
        path="$path/";
    done;
done

exit $errs

# end of story

Reply via email to