[GRASS-SVN] r31031 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 18 17:55:11 EDT 2008


Author: hamish
Date: 2008-04-18 17:55:10 -0400 (Fri, 18 Apr 2008)
New Revision: 31031

Modified:
   grass/trunk/lib/init/init.sh
Log:
consolidate cygwin bash startup; adds GISBASE/etc/prompt.sh to cygwin

Modified: grass/trunk/lib/init/init.sh
===================================================================
--- grass/trunk/lib/init/init.sh	2008-04-18 21:42:05 UTC (rev 31030)
+++ grass/trunk/lib/init/init.sh	2008-04-18 21:55:10 UTC (rev 31031)
@@ -923,7 +923,7 @@
     export HOME
     ;;
 
-bash|msh)
+bash|msh|cygwin)
     # save command history in mapset dir and remember more
     export HISTFILE="$LOCATION/.bash_history"
     if [ -z "$HISTSIZE" ] && [ -z "$HISTFILESIZE" ] ; then 
@@ -938,7 +938,10 @@
     export HOME
     bashrc="$HOME/.bashrc"
     rm -f "$bashrc"
-    echo "test -z $PROFILEREAD && . /etc/profile" > "$bashrc"
+    if [ "$sh" != "cygwin" ] ; then
+	# this does not work on cygwin for unknown reasons
+	echo "test -z $PROFILEREAD && . /etc/profile" > "$bashrc"
+    fi
     echo "test -r ~/.alias && . ~/.alias" >> "$bashrc"
     echo "PS1='GRASS GRASS_VERSION_NUMBER ($LOCATION_NAME):\w > '" >> "$bashrc"
     echo "PROMPT_COMMAND=$GISBASE/etc/prompt.sh" >> "$bashrc"
@@ -958,41 +961,6 @@
     export HOME
     ;;
 
-cygwin)
-    # save command history in mapset dir and remember more
-    export HISTFILE="$LOCATION/.bash_history"
-    if [ -z "$HISTSIZE" ] && [ -z "$HISTFILESIZE" ] ; then 
-	export HISTSIZE=3000
-    fi
-
-    # instead of changing $HOME, start bash with: --rcfile "$LOCATION/.bashrc" ?
-    #   if so, must care be taken to explicity call .grass.bashrc et al for
-    #   non-interactive bash batch jobs?
-    USERHOME="$HOME"      # save original home
-    HOME="$LOCATION"      # save .bashrc in $LOCATION
-    export HOME
-    bashrc="$HOME/.bashrc"
-    rm -f "$bashrc"
-    # this does not work on cygwin for unknown reasons
-    # echo "test -z $PROFILEREAD && . /etc/profile" > "$bashrc"
-    echo "test -r ~/.alias && . ~/.alias" >> "$bashrc"
-    echo "PS1='GRASS GRASS_VERSION_NUMBER ($LOCATION_NAME):\w > '" >> "$bashrc"
-
-    if [ -r "$USERHOME/.grass.bashrc" ]
-    then
-        cat "$USERHOME/.grass.bashrc" >> "$bashrc"
-    fi
-
-    echo "export PATH=\"$PATH\"" >> "$bashrc"
-    echo "export HOME=\"$USERHOME\"" >> "$bashrc" # restore user home path
-
-    "$ETC/run" "$SHELL"
-    EXIT_VAL=$?
-
-    HOME="$USERHOME"
-    export HOME
-    ;;
-
 *)
 
     PS1="GRASS $GRASS_VERSION ($LOCATION_NAME):\w > "



More information about the grass-commit mailing list