summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-12-30 01:50:23 +0000
committerMike Frysinger <vapier@gentoo.org>2006-12-30 01:50:23 +0000
commit83d0bd0347bdfc69f0040876f683049cb640cc17 (patch)
tree5990f93e9eb6a2990aa104f76b05d355f6cd28cb /app-shells/bash
parentFixed deps for python-2.5 (thanks to Jokey). Fixed bug #148456 (by removing e... (diff)
downloadgentoo-2-83d0bd0347bdfc69f0040876f683049cb640cc17.tar.gz
gentoo-2-83d0bd0347bdfc69f0040876f683049cb640cc17.tar.bz2
gentoo-2-83d0bd0347bdfc69f0040876f683049cb640cc17.zip
Merge the dot bashrc and global bashrc #148812 by Sebastian Rijkers.
(Portage version: 2.1.2_rc4-r2)
Diffstat (limited to 'app-shells/bash')
-rw-r--r--app-shells/bash/ChangeLog6
-rw-r--r--app-shells/bash/files/bashrc29
-rw-r--r--app-shells/bash/files/dot-bashrc20
3 files changed, 28 insertions, 27 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog
index 7c4c56a2a054..25cbdff7b357 100644
--- a/app-shells/bash/ChangeLog
+++ b/app-shells/bash/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for app-shells/bash
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.126 2006/12/16 03:07:26 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.127 2006/12/30 01:50:23 vapier Exp $
+
+ 30 Dec 2006; Mike Frysinger <vapier@gentoo.org> files/bashrc,
+ files/dot-bashrc:
+ Merge the dot bashrc and global bashrc #148812 by Sebastian Rijkers.
*bash-3.2_p9 (16 Dec 2006)
diff --git a/app-shells/bash/files/bashrc b/app-shells/bash/files/bashrc
index dedbbf5e5a99..b6fee4df9e22 100644
--- a/app-shells/bash/files/bashrc
+++ b/app-shells/bash/files/bashrc
@@ -30,22 +30,27 @@ shopt -s histappend
# globbing instead of external grep binary.
use_color=false
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
-if [[ -f /etc/DIR_COLORS ]] ; then
- match_lhs=$(</etc/DIR_COLORS)
-elif type -p dircolors >/dev/null ; then
- match_lhs=$(dircolors --print-database)
-else
- match_lhs=""
-fi
+match_lhs=""
+[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
+[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
+[[ -z ${match_lhs} ]] && match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
if ${use_color} ; then
+ # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
+ if [[ -f ~/.dir_colors ]] ; then
+ eval $(dircolors -b ~/.dir_colors)
+ elif [[ -f /etc/DIR_COLORS ]] ; then
+ eval $(dircolors -b /etc/DIR_COLORS)
+ fi
+
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
+ #BSD#@export CLICOLOR=1
#GNU#@alias ls='ls --color=auto'
alias grep='grep --colour=auto'
else
@@ -59,3 +64,13 @@ fi
# Try to keep environment pollution down, EPA loves us.
unset use_color safe_term match_lhs
+
+# Change the window title of X terminals
+case ${TERM} in
+ xterm*|rxvt*|Eterm|aterm|kterm|gnome)
+ PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
+ ;;
+ screen)
+ PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
+ ;;
+esac
diff --git a/app-shells/bash/files/dot-bashrc b/app-shells/bash/files/dot-bashrc
index 0211a6b72b9e..34dbd8c892f6 100644
--- a/app-shells/bash/files/dot-bashrc
+++ b/app-shells/bash/files/dot-bashrc
@@ -14,23 +14,5 @@ if [[ $- != *i* ]] ; then
return
fi
-# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
-if [[ -f ~/.dir_colors ]] ; then
- eval $(dircolors -b ~/.dir_colors)
-elif [[ -f /etc/DIR_COLORS ]] ; then
- eval $(dircolors -b /etc/DIR_COLORS)
-fi
-
-#BSD#@export CLICOLOR=1
-#GNU#@alias ls='ls --color=auto'
-alias grep='grep --colour=auto'
-# Change the window title of X terminals
-case ${TERM} in
- xterm*|rxvt*|Eterm|aterm|kterm|gnome)
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
- ;;
- screen)
- PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
- ;;
-esac
+# Put your fun stuff here.