data/profile: fix and simplify secondary arch detection
The previous code was wrong: running bash --login was reported as if we used setarch x86_gcc2. Current code also saves 3 fork+exec.
This commit is contained in:
+4
-3
@@ -3,14 +3,15 @@
|
|||||||
# Place user customizations in /.profile
|
# Place user customizations in /.profile
|
||||||
#
|
#
|
||||||
|
|
||||||
ps 2>&1 | grep -e $PPID 2>&1 | grep -e $SHELL 2>&1 | grep -q -e $PPID > /dev/null 2>&1
|
ARCH=`getarch 2>/dev/null`
|
||||||
if [ $? -eq 1 ] ; then
|
if [ "$ARCH" = "`getarch -p 2>/dev/null`" ] ; then
|
||||||
echo -e "\nWelcome to the Haiku shell.\n"
|
echo -e "\nWelcome to the Haiku shell.\n"
|
||||||
export PS1="\w> "
|
export PS1="\w> "
|
||||||
else
|
else
|
||||||
echo -e "\nSwitching to architecture `getarch`\n"
|
echo -e "\nSwitching to architecture `getarch`\n"
|
||||||
export PS1="[`getarch`] \w> "
|
export PS1="[$ARCH] \w> "
|
||||||
fi
|
fi
|
||||||
|
unset ARCH
|
||||||
|
|
||||||
export USER=`id -un`
|
export USER=`id -un`
|
||||||
export GROUP=`id -gn`
|
export GROUP=`id -gn`
|
||||||
|
|||||||
Reference in New Issue
Block a user