diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-11-09 20:41:31 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-11-09 20:41:31 +0000 |
commit | 7ef6c017e1c64b4880928732bc016a628b0f33ce (patch) | |
tree | 1120446048043d55f68e276e067d811c970879fb /app-shells | |
parent | Depend on setuptools. (diff) | |
download | historical-7ef6c017e1c64b4880928732bc016a628b0f33ce.tar.gz historical-7ef6c017e1c64b4880928732bc016a628b0f33ce.tar.bz2 historical-7ef6c017e1c64b4880928732bc016a628b0f33ce.zip |
Introduce support for bashrc.d directory that is sourced in bashrc by default, bug #468094.
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Manifest-Sign-Key: 0xEFB4464E!
Diffstat (limited to 'app-shells')
-rw-r--r-- | app-shells/bash/ChangeLog | 9 | ||||
-rw-r--r-- | app-shells/bash/Manifest | 32 | ||||
-rw-r--r-- | app-shells/bash/bash-4.3_p30-r1.ebuild | 248 | ||||
-rw-r--r-- | app-shells/bash/files/bashrc-r1 | 92 |
4 files changed, 366 insertions, 15 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog index ea469436e863..b6e45d1dba86 100644 --- a/app-shells/bash/ChangeLog +++ b/app-shells/bash/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-shells/bash # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.425 2014/10/20 05:14:35 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.426 2014/11/09 20:41:28 mgorny Exp $ + +*bash-4.3_p30-r1 (09 Nov 2014) + + 09 Nov 2014; Michał Górny <mgorny@gentoo.org> +bash-4.3_p30-r1.ebuild, + +files/bashrc-r1: + Introduce support for bashrc.d directory that is sourced in bashrc by default, + bug #468094. 20 Oct 2014; Mike Frysinger <vapier@gentoo.org> bash-4.3_p30.ebuild: Fix install of examples #525930 by Erik Zeek. diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest index ff5d40604c0c..3eb97a447469 100644 --- a/app-shells/bash/Manifest +++ b/app-shells/bash/Manifest @@ -59,6 +59,7 @@ AUX bash-4.3-term-cleanup.patch 2152 SHA256 9f2d0faac988273dd1d838e8904325d524c9 AUX bash-4.x-deferred-heredocs.patch 1255 SHA256 845ffcd7035eef5dc029747f211a737e0260b53b16086a37fb3c8ab3609a7d36 SHA512 9016203189d0b601f0441daec19f902de7387b599a2196c475d76c596dcf9a9c22765a58e7fc5a3117522ec2722475bd166bea271ff3048f31674e8bed2901a0 WHIRLPOOL f3a2ef5245c446b7e90917e987d80efba5e6437dbe86fc27bbd7768bc5f1e5f6e7663b350ca8a81a3f21a29af6e1594c14061be0d818fce6a4a63aed7efcb6fe AUX bash_logout 205 SHA256 15aaded954389c05d7de5d36c4887db61975ad52c87ad78baf1062ec8997289d SHA512 7234250c03fc920996a381f9daef9e2d8ab1e1a29acdebed6669d8e0fe1c872a7fa343adf7d9ddc81225b0cd9eb223ba7ad1ff42448aff057fc6d6baa8f04a7d WHIRLPOOL 16242c8796af44f550f2935b37c770c022754c63db75b57fbe49d1a313b8651235619ead571cd70ae37f890c694d1c6b2e4871ec51345743eff8649782d0523b AUX bashrc 2879 SHA256 72a0b0bf010e72667c229475961f56b3684e02bcf1ccb22da63564ea16c08b54 SHA512 cb89537d4f7bc03c0e05d339f0c6c63cbd61f7963d97d0af13fe3cc2e9ac74755573d8acb28f3c6133a7cbd8f9f6c6c745e0bc215702456b2892a9438876c8a2 WHIRLPOOL 2e6ca7bcb3c2fe0923320f43094f6a11729c128a2f78ba2d51adbb07eb477d3e0573a2af844939fbc8dc1aba52eaf9dce043592a8ceb893148ec855a852e7674 +AUX bashrc-r1 2958 SHA256 e6ec6cc13a317b3262f17ae438052c7e8c193e13a5f5d7884007f0d6ec7bf386 SHA512 0180c09f17821ed7f6d0a9418163379c08793dd8b9a3818e03d1625e1ba4197f861b2bff3aeaaf8453203c10b685d1ee98d42e0212471f4bf9c028e7ab894976 WHIRLPOOL 520a15121fedf854c69f56510e7c54eb134069244fcc371a942425bffe41321265ffca99b8540617cca4f2d77b8d328c7f06fed4ab2d90c54970224f9697c50a AUX dot-bash_logout 127 SHA256 3bcb4958dad662fc2cbe77177236679f7a09b8bdb0be738102df4457394f4022 SHA512 e0248b5087656a4dd3a4790ed8e6101866b922ccab36b510b3bf408dc0c583e70f323fbad0392e4ea6ca5dcbe73568733e0c0aa9c8ce6b00ff5f72bf3e9fd8fd WHIRLPOOL 3dc6bc364f8229d123873940743866dfc330e193ab6ec7c5162c61d0ecc319198a64f27176521bfb979c31eed9ed0b2ee2ffce31b050d4cb8e3aa8a5c12c38cf AUX dot-bash_profile 193 SHA256 ae12206aaa35dc96273ed421f4e85ca26a1707455e3cc9f054c7f5e2e9c53df6 SHA512 064227bb7658f5ac0aaddd7ddda39daa0ffa924601445afa61c02aa19a990a5def377b125111e4817bf80ed80d33e1c111ee13034958b5de1ff8e50c093359a2 WHIRLPOOL cde8efc527122adbfa90d60a79fbdffd953c5573c5c6c5d499e56093517ceb7b48d9cfadd10b7c1d161b6d7f84276403fc233fca2d6798bcff2d0d052023672b AUX dot-bashrc 551 SHA256 e280e34af6e830c93adb6285f66ead4812ddfb2bbc6a7ff618467f4c933f6446 SHA512 518b62aa2fa30e7d1692847929a6ce8dae4eac93e8b16d223d1ae86f4d5b076bcbe1852c9034f321c013e17502db9f771979957c67f8e8a71ca4eea7bfe9cc1b WHIRLPOOL 27c53e3f59bd89d5517b5b22bcf04a9adddee0492c52d34d26a707062fb4c4fa853cdf2726d6ec2621a08f24c32a53651ce5693b6de1be764de3e088eb9f7ee6 @@ -336,23 +337,26 @@ EBUILD bash-3.2_p57.ebuild 4591 SHA256 bdb294f5741c71afa3543643a4a45110fb236b91a EBUILD bash-4.0_p44.ebuild 4465 SHA256 27dbd1c269c97b40cd829cfc3e9050acbfe5960c16f51739ea75421c4d9c1e3d SHA512 431771ab2d4d8f6281e65f7bdc91f14474244bd0bfbac4d200a89cef4b032a18df626ab85e19490ba47ae830a50b8d6621738cc06f299fd3f980727c797fbac2 WHIRLPOOL de45d0a3917de3e5879750a70a5be36351f21ace5086923ac36ff73b23fb34845fd577fb3b6e575a217eb30f7a6e2bdcfe9dd60df94752636baa852b2ed5bef9 EBUILD bash-4.1_p17.ebuild 4200 SHA256 51ef8ecaf92d851c4949c91456a5c0325a328ca3b32afcb2f42a09fde87a025e SHA512 2f55461af1796f5c4dd759b46b9d42cf8cda8fb3d912887460e2d4d36198dd58fbd04b6b60aefc25970442607012bbfa972a43911bba938ef7806e4ce93fc708 WHIRLPOOL 51af146187f894f65f68d8de3e9dd03970817bafe5fa4f9d4efed7da81024af19ff1e78717f7a144091955613818385ee08ed0a5c7e8bbacd523788edbeacd50 EBUILD bash-4.2_p53.ebuild 6629 SHA256 c6f50d54aebaede7c66c5090b4bd5d8b7ebb8e5a1064dfbd34d0d8b3cc00ccd5 SHA512 87a7b0b0afc63bb7bc60bf1a594368df6db7f0c5451ca9c04e558da5e4d28e673afbbb2186026d51e671ff958a421731af141a75f18a8714067df5eced79b716 WHIRLPOOL b8e488e8bbba07cf0de70720d0d0186eb133fe3ee1325901000cf7900aa8d0531b466cfb4d4c76789d1ee8156c0b14be6e4c60534e435303a361569416809602 +EBUILD bash-4.3_p30-r1.ebuild 7206 SHA256 e056cb8254f804c08c144121e4455f1e3db73029223023b82b807f6f2aa7810f SHA512 8741ebe078a4b0f5b9dfdd5df52d4b1f590e33155f6ac7dcc4a5fbbf0556e4d546a60b2f437fefc446ccfdb4275ec5b9cb2246f3d023f5c58af19d31a68119df WHIRLPOOL 828d503e5b444837fd49b64970738ac2491230661818816ff4123e003a885039cb6da7b83920a78ce9cb261c3cfefc08d71b94effedecfe0e0332e0c60863725 EBUILD bash-4.3_p30.ebuild 7145 SHA256 8feca632295298ec93314ce158427e9e5a0c699334dacd2f0017bd378703c071 SHA512 10a359f9b798ed4e6aa6396226ac2f64fd618c06156318dc3fe62f59988b36003f8dad36c12749431cb1f18d9479c8d6babede3e50ee2570fa8ce7c0705b6772 WHIRLPOOL 9fe6042dbb71b21e47cddbc21e5515a4e9a16acf86b2da89d1c8e0c2ee903905eda57014f930fe3af4b6431c8bbedbfa78b623a85f3b7d57cc76e18862c0269a -MISC ChangeLog 72475 SHA256 9c8b8e9be31163a76b60afdda587f6530c9ed5cfc1866bb53442084a496d2838 SHA512 aa72e1798b71127795556526e7f22544b527414a3cc807738bdb07854a480023f217a30cb5959b476c6297d564b37b868a48ad4763d8264edb0ae78b21475226 WHIRLPOOL 78a71b43a403f21b2e17c43eaeaa933371116668775d24d16478a4148c3181f47dd3524fde313dc738731f66c82db78dec2cb0eee3846148b8b367202b47d8a4 +MISC ChangeLog 72699 SHA256 03e740c3d69a3b53b42f5902511506e6357be3d03771f392a32ae073062f18f7 SHA512 e33f8e00eaac9ec6c1edbee767574c3be76e7f8de05d667cce32d6f8141aeb914fbdc46350a5fe7dc980ee4e79b275c559b34bf61c365b19a4f85fa6a01c34e2 WHIRLPOOL 5efe302cfdd5c86dfbab8c4edd862406873833a77c4a64830500edfebe9e1aa26ff9edc94cbe6a99fe0c9782a1b4db3b4c604d80ff6cd0331b5f3b37e51df020 MISC metadata.xml 643 SHA256 928c1ec952dec872f913d5e121725431435f651a87e48e784617c49f9dcf806a SHA512 3eb4baf0efbee2606a1e56d0359c3489887fb3f2e0dfe9ba25b6143b9d5e02b8df06a8065019201184b1fca12b8a86d781a68131810b80784c678765d55df679 WHIRLPOOL 52aeb839d294d5f43af735698afb6ee8f99e388c86260e1a1cc0d8fa57671bb8bef36f09d3f7e84cb70bc5fba0d645b427033c13b6ebbc66f5520acb1985b8b6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQIcBAEBCAAGBQJURJo9AAoJEPGu1DbS6WIAm0wQAJrpH6jEN8N0ClJwY2UqC0j0 -V2Fy4dJ1p7f1VWCb5qOsZ//eKC6GB31JshkZcw1s5dWaakZcSHtd3GidC+dTrM04 -PeuUdnhEESnGMXySUbI7ftAHrVLlUtPgjyYHThKBjvpyc7ovxyCVSkvQMwQNP0ou -sNLrLXf9NqnzwGmESiV0ubv8w852wOTKJszW6PpM0gp+/TVuw75vn/AuPU+y8fgE -SurHZdBmQvIco75+PWUWu3mcvsqfCNMUmD6SoVeCw75hL1Ge4fepKPugyYFwUSM8 -WPJLHlgrbDzmHI87G3cy+89VU3Dhb889Q6m4OF/5q/p03/v5Y/P458X4mlbzhxBM -93BfAHwXV6d7NULQEOxZtCXcoo+0WwGcOC8cWpcOS6K2p+oWxQ6acJd1hA3TCOgp -vIxuL/tUYe3dd8jQ8tuR4uQP04PdI9FlvcUjOWr1Rd4qUMPPitIC8CNEqnATQVqw -K3U4BNnzSiYwzH6vFrI6g+dgoh6pU2Q6WuQdokvwmenqpM3JqyAeFNzEGHAOhSEg -2p0tGEr6pGUBYJkm7wbKLfWvxx67rVl2G56Y3gM31Rt1x+lVnWouEibC4fteyvjt -aMqwc6JtGzEydM6mUAz/fTy51u/w6UOHTHiCDf0NQdc2mboJ9G7ARy2TYkVK++mq -YOU4d10YVz80wtLsGtw2 -=r8/Z +iQJ8BAEBCABmBQJUX9F6XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC +MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZOGaIP/RUSX2Zbcy78Fbb3uoai2IIq +yf8fp+hv9ZWtIRmeRM2qrNfZhA+uQ1qta7bW3X/CBa9hYF5X5E7LqeQuHikdJZYo +qPO/H5K/fAGGt46HVbWwd/WDh698Oy/OpGqZoePGIwL5uUWPrywx2pQg8gEZD/9R +K7L6mMcP99kh/6+Ec7UGBznhJhKcWHTNhBGVMrJf0qoVxwPIp+zlENP208VjgXPZ +Bszl6IWYfiX4RF3WFcs1Cv4nVEeaPCclqzejEZ+Q1zMQu7ttd56b1UnhgT35elxj +kGIwbDhGfwrSDyu/R7UeBeUV8adZ6N5azcE3RdA9Jdq3wFQAZeFqJ51LHHgs7Jf6 +hrJTa0S4XFc2Ib0w3DCU2GM4CgQ5bnbzXn79wxb1Cf2leyFWnfx0UV+SL49BoxoF +c8RNsO3cJUQAreSBRExuW5qDt7zwsbNCj9kGXSeiIQRze1m/69fY9KAy2vN8en4R +xy9zHPO1WtiZN039xPKhcy7nPsjAUfNUtqPwvPgfBP/WlloPVkCYJwfO2Kv8SdZH +NSN+22XzV/bpifDGUdqm53PMoANElLEqAjFg/3lxO4DFfFIx2cuVYQuIJzZi5J0e +EXgILayVbvAz6hgoq00s/9qsbrGdBitjwwQzs9FCeiwfe7Y2LzWdRW8KCX5QCs0V +gFBoZ1d8QTDPGfp/qlOi +=Xkbl -----END PGP SIGNATURE----- diff --git a/app-shells/bash/bash-4.3_p30-r1.ebuild b/app-shells/bash/bash-4.3_p30-r1.ebuild new file mode 100644 index 000000000000..6b18603f3447 --- /dev/null +++ b/app-shells/bash/bash-4.3_p30-r1.ebuild @@ -0,0 +1,248 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.3_p30-r1.ebuild,v 1.1 2014/11/09 20:41:28 mgorny Exp $ + +EAPI="4" + +inherit eutils flag-o-matic toolchain-funcs multilib + +# Official patchlevel +# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/ +PLEVEL=${PV##*_p} +MY_PV=${PV/_p*} +MY_PV=${MY_PV/_/-} +MY_P=${PN}-${MY_PV} +[[ ${PV} != *_p* ]] && PLEVEL=0 +patches() { + local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} + [[ ${plevel} -eq 0 ]] && return 1 + eval set -- {1..${plevel}} + set -- $(printf "${pn}${pv/\.}-%03d " "$@") + if [[ ${opt} == -s ]] ; then + echo "${@/#/${DISTDIR}/}" + else + local u + for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do + printf "${u}/${pn}-${pv}-patches/%s " "$@" + done + fi +} + +# The version of readline this bash normally ships with. +READLINE_VER="6.3" + +DESCRIPTION="The standard GNU Bourne again shell" +HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html" +SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" +[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla" + +DEPEND=">=sys-libs/ncurses-5.2-r2 + readline? ( >=sys-libs/readline-${READLINE_VER} ) + nls? ( virtual/libintl )" +RDEPEND="${DEPEND} + !<sys-apps/portage-2.1.6.7_p1 + !<sys-apps/paludis-0.26.0_alpha5" +# we only need yacc when the .y files get patched (bash42-005) +DEPEND+=" virtual/yacc" + +S=${WORKDIR}/${MY_P} + +pkg_setup() { + if is-flag -malign-double ; then #7332 + eerror "Detected bad CFLAGS '-malign-double'. Do not use this" + eerror "as it breaks LFS (struct stat64) on x86." + die "remove -malign-double from your CFLAGS mr ricer" + fi + if use bashlogger ; then + ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs." + ewarn "This will log ALL output you enter into the shell, you have been warned." + fi +} + +src_unpack() { + unpack ${MY_P}.tar.gz +} + +src_prepare() { + # Include official patches + [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s) + + # Clean out local libs so we know we use system ones w/releases. + if [[ ${PV} != *_rc* ]] ; then + rm -rf lib/{readline,termcap}/* + touch lib/{readline,termcap}/Makefile.in # for config.status + sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die + fi + + # Avoid regenerating docs after patches #407985 + sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die + touch -r . doc/* + + epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch + epatch "${FILESDIR}"/${PN}-4.3-parse-time-keyword.patch + epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch + epatch "${FILESDIR}"/${PN}-4.3-term-cleanup.patch + + epatch_user +} + +src_configure() { + local myconf=() + + # For descriptions of these, see config-top.h + # bashrc/#26952 bash_logout/#90488 ssh/#24762 + append-cppflags \ + -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \ + -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \ + -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \ + -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \ + -DNON_INTERACTIVE_LOGIN_SHELLS \ + -DSSH_SOURCE_BASHRC \ + $(use bashlogger && echo -DSYSLOG_HISTORY) + + # Don't even think about building this statically without + # reading Bug 7714 first. If you still build it statically, + # don't come crying to us with bugs ;). + #use static && export LDFLAGS="${LDFLAGS} -static" + use nls || myconf+=( --disable-nls ) + + # Historically, we always used the builtin readline, but since + # our handling of SONAME upgrades has gotten much more stable + # in the PM (and the readline ebuild itself preserves the old + # libs during upgrades), linking against the system copy should + # be safe. + # Exact cached version here doesn't really matter as long as it + # is at least what's in the DEPEND up above. + export ac_cv_rl_version=${READLINE_VER} + + # Force linking with system curses ... the bundled termcap lib + # sucks bad compared to ncurses. For the most part, ncurses + # is here because readline needs it. But bash itself calls + # ncurses in one or two small places :(. + + if [[ ${PV} != *_rc* ]] ; then + # Use system readline only with released versions. + myconf+=( --with-installed-readline=. ) + fi + + if use plugins; then + append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash + else + # Disable the plugins logic by hand since bash doesn't + # provide a way of doing it. + export ac_cv_func_dl{close,open,sym}=no \ + ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no + sed -i \ + -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \ + configure || die + fi + tc-export AR #444070 + econf \ + --docdir='$(datarootdir)'/doc/${PF} \ + --htmldir='$(docdir)/html' \ + --with-curses \ + $(use_with afs) \ + $(use_enable net net-redirections) \ + --disable-profiling \ + $(use_enable mem-scramble) \ + $(use_with mem-scramble bash-malloc) \ + $(use_enable readline) \ + $(use_enable readline history) \ + $(use_enable readline bang-history) \ + "${myconf[@]}" +} + +src_compile() { + emake + + if use plugins ; then + emake -C examples/loadables all others + fi +} + +src_install() { + local d f + + default + + dodir /bin + mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die + dosym bash /bin/rbash + + insinto /etc/bash + doins "${FILESDIR}"/bash_logout + newins "${FILESDIR}"/bashrc-r1 bashrc + keepdir /etc/bash/bashrc.d + insinto /etc/skel + for f in bash{_logout,_profile,rc} ; do + newins "${FILESDIR}"/dot-${f} .${f} + done + + local sed_args=( + -e "s:#${USERLAND}#@::" + -e '/#@/d' + ) + if ! use readline ; then + sed_args+=( #432338 + -e '/^shopt -s histappend/s:^:#:' + -e 's:use_color=true:use_color=false:' + ) + fi + sed -i \ + "${sed_args[@]}" \ + "${ED}"/etc/skel/.bashrc \ + "${ED}"/etc/bash/bashrc || die + + if use plugins ; then + exeinto /usr/$(get_libdir)/bash + doexe $(echo examples/loadables/*.o | sed 's:\.o::g') + insinto /usr/include/bash-plugins + doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h} + fi + + if use examples ; then + for d in examples/{functions,misc,scripts,startup-files} ; do + exeinto /usr/share/doc/${PF}/${d} + insinto /usr/share/doc/${PF}/${d} + for f in ${d}/* ; do + if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then + doexe ${f} + else + doins ${f} + fi + done + done + fi + + doman doc/*.1 + newdoc CWRU/changelog ChangeLog + dosym bash.info /usr/share/info/bashref.info +} + +pkg_preinst() { + if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then + mkdir -p "${EROOT}"/etc/bash + mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ + fi + + if [[ -L ${EROOT}/bin/sh ]] ; then + # rewrite the symlink to ensure that its mtime changes. having /bin/sh + # missing even temporarily causes a fatal error with paludis. + local target=$(readlink "${EROOT}"/bin/sh) + local tmp=$(emktemp "${EROOT}"/bin) + ln -sf "${target}" "${tmp}" + mv -f "${tmp}" "${EROOT}"/bin/sh + fi +} + +pkg_postinst() { + # If /bin/sh does not exist, provide it + if [[ ! -e ${EROOT}/bin/sh ]] ; then + ln -sf bash "${EROOT}"/bin/sh + fi +} diff --git a/app-shells/bash/files/bashrc-r1 b/app-shells/bash/files/bashrc-r1 new file mode 100644 index 000000000000..300070974f54 --- /dev/null +++ b/app-shells/bash/files/bashrc-r1 @@ -0,0 +1,92 @@ +# /etc/bash/bashrc +# +# This file is sourced by all *interactive* bash shells on startup, +# including some apparently interactive shells such as scp and rcp +# that can't tolerate any output. So make sure this doesn't display +# anything or bad things will happen ! + + +# Test for an interactive shell. There is no need to set anything +# past this point for scp and rcp, and it's important to refrain from +# outputting anything in those cases. +if [[ $- != *i* ]] ; then + # Shell is non-interactive. Be done now! + return +fi + +# Bash won't get SIGWINCH if another process is in the foreground. +# Enable checkwinsize so that bash will check the terminal size when +# it regains control. #65623 +# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) +shopt -s checkwinsize + +# Enable history appending instead of overwriting. #139609 +shopt -s histappend + +# Change the window title of X terminals +case ${TERM} in + xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' + ;; + screen*) + PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"' + ;; +esac + +use_color=false +#BSD#@# BSD doesn't typically come with dircolors so we need +#BSD#@# to hardcode some terminals in here. +#BSD#@case ${TERM} in +#BSD#@ xterm*|rxvt*|Eterm|aterm|kterm|gnome*|screen|cons25) use_color=true;; +#BSD#@esac + +# Set colorful PS1 only on colorful terminals. +# dircolors --print-database uses its own built-in database +# instead of using /etc/DIR_COLORS. Try to use the external file +# first to take advantage of user additions. Use internal bash +# globbing instead of external grep binary. +safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM +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} ]] \ + && type -P dircolors >/dev/null \ + && 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 type -P dircolors >/dev/null ; then + if [[ -f ~/.dir_colors ]] ; then + eval $(dircolors -b ~/.dir_colors) + elif [[ -f /etc/DIR_COLORS ]] ; then + eval $(dircolors -b /etc/DIR_COLORS) + fi + 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' + alias egrep='egrep --colour=auto' + alias fgrep='fgrep --colour=auto' +else + if [[ ${EUID} == 0 ]] ; then + # show root@ when we don't have colors + PS1='\u@\h \W \$ ' + else + PS1='\u@\h \w \$ ' + fi +fi + +for sh in /etc/bash/bashrc.d/* ; do + [[ -r ${sh} ]] && source "${sh}" +done + +# Try to keep environment pollution down, EPA loves us. +unset use_color safe_term match_lhs sh |