Install OpenSSL 0.9.8x import libs
[msysgit/kirr.git] / etc / profile
blob38723fdd5e5c69087a33fb950f6457740a16f643
1 # Copyright (C) 2001, 2002  Earnie Boyd  <earnie@users.sf.net>
2 # This file is part of the Minimal SYStem.
3 #   http://www.mingw.org/msys.shtml
5 #         File: profile
6 #  Description: Shell environment initialization script
7 # Last Revised: 2002.05.04
9 if [ -z "$MSYSTEM" ]; then
10   MSYSTEM=MINGW32
13 # My decision to add a . to the PATH and as the first item in the path list
14 # is to mimick the Win32 method of finding executables.
16 # I filter the PATH value setting in order to get ready for self hosting the
17 # MSYS runtime and wanting different paths searched first for files.
18 if [ $MSYSTEM == MINGW32 ]; then
19   export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"
20 else
21   export PATH=".:/usr/local/bin:/bin:/mingw/bin:$PATH"
24 # strip out cygwin paths from PATH
25 case "$PATH" in
26 */cygwin/*)
27         PATH="$(awk -vRS=: -vORS=: '!/cygwin/' <<< "$PATH")"
28         # awk always adds a trailing separator
29         export PATH="${PATH%:}"
30         ;;
31 esac
33 # check msys-1.0.dll
34 if test -f /etc/msys-1.0.dll.md5
35 then
36         # if check succeeds, let's avoid checking again
37         md5sum --status --check /etc/msys-1.0.dll.md5 &&
38         rm -f /etc/msys-1.0.dll.md5 ||
39         printf "\n\033[31mERROR: Your msys-1.0.dll is out-of-date!\033[m\n\n"
42 if [ -z "$USERNAME" ]; then
43   LOGNAME="`id -un`"
44 else
45   LOGNAME="$USERNAME"
48 # Set up USER's home directory
49 if [ -z "$HOME" -o ! -d "$HOME" ]; then
50   HOME="$HOMEDRIVE$HOMEPATH"
51   if [ -z "$HOME" -o ! -d "$HOME" ]; then
52     HOME="$USERPROFILE"
53   fi
56 if [ ! -d "$HOME" ]; then
57         printf "\n\033[31mERROR: HOME directory '$HOME' doesn't exist!\033[m\n\n"
58         echo "This is an error which might be related to msysGit issue 108."
59         echo "You might want to set the environment variable HOME explicitly."
60         printf "\nFalling back to \033[31m/ ($(cd / && pwd -W))\033[m.\n\n"
61         HOME=/
64 # normalize HOME to unix path
65 HOME="$(cd "$HOME" ; pwd)"
67 export PATH="$HOME/bin:$PATH"
69 export GNUPGHOME=~/.gnupg
71 if [ -z "$MAGIC" ]; then
72   magicfile=$(cd / && pwd -W)'/mingw/share/misc/magic.mgc'
73   test -f "$magicfile" && export MAGIC="$magicfile"
76 if [ "x$HISTFILE" == "x/.bash_history" ]; then
77   HISTFILE=$HOME/.bash_history
80 if [ -e ~/.inputrc ]; then
81     export INPUTRC=~/.inputrc
82 else
83     export INPUTRC=/etc/inputrc
86 case "$LS_COLORS" in
87 *rs*)
88         # Our ls may ot handle LS_COLORS inherited in a Wine process
89         unset LS_COLORS;;
90 esac
92 export HOME LOGNAME MSYSTEM HISTFILE
94 for i in /etc/profile.d/*.sh ; do
95   if [ -f $i ]; then
96     . $i
97   fi
98 done
100 export MAKE_MODE=unix
102 # Git specific stuff
103 test -e /bin/git.exe -o -e /git/git.exe || {
104         echo
105         echo -------------------------------------------------------
106         echo "Building and Installing Git"
107         echo -------------------------------------------------------
109         cd /git &&
110         make install
112         case $? in
113         0)
114                 MESSAGE="You are in the git working tree, and all is ready for you to hack."
115         ;;
116         *)
117                 MESSAGE="Your build failed...  Please fix it, and give feedback on the Git list."
118         esac
120         test -d /installer-tmp && rm -rf /installer-tmp
122         cat <<EOF
125 -------------------------
126 Hello, dear Git developer.
128 This is a minimal MSYS environment to work on Git.
130 $MESSAGE
135 # let's make sure that the post-checkout hook is installed
136 test -d /.git && test ! -x /.git/hooks/post-checkout &&
137 test -x /share/msysGit/post-checkout-hook &&
138 mkdir -p /.git/hooks &&
139 cp /share/msysGit/post-checkout-hook /.git/hooks/post-checkout
141 test -f /etc/motd && sed "s/\$MESSAGE/$MESSAGE/" < /etc/motd
142 test -x /share/msysGit/initialize.sh -a ! -d /.git &&
143 cat << EOF
145 It appears that you installed msysGit using the full installer.
146 To set up the Git repositories, please run /share/msysGit/initialize.sh
149 case ":$PATH:" in
150 *:/cmd:*|*:/bin:*) ;;
152         cat << EOF
154 In order to use Git from cmd.exe:
155 1. Add c:\msysgit\cmd to cmd's PATH
156 2. DON'T add c:\msysgit\bin or c:\msysgit\mingw\bin to cmd's PATH
157 Commands like 'git add' will work from cmd.exe now.
158 Commands like 'git-add' will NOT work. Add more wrappers as appropriate.
160 esac
163 . /git/contrib/completion/git-completion.bash
164 if test -z "$WINELOADERNOEXEC"
165 then
166         PS1='\[\033]0;$MSYSTEM:\w\007
167 \033[32m\]\u@\h \[\033[33m\w$(__git_ps1)\033[0m\]
168 $ '
169 else
170         PS1='\[\033]0;$MSYSTEM:\w\007
171 \033[32m\]\u@\h \[\033[33m\w\033[0m\]
172 $ '
175 # set default options for 'less'
176 export LESS=-FRSX
177 export LESSCHARSET=utf-8
179 # set default protocol for 'plink'
180 export PLINK_PROTOCOL=ssh
182 # read user-specific settings, possibly overriding anything above
183 if [ -e ~/.bashrc ]; then
184     . ~/.bashrc
185 elif [ -e ~/.bash_profile ]; then
186     . ~/.bash_profile
187 elif [ -e /etc/bash_profile ]; then
188     . /etc/bash_profile