Add user .bashrc and .bash_profile files and slightly modified the system bashrc
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
name: bash
|
name: bash
|
||||||
description: The Bourne-Again Shell
|
description: The Bourne-Again Shell
|
||||||
version: 5.2.37
|
version: 5.2.37
|
||||||
revision: 2
|
revision: 3
|
||||||
url: https://www.gnu.org/software/bash/
|
url: https://www.gnu.org/software/bash/
|
||||||
license: GPL3-or-later
|
license: GPL3-or-later
|
||||||
architecture: any
|
architecture: any
|
||||||
keep: ["etc/bashrc","etc/profile"]
|
keep: ["etc/bashrc","etc/profile","etc/skel/.bash_profile","etc/skel/.bashrc"]
|
||||||
depends: ["glibc","readline","readline"]
|
depends: ["glibc","readline","readline"]
|
||||||
optional_depends: ["bash-completion"]
|
optional_depends: ["bash-completion"]
|
||||||
provides: ["sh"]
|
provides: ["sh"]
|
||||||
|
|||||||
+5
-4
@@ -1,6 +1,7 @@
|
|||||||
# /etc/bashrc
|
# /etc/bashrc
|
||||||
|
|
||||||
# Setting bash prompt if not in chroot
|
# Return if not running interactively
|
||||||
if ! [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ]; then
|
[[ $- == *i* ]] || return
|
||||||
PS1='[\u@\h \W]\$ '
|
|
||||||
fi
|
# Set bash prompt
|
||||||
|
PS1='[\u@\h \W]\$ '
|
||||||
|
|||||||
@@ -22,17 +22,17 @@ if [ -f /etc/locale.conf ]; then
|
|||||||
set +a
|
set +a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Source scripts in profile.d
|
||||||
if [ -d /etc/profile.d ]; then
|
if [ -d /etc/profile.d ]; then
|
||||||
for f in /etc/profile.d/*.sh; do
|
for f in /etc/profile.d/*.sh; do
|
||||||
[ -r "$f" ] && source "$f"
|
[ -r "$f" ] && . "$f"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Unsetting functions
|
# Unsetting functions
|
||||||
unset -f append_path
|
unset -f append_path
|
||||||
|
|
||||||
# Run /etc/bashrc if in an interactive terminal
|
# Run /etc/bashrc if running in a non-posix-compliant bash shell and if the file exists
|
||||||
if [[ $- == *i* ]]; then
|
if [ -f /etc/bashrc ] && [ -n "$BASH" ] && [ -z "$POSIXLY_CORRECT"]; then
|
||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# ~/.bash_profile
|
||||||
|
|
||||||
|
# Source user .bashrc if it exists
|
||||||
|
[ -f $HOME/.bashrc ] && source $HOME/.bashrc
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# ~/.bashrc
|
||||||
|
|
||||||
|
# Return if not running interactively
|
||||||
|
[[ $- == *i* ]] || return
|
||||||
|
|
||||||
|
# Set bash prompt
|
||||||
|
PS1='[\u@\h \W]\$ '
|
||||||
@@ -41,5 +41,10 @@ package() {
|
|||||||
install -Dm644 ../bashrc "$BPM_OUTPUT"/etc/bashrc
|
install -Dm644 ../bashrc "$BPM_OUTPUT"/etc/bashrc
|
||||||
install -d "$BPM_OUTPUT"/etc/profile.d
|
install -d "$BPM_OUTPUT"/etc/profile.d
|
||||||
|
|
||||||
|
# Default user files
|
||||||
|
install -Dm644 ../user.bash_profile "$BPM_OUTPUT"/etc/skel/.bash_profile
|
||||||
|
install -Dm644 ../user.bashrc "$BPM_OUTPUT"/etc/skel/.bashrc
|
||||||
|
|
||||||
|
# Install package license
|
||||||
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/bash/COPYING
|
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/bash/COPYING
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user