This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFU] [1.7] Base-Files


> ----- Original Message -----
> From: "John Morrison"
> To: "Pierre A. Humblet"
> Sent: Friday, February 13, 2009 1:09 PM
> Subject: Re: [RFU] [1.7] Base-Files
>
> |
> | Patch would be appreciated, thanks Pierre; I've not got an environment
> | which could test that.
>
> Here it is,
>
> +               { [ -d "$TEMP" ] && HOME="$TMP"; } || { [ -d /tmp ] &&
> HOME=/tmp; } || HOME=/

Did you mean to test for "$TEMP" then use "$TMP"?  If not, is...

if [ ! -d "${HOME}" ]; then
        if mkdir -p "${HOME}"; then
                echo "Copying skeleton files."
                echo "These files are for the user to personalise their
cygwin experience."
                echo
                echo "They will never be overwritten nor automatically
updated."
                echo
                cd /etc/skel
                /bin/find . -type f | while read f; do
                        fDest=`echo ${f} | sed -e 's/^\.//g'`
                        if [ ! -e "${HOME}${fDest}" -a ! -L
"${HOME}${fDest}" ]; then
                                /usr/bin/install -D -p -v "${f}"
"${HOME}/${fDest}"
                        fi
                done
        else
                echo "${HOME} could not be created."

                { [ -d "${TEMP}" ] && HOME="${TEMP}"; } ||
                        { [ -d "${TMP}" ] && HOME="${TMP}"; } ||
                        { [ -d /tmp ] && HOME=/tmp; } ||
                        HOME=/

                echo "Setting HOME to ${HOME}."
        fi
fi

OK?

J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]