diff --git a/srcpkgs/base-files/files/dot_bash_profile b/srcpkgs/base-files/files/dot_bash_profile index 91686f17058..6d8c25b20ea 100644 --- a/srcpkgs/base-files/files/dot_bash_profile +++ b/srcpkgs/base-files/files/dot_bash_profile @@ -1,11 +1,4 @@ # .bash_profile # Get the aliases and functions -if [ -f ~/.bashrc ]; then - . ~/.bashrc -fi - -# User specific environment and startup programs -if [ -f ~/.profile ]; then - . ~/.profile -fi +[ -f $HOME/.bashrc ] && . $HOME/.bashrc diff --git a/srcpkgs/base-files/files/dot_bashrc b/srcpkgs/base-files/files/dot_bashrc index 1de28403a6b..cb61abe357e 100644 --- a/srcpkgs/base-files/files/dot_bashrc +++ b/srcpkgs/base-files/files/dot_bashrc @@ -1,19 +1,10 @@ # .bashrc +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + # Source global definitions -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi +[ -f /etc/bashrc ] && ./etc/bashrc -# Source again stuff in /etc/profile.d in case it hasn't been. -for i in /etc/profile.d/*.sh ; do - if [ -r "$i" ]; then - if [ "$PS1" ]; then - . $i - else - . $i >/dev/null 2>&1 - fi - fi -done - -# User specific aliases and functions +alias ls='ls --color=auto' +PS1='[\u@\h \W]\$ ' diff --git a/srcpkgs/base-files/files/dot_profile b/srcpkgs/base-files/files/dot_profile deleted file mode 100644 index 8754ea01e61..00000000000 --- a/srcpkgs/base-files/files/dot_profile +++ /dev/null @@ -1,10 +0,0 @@ -# Read /etc/profile - -if [ -f /etc/profile ]; then - . /etc/profile -fi - -PATH=$PATH:$HOME/bin -PS1="[\u@\h \W]$ " - -export PATH PS1 diff --git a/srcpkgs/base-files/files/etc_bashrc b/srcpkgs/base-files/files/etc_bashrc new file mode 100644 index 00000000000..0f2bc57c131 --- /dev/null +++ b/srcpkgs/base-files/files/etc_bashrc @@ -0,0 +1,23 @@ +# /etc/bashrc +# +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +PS1='[\u@\h \W]\$ ' +PS2='> ' +PS3='> ' +PS4='+ ' + +case ${TERM} in + xterm*|rxvt*|Eterm|aterm|kterm|gnome*) + PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' + + ;; + screen) + PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' + ;; +esac + +if [ -r /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion +fi diff --git a/srcpkgs/base-files/files/profile b/srcpkgs/base-files/files/profile index 2a7442ee5d0..548d30cf98a 100644 --- a/srcpkgs/base-files/files/profile +++ b/srcpkgs/base-files/files/profile @@ -3,61 +3,22 @@ # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc -pathmunge () { - if ! echo $PATH | grep -Eq "(^|:)$1($|:)" ; then - if [ "$2" = "after" ] ; then - PATH=$PATH:$1 - else - PATH=$1:$PATH - fi - fi -} - -# ksh workaround -if [ -z "$EUID" -a -x /bin/id ]; then - EUID=`id -u` - UID=`id -ru` -fi - -# Path manipulation -if [ "$EUID" = "0" ]; then - pathmunge /sbin - pathmunge /usr/sbin - pathmunge /usr/local/sbin -else - pathmunge /usr/local/bin after - pathmunge /usr/local/sbin after - pathmunge /usr/sbin after - pathmunge /sbin after - pathmunge /opt/bin after - pathmunge /opt/sbin after -fi - -# No core files by default -ulimit -S -c 0 > /dev/null 2>&1 - -if [ -x /bin/id ]; then - USER="`id -un`" - LOGNAME=$USER - MAIL="/var/spool/mail/$USER" -fi - -HOSTNAME=`/bin/hostname 2>/dev/null` -HISTSIZE=1000 - -export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE - -for i in /etc/profile.d/*.sh ; do - if [ -r "$i" ]; then - if [ "$PS1" ]; then - . $i - else - . $i >/dev/null 2>&1 - fi - fi -done +#Set our umask +umask 022 +# Set our default path +PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" export PATH -unset i -unset pathmunge +# Load profiles from /etc/profile.d +if [ -d /etc/profile.d/ ]; then + for f in /etc/profile.d/*.sh; do + [ -r "$profile" ] && . "$profile" + done + unset f +fi + +# Source global bash config +if [ -n "$PS1" && -n "$BASH" && -r /etc/bashrc ]; then + . /etc/bashrc +fi diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template index 691e8448f7c..da351bed551 100644 --- a/srcpkgs/base-files/template +++ b/srcpkgs/base-files/template @@ -1,6 +1,6 @@ # Template file for 'base-files' pkgname=base-files -version=0.59 +version=0.60 short_desc="Void GNU/Linux base system files" maintainer="Juan RP " homepage="http://code.google.com/p/xbps" @@ -18,7 +18,6 @@ conf_files=" /etc/hosts /etc/host.conf /etc/securetty -/etc/skel/.profile /etc/skel/.bash_profile /etc/skel/.bash_logout /etc/skel/.bashrc @@ -30,7 +29,7 @@ Add_dependency full xbps-triggers do_install() { # Install misc config files. - for f in bash_logout bash_profile bashrc profile inputrc; do + for f in bash_logout bash_profile bashrc inputrc; do vinstall ${FILESDIR}/dot_${f} 644 etc/skel .${f} done