[haiku-commits] haiku: hrev51038 - data/etc

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 25 Mar 2017 12:04:14 +0100 (CET)

hrev51038 adds 1 changeset to branch 'master'
old head: 2616691f31ed8c66bf53495943334a0fb5687709
new head: be9a70562e3c6552efb0caa53bd26965e7e1bed7
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=be9a70562e3c+%5E2616691f31ed

----------------------------------------------------------------------------

be9a70562e3c: Make /etc/profile compatible with non-bash shells again.
  
  Fixes #13384.
  
  Signed-off-by: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>

                             [ Thorsten „mirabilos“ Glaser <tg@xxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev51038
Commit:      be9a70562e3c6552efb0caa53bd26965e7e1bed7
URL:         http://cgit.haiku-os.org/haiku/commit/?id=be9a70562e3c
Author:      Thorsten „mirabilos“ Glaser <tg@xxxxxxxxxx>
Date:        Sat Mar 25 11:03:29 2017 UTC
Committer:   Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Commit-Date: Sat Mar 25 11:04:08 2017 UTC

Ticket:      https://dev.haiku-os.org/ticket/13384

----------------------------------------------------------------------------

1 file changed, 17 insertions(+), 4 deletions(-)
data/etc/profile | 21 +++++++++++++++++----

----------------------------------------------------------------------------

diff --git a/data/etc/profile b/data/etc/profile
index c81cc91..114061e 100644
--- a/data/etc/profile
+++ b/data/etc/profile
@@ -3,7 +3,7 @@
 # Place user customizations in /.profile
 #
 
-ps |& grep -e $PPID |& grep -e $SHELL |& grep -q -e $PPID > /dev/null 2>&1
+ps 2>&1 | grep -e $PPID 2>&1 | grep -e $SHELL 2>&1 | grep -q -e $PPID > 
/dev/null 2>&1
 if [ $? -eq 1 ] ; then
        echo -e "\nWelcome to the Haiku shell.\n"
        export PS1="\w> "
@@ -35,7 +35,7 @@ alias ll="ls -lA"
 alias la="ls -A"
 alias m="more"
 
-shopt -s checkwinsize
+test -n "$BASH_VERSION" && shopt -s checkwinsize
 
 #
 # and now we include a few useful things...
@@ -51,7 +51,7 @@ shopt -s checkwinsize
 # Chet Ramey
 # chet@xxxxxxxxxxxx
 #
-whence()
+test -n "$KSH_VERSION" || whence()
 {
        local vflag= path=
 
@@ -106,7 +106,20 @@ whence()
        return $returnValue
 }
 
-alias which='whence'
+if test -n "$KSH_VERSION"; then
+       ps1_pwd() {
+               local e=$? d=${PWD:-?}/ p=~
+               [[ $p = ?(*/) ]] || d=${d/#$p\//\~/}
+               print -nr -- "${d%/}"
+               return $e
+       }
+       PS1=${PS1/'\w'/'$(ps1_pwd)'}
+       alias which='whence -p'
+else
+       test -n "$BASH_VERSION" || PS1=$(printf '%s' "$PS1" | \
+           sed 's/\\w/$PWD/')
+       alias which='whence'
+fi
 
 function dir {
        ls -lF "$@";


Other related posts:

  • » [haiku-commits] haiku: hrev51038 - data/etc - pulkomandy