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