mirror of
https://git.yoctoproject.org/poky
synced 2026-04-29 00:32:14 +02:00
base-files: profile: Simplify setting variables conditionally
It is preferred to use `[ "$FOO" ] || ...` instead of `[ -z "$FOO" ] && ...` as the latter leaves $? set to 1. (From OE-Core rev: d76c68505c36dbf383a989f3c2458abc765e2c19) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ad2778693e
commit
8033fd4ad1
@@ -3,15 +3,13 @@
|
||||
|
||||
PATH="/usr/local/bin:/usr/bin:/bin"
|
||||
EDITOR="vi" # needed for packages like cron, git-commit
|
||||
test -z "$TERM" && TERM="vt100" # Basic terminal capab. For screen etc.
|
||||
[ "$TERM" ] || TERM="vt100" # Basic terminal capab. For screen etc.
|
||||
|
||||
if [ "$HOME" = "ROOTHOME" ]; then
|
||||
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
|
||||
fi
|
||||
if [ "$PS1" ]; then
|
||||
# works for bash and ash (no other shells known to be in use here)
|
||||
PS1='\u@\h:\w\$ '
|
||||
fi
|
||||
# Add /sbin & co to $PATH for the root user
|
||||
[ "$HOME" != "ROOTHOME" ] || PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
|
||||
|
||||
# Set the prompt for bash and ash (no other shells known to be in use here)
|
||||
[ -z "$PS1" ] || PS1='\u@\h:\w\$ '
|
||||
|
||||
if [ -d /etc/profile.d ]; then
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
|
||||
Reference in New Issue
Block a user