mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 17:36:59 +02:00
usr(bash): move bash to coreos-overlay
This commit is contained in:
parent
736d4bbae8
commit
2d3ef2cd9a
@ -1,21 +0,0 @@
|
||||
DIST bash-4.2.tar.gz 7009201 RMD160 df7ae51783f039a1234d3b720ffcf4bfa5d09673 SHA1 487840ab7134eb7901fbb2e49b0ee3d22de15cb8 SHA256 a27a1179ec9c0830c65c6aa5d7dab60f7ce1a2a608618570f96bfa72e95ab3d8
|
||||
DIST bash42-001 2944 RMD160 1e6432102cc0f0dd1dd0a207e4a892b4f13c00b0 SHA1 c069f07492c9199bc7cff71a4f032f668ba4ea0a SHA256 8d6ca028576c4af23e660a2fbc2112221a11c8a785c0b37f033967e5cd12b47a
|
||||
DIST bash42-002 1780 RMD160 833544ad6586b0ece53881cc850ff448ec563cbb SHA1 75b6726656a08e47172704545c57a290e29075e9 SHA256 febac927e199aceeba2004908d971d4afb49b521796c3f42d1166f9fbbfbcef9
|
||||
DIST bash42-003 6896 RMD160 9f6e560984997b595a0a6d85f751c1b8150300f0 SHA1 c18390edcc87c347cade67d9c1653f1f220ce64d SHA256 5a0a7c15018c87348ea87cb0beea14345faf878dbb0e25c17fa70677194cb4cd
|
||||
DIST bash42-004 1686 RMD160 5dba7fd5c6fdfa64bf9a2696a65698482d7e7bdd SHA1 e10f0e8d3c24c10efffbca4605acb966393901ff SHA256 4e34b0f830d2583d56e14225a66937abc81f45bbafcd2eb49daf61c9462140c1
|
||||
DIST bash42-005 3424 RMD160 09572f3971beaaaa9be1bde5f9e7d3a6e56e5159 SHA1 c1dd32f9aab963830cb9bf5c0973eefa4d7f8881 SHA256 a81749e73004b81cfdf0fe075bec365dc1fef756ee5e3fd142821e317d1459a0
|
||||
DIST bash42-006 1187 RMD160 92a4c3eb612fe1e74a6ded3623d1fbd8322fe843 SHA1 4ae28b47a46850db3a5936ff0fafb9056f15329f SHA256 c91148945a2ddafa792682d7c8668c59e7e645eae1334b15b0d5d9ad22634bd1
|
||||
DIST bash42-007 1394 RMD160 73285b61d25a7f998d52965d0615cdd547252527 SHA1 31cf0373b1d4d61540474b6f527bf7675e8773f3 SHA256 405826acf443dd1084f236a15cb76d7f0ee2dbe5edff45c5fb836db571fb7e95
|
||||
DIST bash42-008 2164 RMD160 45ce8834c1ca6f8dbfc2551fd19067c1d425e01b SHA1 7f0961aaf284b36eac1503824cd9e85926628120 SHA256 23080d11a60a78941210e2477f6bca066b45db03defa60da86fd765107ba2437
|
||||
DIST bash42-009 2384 RMD160 3b191c111071fca49490d8dabc6d973b57453eca SHA1 c7f9dede34e30494a9adb479e406814f4d62da2a SHA256 e7ed5440b4c19765786e90e4f1ded43195d38b3e4d1c4b39fcc23de9a74ccb20
|
||||
DIST bash42-010 1818 RMD160 e77d2725c0613dd8d5a83a8e7dfcba29b7aa419f SHA1 662192c4675300f488897a6ed8774e16e7a13e2e SHA256 acfc5482c25e6923116fcf4b4f7f6345b80f75ad7299749db4b736ad67aa43dc
|
||||
DIST bash42-011 1426 RMD160 8b074057235280624eab8b4736cff681893e3aa0 SHA1 5f4131f3ab9751a6828269ef4079a841258671cb SHA256 a491ae359a7ebbd7321aede561728289d71e1fc84777f402766a8afd4d261532
|
||||
DIST bash42-012 4247 RMD160 44913fb6646b26520f5349ada2a45fbf7d081206 SHA1 aad2483f7f48c29274ce0ef63027f3749b8388fc SHA256 354433f1d2da02f1b9652cd20a5b85bbfb5bc2aaf79c42461ebd929d89b9b7b8
|
||||
DIST bash42-013 1340 RMD160 24e23ac56b4bbc868ccdaab0ab96128a727dfb9f SHA1 2d60fc3b0ee40f9eb308b76185142f865df0fa17 SHA256 3412c5c6cbbce6c88592604aec054d8182ce64410038b5ecea69fc3968cf85ea
|
||||
DIST bash42-014 1434 RMD160 9b1f57f54577ae0abca98503c8afb064e1256383 SHA1 320bba1f869602c07a9972862d38b9ba108726a6 SHA256 b5a678e609858532735f94faedb5fabce00dfd6577a4e9ec5eec85fe682c8b33
|
||||
DIST bash42-015 1991 RMD160 9c98e543892050ccd5ebc324687d0461acb882e6 SHA1 7b9c9a91ab5a79b8344877ff45ed204ba1b04ef3 SHA256 2d876a8304bdf3d664e87e0a8d73bc4ccc100a9dd8c0d054e8649472d8748a98
|
||||
DIST bash42-016 1410 RMD160 b57a43affdb3ecede627945a03ffe386b0e6ee55 SHA1 f4a39fb2b79f7c5c04ee78fb598199ba7440fd70 SHA256 2895ccbcf7fc98da73a8fa3ba7440aaf2bfaef6c0af8bdd3a9c39403cf03e2a6
|
||||
DIST bash42-017 1399 RMD160 b352a79b20d8cc6bc80b65b30ce36e4c456780e9 SHA1 f80797fce1fefff4047cecf0f32731bc30f6faee SHA256 73552444498c761d6073dd67ccfe043b36ef24bb418c266d91d9750884daee7f
|
||||
DIST bash42-018 1929 RMD160 06e93430b076de51e68f679054540d202ad241c5 SHA1 3624c31ed7d8c613b566e3d465480beed34bdaba SHA256 e2a9457172370d454d31b84bbcba758ee6394316dbe755374553b52aadbb494d
|
||||
DIST bash42-019 1415 RMD160 7dc05011b79f37553c4a669ba929c55a18727ea9 SHA1 21a75dadb1398775b48718e94785642f5fad9777 SHA256 a8b7cd02207656976016d93cab48e073cb5da002ceb27b7a63fc5ea62007eb56
|
||||
DIST bash42-020 1825 RMD160 4a66e21e8288322b1aed7f0698a684f10f4934bb SHA1 5c4afeef6ef7321fcc5a08f2d3024c484868fa59 SHA256 494773f0d0078cb35372d24caa523b00d8fdbbaed71e41dc14c9e47579da3c6f
|
@ -1,196 +0,0 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p20.ebuild,v 1.10 2012/03/25 16:31:53 maekke Exp $
|
||||
|
||||
EAPI="1"
|
||||
|
||||
inherit eutils flag-o-matic toolchain-funcs multilib
|
||||
|
||||
# Official patchlevel
|
||||
# See ftp://ftp.cwru.edu/pub/bash/bash-4.2-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
|
||||
}
|
||||
|
||||
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)"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd"
|
||||
IUSE="afs bashlogger examples mem-scramble +net nls plugins vanilla"
|
||||
|
||||
DEPEND=">=sys-libs/ncurses-5.2-r2
|
||||
>=sys-libs/readline-6.2
|
||||
nls? ( virtual/libintl )"
|
||||
RDEPEND="${DEPEND}
|
||||
!<sys-apps/portage-2.1.7.16
|
||||
!<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
|
||||
cd "${S}"
|
||||
|
||||
# Include official patches
|
||||
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
|
||||
|
||||
# Clean out local libs so we know we use system ones
|
||||
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
|
||||
|
||||
# Avoid regenerating docs after patches #407985
|
||||
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
|
||||
touch -r . doc/*
|
||||
|
||||
epatch "${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237
|
||||
epatch "${FILESDIR}"/${PN}-4.2-parallel-build.patch
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
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="${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=6.2
|
||||
|
||||
# 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 :(.
|
||||
|
||||
use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
|
||||
econf \
|
||||
--with-installed-readline=. \
|
||||
--with-curses \
|
||||
$(use_with afs) \
|
||||
$(use_enable net net-redirections) \
|
||||
--disable-profiling \
|
||||
$(use_enable mem-scramble) \
|
||||
$(use_with mem-scramble bash-malloc) \
|
||||
${myconf}
|
||||
emake || die
|
||||
|
||||
if use plugins ; then
|
||||
emake -C examples/loadables all others || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake install DESTDIR="${D}" || die
|
||||
|
||||
dodir /bin
|
||||
mv "${D}"/usr/bin/bash "${D}"/bin/ || die
|
||||
dosym bash /bin/rbash
|
||||
|
||||
insinto /etc/bash
|
||||
doins "${FILESDIR}"/{bashrc,bash_logout}
|
||||
insinto /etc/skel
|
||||
for f in bash{_logout,_profile,rc} ; do
|
||||
newins "${FILESDIR}"/dot-${f} .${f}
|
||||
done
|
||||
|
||||
sed -i -e "s:#${USERLAND}#@::" "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
|
||||
sed -i -e '/#@/d' "${D}"/etc/skel/.bashrc "${D}"/etc/bash/bashrc
|
||||
|
||||
if use plugins ; then
|
||||
exeinto /usr/$(get_libdir)/bash
|
||||
doexe $(echo examples/loadables/*.o | sed 's:\.o::g') || die
|
||||
fi
|
||||
|
||||
if use examples ; then
|
||||
for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; 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
|
||||
dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
|
||||
dosym bash.info /usr/share/info/bashref.info
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if [[ -e ${ROOT}/etc/bashrc ]] && [[ ! -d ${ROOT}/etc/bash ]] ; then
|
||||
mkdir -p "${ROOT}"/etc/bash
|
||||
mv -f "${ROOT}"/etc/bashrc "${ROOT}"/etc/bash/
|
||||
fi
|
||||
|
||||
if [[ -L ${ROOT}/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 "${ROOT}"/bin/sh)
|
||||
local tmp=$(emktemp "${ROOT}"/bin)
|
||||
ln -sf "${target}" "${tmp}"
|
||||
mv -f "${tmp}" "${ROOT}"/bin/sh
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# If /bin/sh does not exist, provide it
|
||||
if [[ ! -e ${ROOT}/bin/sh ]]; then
|
||||
ln -sf bash "${ROOT}"/bin/sh
|
||||
fi
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
fix build when job control is disabled
|
||||
|
||||
http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00110.html
|
||||
http://lists.gnu.org/archive/html/bug-bash/2011-07/msg00057.html
|
||||
http://lists.gnu.org/archive/html/bug-bash/2011-09/msg00039.html
|
||||
https://bugs.gentoo.org/383237
|
||||
|
||||
should be fixed in next release of bash ...
|
||||
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -2202,7 +2202,11 @@
|
||||
/* If the `lastpipe' option is set with shopt, and job control is not
|
||||
enabled, execute the last element of non-async pipelines in the
|
||||
current shell environment. */
|
||||
- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
|
||||
+ if (lastpipe_opt &&
|
||||
+#if defined(JOB_CONTROL)
|
||||
+ job_control == 0 &&
|
||||
+#endif
|
||||
+ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
|
||||
{
|
||||
lstdin = move_to_high_fd (0, 0, 255);
|
||||
if (lstdin > 0)
|
@ -1,106 +0,0 @@
|
||||
https://lists.gnu.org/archive/html/bug-bash/2011-10/msg00036.html
|
||||
|
||||
the current yacc rules allow multiple runs to generate the same files. usually
|
||||
this doesn't come up as the generated files are shipped in the tarball, but
|
||||
when you modify parse.y (applying a patch or developing or whatever), you can
|
||||
hit this problem.
|
||||
|
||||
simple way of showing this:
|
||||
make -j y.tab.{c,h}
|
||||
a correct system would not show the yacc parser running twice :)
|
||||
|
||||
simple patch is to have the .h file depend on the .c file, and have the .h file
|
||||
itself issue a dummy rule (to avoid make thinking things changed).
|
||||
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -579,16 +579,17 @@
|
||||
|
||||
# old rules
|
||||
GRAM_H = parser-built
|
||||
-y.tab.o: y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h
|
||||
+y.tab.o: y.tab.h y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h
|
||||
${GRAM_H}: y.tab.h
|
||||
@-if test -f y.tab.h ; then \
|
||||
cmp -s $@ y.tab.h 2>/dev/null || cp -p y.tab.h $@; \
|
||||
fi
|
||||
-y.tab.c y.tab.h: parse.y
|
||||
+y.tab.c: parse.y
|
||||
# -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
|
||||
$(YACC) -d $(srcdir)/parse.y
|
||||
touch parser-built
|
||||
# -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; else cp -p y.tab.h ${GRAM_H}; fi
|
||||
+y.tab.h: y.tab.c ; @true
|
||||
|
||||
# experimental new rules - work with GNU make but not BSD (or OSF) make
|
||||
#y.tab.o: y.tab.c y.tab.h
|
||||
|
||||
https://lists.gnu.org/archive/html/bug-bash/2011-10/msg00037.html
|
||||
|
||||
the current code generates a bunch of local libraries in subdirs and then
|
||||
links bash against that. those subdirs sometimes need version.h. so they
|
||||
have a rule to change back up to the parent dir and build version.h (which is
|
||||
fine). the trouble is that the top level objects and the subdirs are allowed
|
||||
to build in parallel, so it's possible for multiple children to see that
|
||||
version.h is not available and that it needs to be created, so they all do.
|
||||
|
||||
there is even more trouble is that version.h depends on all the top level
|
||||
sources, some of which are compiled (like syntax.c). so these parallel
|
||||
children all kick off a job to generate syntax.c which in turn requires the
|
||||
mksyntax helper executable. obviously multiple processes rm-ing, compiling,
|
||||
and linking the same files quickly falls apart.
|
||||
|
||||
so tweak the subdirs to all depend on the .build target which in turn depends
|
||||
on all of these top level files being generated. now the subdirs won't try and
|
||||
recursively enter the top level.
|
||||
|
||||
(noticed by David James)
|
||||
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -597,6 +598,11 @@
|
||||
# $(YACC) -d $(srcdir)/parse.y
|
||||
# -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
|
||||
|
||||
+# Subdirs will often times want version.h, so they'll change back up to
|
||||
+# the top level and try to create it. This causes parallel build issues
|
||||
+# so just force top level sanity before we descend.
|
||||
+$(LIBDEP): .build
|
||||
+
|
||||
$(READLINE_LIBRARY): config.h $(READLINE_SOURCE)
|
||||
@echo making $@ in ${RL_LIBDIR}
|
||||
@( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \
|
||||
|
||||
http://lists.gnu.org/archive/html/bug-bash/2011-10/msg00107.html
|
||||
|
||||
the top level Makefile will recurse into the defdir for multiple targets
|
||||
(libbuiltins.a, common.o, bashgetopt.o, builtext.h), and since these do
|
||||
not have any declared interdependencies, parallel makes will recurse into
|
||||
the subdir and build the respective targets.
|
||||
|
||||
nothing depends on common.o or bashgetopt.o, so those targets don't get
|
||||
used normally. this leaves libbuiltins.a and builtext.h. at a glance,
|
||||
this shouldn't be a big deal, but when we look closer, there's a subtle
|
||||
failure lurking.
|
||||
|
||||
most of the objects in the defdir need to be generated which means they
|
||||
need to build+link the local mkbuiltins helper. the builtext.h header
|
||||
also needs to be generated by the mkbuiltins helper. so when the top
|
||||
level launches a child for libbuiltins.a and a child for builtext.h, we
|
||||
can hit a race condition where the two try to generate mkbuiltins, and
|
||||
the build randomly fails.
|
||||
|
||||
so update libbuiltins.a to depend on builtext.h. this should be fairly
|
||||
simple since it's only a single target.
|
||||
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -674,7 +674,7 @@
|
||||
$(RM) $@
|
||||
./mksyntax$(EXEEXT) -o $@
|
||||
|
||||
-$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h version.h
|
||||
+$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h ${DEFDIR}/builtext.h version.h
|
||||
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libbuiltins.a ) || exit 1
|
||||
|
||||
# these require special rules to circumvent make builtin rules
|
@ -1,9 +0,0 @@
|
||||
# /etc/bash/bash_logout
|
||||
|
||||
# This file is sourced when a login shell terminates.
|
||||
|
||||
# You may wish to clear everyone's screen when they logout.
|
||||
#clear
|
||||
|
||||
# Or maybe you want to leave a thoughtful note.
|
||||
#fortune
|
@ -1,86 +0,0 @@
|
||||
# /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)
|
||||
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'
|
||||
else
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
# show root@ when we don't have colors
|
||||
PS1='\u@\h \W \$ '
|
||||
else
|
||||
PS1='\u@\h \w \$ '
|
||||
fi
|
||||
fi
|
||||
|
||||
# Try to keep environment pollution down, EPA loves us.
|
||||
unset use_color safe_term match_lhs
|
@ -1,6 +0,0 @@
|
||||
# /etc/skel/.bash_logout
|
||||
|
||||
# This file is sourced when a login shell terminates.
|
||||
|
||||
# Clear the screen for security's sake.
|
||||
clear
|
@ -1,5 +0,0 @@
|
||||
# /etc/skel/.bash_profile
|
||||
|
||||
# This file is sourced by bash for login shells. The following line
|
||||
# runs your .bashrc and is recommended by the bash info pages.
|
||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
@ -1,18 +0,0 @@
|
||||
# /etc/skel/.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
|
||||
|
||||
|
||||
# Put your fun stuff here.
|
Loading…
Reference in New Issue
Block a user