From 249faff8c004ccdf1af87680b2bd684454f96ff9 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 6 Aug 2012 17:29:53 -0500
Subject: bash 4.2

---
 abs/core/bash/PKGBUILD                         | 166 +++++++++++++++++++------
 abs/core/bash/bash.install                     |   3 +-
 abs/core/bash/bashrc                           |   6 -
 abs/core/bash/dot.bash_logout                  |   3 +
 abs/core/bash/dot.bash_profile                 |   5 +
 abs/core/bash/dot.bashrc                       |   9 ++
 abs/core/bash/enable-system-config-files.patch |  15 ---
 abs/core/bash/profile.bash                     |  11 --
 abs/core/bash/system.bash_logout               |   3 +
 abs/core/bash/system.bashrc                    |  34 ++---
 10 files changed, 160 insertions(+), 95 deletions(-)
 delete mode 100644 abs/core/bash/bashrc
 create mode 100644 abs/core/bash/dot.bash_logout
 create mode 100644 abs/core/bash/dot.bash_profile
 create mode 100644 abs/core/bash/dot.bashrc
 delete mode 100644 abs/core/bash/enable-system-config-files.patch
 delete mode 100644 abs/core/bash/profile.bash
 create mode 100644 abs/core/bash/system.bash_logout

diff --git a/abs/core/bash/PKGBUILD b/abs/core/bash/PKGBUILD
index 7c7eaca..02a6283 100644
--- a/abs/core/bash/PKGBUILD
+++ b/abs/core/bash/PKGBUILD
@@ -1,69 +1,155 @@
-# $Id: PKGBUILD 82719 2010-06-16 04:44:35Z allan $
-# Maintainer: Aaron Griffin <aaron@archlinux.org>
+# $Id: PKGBUILD 163854 2012-07-21 11:22:49Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: Aaron Griffin <aaron@archlinux.org>
 
 pkgname=bash
-_patchlevel=007 #prepare for some patches
-pkgver=4.1.$_patchlevel
-pkgrel=2
+_basever=4.2
+_patchlevel=037 #prepare for some patches
+pkgver=$_basever.$_patchlevel
+pkgrel=1
 pkgdesc="The GNU Bourne Again shell"
 arch=('i686' 'x86_64')
 license=('GPL')
 url="http://www.gnu.org/software/bash/bash.html"
 groups=('base')
-backup=(etc/profile.bash etc/skel/.bashrc etc/skel/.bash_profile)
+backup=(etc/bash.bash{rc,_logout} etc/skel/.bash{rc,_profile,_logout})
 depends=('readline>=6.1' 'glibc')
-makedepends=(gzip)
 provides=('sh')
 install=bash.install
-source=(http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz
-        profile.bash
-        bashrc
-        enable-system-config-files.patch
-        system.bashrc)
+source=(http://ftp.gnu.org/gnu/bash/bash-$_basever.tar.gz{,.sig}
+        dot.bashrc
+        dot.bash_profile
+        dot.bash_logout
+        system.bashrc
+        system.bash_logout)
 if [ $_patchlevel -gt 000 ]; then
-    for (( p=1; p<=$_patchlevel; p++ )); do
-        source=(${source[@]} http://ftp.gnu.org/gnu/bash/bash-4.1-patches/bash41-$(printf "%03d" $p))
+    for (( p=1; p<=$((10#${_patchlevel})); p++ )); do
+        source=(${source[@]} http://ftp.gnu.org/gnu/bash/bash-$_basever-patches/bash${_basever//./}-$(printf "%03d" $p){,.sig})
     done
 fi
 
 build() {
-  cd ${srcdir}/${pkgname}-4.1
-  for p in ../bash41-*; do
-    [ -e "$p" ] || continue
-    msg "applying patch ${p}"
-    patch -Np0 -i ${p} || return 1
+  cd ${srcdir}/${pkgname}-$_basever
+  for (( p=1; p<=$((10#${_patchlevel})); p++ )); do
+    msg "applying patch bash${_basever//./}-$(printf "%03d" $p)"
+    patch -Np0 -i $srcdir/bash${_basever//./}-$(printf "%03d" $p)
   done
 
-  patch -Np0 -i $srcdir/enable-system-config-files.patch || return 1
+  _bashconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin\"\'
+               -DSTANDARD_UTILS_PATH=\'\"/usr/bin:/bin:/usr/sbin:/sbin\"\'
+               -DSYS_BASHRC=\'\"/etc/bash.bashrc\"\'
+               -DSYS_BASH_LOGOUT=\'\"/etc/bash.bash_logout\"\')
+  export CFLAGS="${CFLAGS} ${_bashconfig[@]}"
 
   ./configure --prefix=/usr --with-curses --enable-readline \
     --without-bash-malloc --with-installed-readline \
     --bindir=/bin --mandir=/usr/share/man --infodir=/usr/share/info
-  make || return 1
-  make DESTDIR=${pkgdir} install
+  make
+}
+
+check() {
+  cd ${srcdir}/${pkgname}-$_basever
+  make check
+}
 
-  install -D -m644 ${srcdir}/profile.bash ${pkgdir}/etc/profile.bash || return 1
-  install -D -m644 ${srcdir}/system.bashrc ${pkgdir}/etc/bash.bashrc || return 1
+package() {
+  cd ${srcdir}/${pkgname}-$_basever
+  make DESTDIR=${pkgdir} install
 
   # for now, bash is our default /bin/sh
   cd ${pkgdir}/bin
   ln -s bash sh
 
-  mkdir -p ${pkgdir}/etc/skel/
-  install -D -m644 ${srcdir}/bashrc ${pkgdir}/etc/skel/.bashrc
-  echo ". \$HOME/.bashrc" >${pkgdir}/etc/skel/.bash_profile
+  install -dm755 ${pkgdir}/etc/skel/
+  
+  # system-wide configuration files
+  install -m644 ${srcdir}/system.bashrc ${pkgdir}/etc/bash.bashrc
+  install -m644 ${srcdir}/system.bash_logout ${pkgdir}/etc/bash.bash_logout
+  
+  # user configuration file skeletons
+  install -m644 ${srcdir}/dot.bashrc ${pkgdir}/etc/skel/.bashrc
+  install -m644 ${srcdir}/dot.bash_profile ${pkgdir}/etc/skel/.bash_profile
+  install -m644 ${srcdir}/dot.bash_logout ${pkgdir}/etc/skel/.bash_logout
 }
 
-md5sums=('9800d8724815fd84994d9be65ab5e7b8'
-         '17f20ec69535a2f50f2112a8c700630d'
-         '3d2837e84645eac9bde399b58014bafa'
-         '51725defa4c2dec49c1bc15883e0bee2'
-         '196697769f1667a8a1aed608811129c6'
-         '582dea5671b557f783e18629c2f77b68'
-         '118d465095d4a4706eb1d34696a2666a'
-         '120f7cf039a40d35fe375e59d6f17adc'
-         '336ee037fc2cc1e2350b05097fbdc87c'
-         '9471e666797f0b03eb2175ed752a9550'
-         'fb80ccd58cb1e34940f3adf4ce6e4a1e'
-         '192a8b161d419a1d0d211169f1d1046e')
-
+md5sums=('3fb927c7c33022f1c327f14a81c0d4b0'
+         '8d37a3f97a48c1e56e1a4ded877ed944'
+         '027d6bd8f5f6a06b75bb7698cb478089'
+         '2902e0fee7a9168f3a4fd2ccd60ff047'
+         '42f4400ed2314bd7519c020d0187edc5'
+         '3546099a1b2f667adc9794f52e78e35b'
+         '472f536d7c9e8250dc4568ec4cfaf294'
+         '1100bc1dda2cdc06ac44d7e5d17864a3'
+         'a7184b76eb4a079f10174a0a8f574819'
+         '30e7948079921d3261efcc6a40722135'
+         'c4d45307f7e69fe508ce347c4cec1955'
+         '9ea06decec43a198f3d7cf29acc602f8'
+         '74bddae6eeb9227a04a467d42597a34d'
+         'fb48f6134d7b013135929476aa0c250c'
+         '3e6a18226b16c773229246abd07a1f5e'
+         'e70e45de33426b38153b390be0dbbcd4'
+         'e667dc9348ebc3e0e14bfdd87f4b6ff2'
+         'ce4e5c484993705b27daa151eca242c2'
+         '41cbd8e57589bc081a546a014ddb12f8'
+         '88d1f96db29461767602e2546803bda7'
+         'b8b781520f4c7493a2a1ac3010a44a44'
+         '24c574bf6d6a581e300823d9c1276af6'
+         '354a0899a7c4b446454c52546562b55b'
+         '4c5835f2fbab36c4292bb334977e5b6d'
+         'ff4547ca7b508d52101729d61f5b77b6'
+         '0a51602b535ef661ee707be6c8bdb373'
+         'cec7c92a4d8052ea4b29216365d16566'
+         '58deacf3d57cbd75575444ff6a3b0806'
+         '9ed2a08e549c3c17745f19e8413cfb31'
+         '72d5059820015231483bb7415d09e9db'
+         '45b04b41a4230f469d3e47ab9952c2df'
+         '608336ebe215984ef126e3c29d2d3409'
+         '623f63025d155a84977b62531e260ee2'
+         'ed19da878e3f630834c62b9d9dcc6fce'
+         'eef2dd4a0e4505dc8f8e664b40c6cd66'
+         '2d07daba0b8ca8f876d2aa052ff594b4'
+         '0cb823a44e6dc1cde7ac97ae5c8163c9'
+         '53d246537e1fffd1aaa02ba5c056211c'
+         '60f983a1dded5f0b28040ff4b3f1e9b5'
+         '304fd129a58fee2d8a34f8b4704db0aa'
+         '9df4bf4f46aaadc436f430187741f815'
+         '6921a0b4228fe89b6537a5c29f027c89'
+         '4ef0e2a2cbfbdd53346f927000b7e112'
+         '1195d85447f3d048d2c9bcd075fa765c'
+         'b0f3a651ce29a1feee687d93177870f1'
+         'b09000bba08da6ac753124593850cdf7'
+         '204bb5054d1f8bafe2b446d4e5d0d99a'
+         '09d3f96a16b881334cfaee0cf320b47e'
+         'aab415350bcc2bb0c29943b413499d96'
+         '597bf71a2aac6feb510b7505cdd3d4f7'
+         'b0db384bdedecafbdd70c8d22c56af5f'
+         '3fab459b4e09daea529cacad025b13b3'
+         'bab99835ad6198cb1109fac89a085262'
+         '4ad8d11e72afc6090e701073ff034cf4'
+         '5658ef10c9d0d804126ec1ce700e4e2c'
+         'c7d2493e44490f01dd20bdc8feb0a6a7'
+         'e4855dbc4b743618b54d408bd5878637'
+         '9f19c199dd8d1fa9254eebe738759272'
+         '600c8e90c2fb13cdbc7aa3f18566df03'
+         'a6ed82daf034587aee2f2581ba5fe829'
+         '821620a0389df723644911c56796ca8c'
+         'da9265aa2527fd4a7481baa3e0550287'
+         '0043f8b75f46f43608a67b863e300fe8'
+         'ec444d229e8899fbaaf6fc7de2d82ae6'
+         'b632fca3a4943825bfaf3bd29df6b27d'
+         'b4bc1c4dc1b508ff9cdfc44f1a5039b5'
+         '2ffa9a802bbd57540021715f84cc76f4'
+         '89390ff6a3c2ef7e09dd4b8b097a8e56'
+         '3e9b529ef3726b75d125d678de76977f'
+         'eee08003395c417f677d1a4bf8c548ee'
+         'f670f7672b11d0df8c31885dbf15f390'
+         '2fe070dd6d75d8ff16f269184a16e9c4'
+         '5018b6b7737808141043b57cf4eb842d'
+         '4e610506c1711bf3483b965800ac3d5d'
+         'cb65e541f9b60a8cb1fe58404f264b73'
+         '7cd9bfdf7cbfd45274d07620ee94c8d9'
+         'a7d2eace0da5fd236c93dbfd93458838'
+         '9c3142956064d175a880bcb186e51ef9'
+         'a1a87649853f20fe99572ddc02b0c67f'
+         'c10692f447d4966c879f8fb8d7c8ebc9'
+         '1bf5e34ad46566bc2d0eb7560ff8968e')
diff --git a/abs/core/bash/bash.install b/abs/core/bash/bash.install
index 5c3c435..bc75e9b 100644
--- a/abs/core/bash/bash.install
+++ b/abs/core/bash/bash.install
@@ -1,4 +1,4 @@
-info_dir=/usr/share/info
+info_dir=usr/share/info
 info_files=(bash.info)
 
 post_install() {
@@ -18,4 +18,3 @@ pre_remove() {
     usr/bin/install-info --delete ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null
   done
 }
-# vim:set ts=2 sw=2 et:
diff --git a/abs/core/bash/bashrc b/abs/core/bash/bashrc
deleted file mode 100644
index 0963431..0000000
--- a/abs/core/bash/bashrc
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# Check for an interactive session
-[ -z "$PS1" ] && return
-
-alias ls='ls --color=auto'
-PS1='[\u@\h \W]\$ '
diff --git a/abs/core/bash/dot.bash_logout b/abs/core/bash/dot.bash_logout
new file mode 100644
index 0000000..0e4e4f1
--- /dev/null
+++ b/abs/core/bash/dot.bash_logout
@@ -0,0 +1,3 @@
+#
+# ~/.bash_logout
+#
diff --git a/abs/core/bash/dot.bash_profile b/abs/core/bash/dot.bash_profile
new file mode 100644
index 0000000..5545f00
--- /dev/null
+++ b/abs/core/bash/dot.bash_profile
@@ -0,0 +1,5 @@
+#
+# ~/.bash_profile
+#
+
+[[ -f ~/.bashrc ]] && . ~/.bashrc
diff --git a/abs/core/bash/dot.bashrc b/abs/core/bash/dot.bashrc
new file mode 100644
index 0000000..a355b0c
--- /dev/null
+++ b/abs/core/bash/dot.bashrc
@@ -0,0 +1,9 @@
+#
+# ~/.bashrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+alias ls='ls --color=auto'
+PS1='[\u@\h \W]\$ '
diff --git a/abs/core/bash/enable-system-config-files.patch b/abs/core/bash/enable-system-config-files.patch
deleted file mode 100644
index 5295355..0000000
--- a/abs/core/bash/enable-system-config-files.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- src/bash-4.0/config-top.h	2009-01-04 11:32:23.000000000 -0800
-+++ config-top.h	2009-08-25 08:41:08.000000000 -0700
-@@ -75,10 +75,10 @@
- #define KSH_COMPATIBLE_SELECT
- 
- /* System-wide .bashrc file for interactive shells. */
--/* #define SYS_BASHRC "/etc/bash.bashrc" */
-+#define SYS_BASHRC "/etc/bash.bashrc"
- 
- /* System-wide .bash_logout for login shells. */
--/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
-+#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
- 
- /* Define this to make non-interactive shells begun with argv[0][0] == '-'
-    run the startup files when not in posix mode. */
diff --git a/abs/core/bash/profile.bash b/abs/core/bash/profile.bash
deleted file mode 100644
index d28f069..0000000
--- a/abs/core/bash/profile.bash
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# /etc/profile.bash
-# Global settings for bash shells
-#
-
-#In the future we may want to add more ulimit entries here,
-# in the offchance that /etc/security/limits.conf is skipped
-ulimit -Sc 0 #Don't create core files
-
-# Source our global bashrc file, to remove duplication of effort
-[ -r /etc/bash.bashrc ] && . /etc/bash.bashrc
diff --git a/abs/core/bash/system.bash_logout b/abs/core/bash/system.bash_logout
new file mode 100644
index 0000000..a76e48e
--- /dev/null
+++ b/abs/core/bash/system.bash_logout
@@ -0,0 +1,3 @@
+#
+# /etc/bash.bash_logout
+#
diff --git a/abs/core/bash/system.bashrc b/abs/core/bash/system.bashrc
index 5430d6b..a2231e8 100644
--- a/abs/core/bash/system.bashrc
+++ b/abs/core/bash/system.bashrc
@@ -1,31 +1,23 @@
 #
 # /etc/bash.bashrc
 #
-# This file is the systemwide bashrc file. While most of the
-# environment is preserved when running an interactive shell
-# the PS[1-4] variables, aliases and functions are reset.
-#
-# When running a non-login shell, apply the following settings:
-# - Prompt defaults (PS[1-4], PROMPT_COMMAND)
-# - bash_completion if it exists
-# - source /etc/bash.bashrc.local
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
 
 PS1='[\u@\h \W]\$ '
 PS2='> '
 PS3='> '
 PS4='+ '
 
-export PS1 PS2 PS3 PS4
-
-if test "$TERM" = "xterm" -o \
-        "$TERM" = "xterm-color" -o \
-        "$TERM" = "xterm-256color" -o \
-        "$TERM" = "rxvt" -o \
-        "$TERM" = "rxvt-unicode" -o \
-        "$TERM" = "xterm-xfree86"; then
-    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
-    export PROMPT_COMMAND
-fi
+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
 
-[ -r /etc/bash_completion   ] && . /etc/bash_completion
-[ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local
+[ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion
-- 
cgit v0.12

