[RFU] [1.7] Base-Files

Pierre A. Humblet pierre@phumblet.no-ip.org
Fri Feb 13 18:54:00 GMT 2009


----- Original Message ----- 
From: "John Morrison" 
To: "Pierre A. Humblet" 
Cc: <cygwin-apps>
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,

--- profile.orig        2009-02-13 08:32:04.000000000 -0500
+++ profile     2009-02-13 13:45:47.639064800 -0500
@@ -49,20 +49,25 @@ export USER
 
 # If the home directory doesn't exist, create it.
 if [ ! -d "${HOME}" ]; then
-       mkdir -p "${HOME}"
-       echo "Copying skeleton files."
-       echo "These files are for the user to personalise"
-       echo "their cygwin experience."
-       echo
-       echo "These will never be overwritten."
-       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
+       if mkdir -p "${HOME}"; then
+               echo "Copying skeleton files."
+               echo "These files are for the user to personalise"
+               echo "their cygwin experience."
+               echo
+               echo "These will never be overwritten."
+               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
+               OLDHOME=$HOME
+               { [ -d "$TEMP" ] && HOME="$TMP"; } || { [ -d /tmp ] && HOME=/tmp; } || HOME=/
+               echo "$OLDHOME could no be created. Setting HOME to $HOME."
+       fi              
 fi
 
 chmod 1777 /tmp 2>/dev/null




More information about the Cygwin-apps mailing list