summaryrefslogtreecommitdiffstats
path: root/.bashrc
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-05-24 18:09:24 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-05-24 18:09:24 +0200
commit32f07f459cc403807b1b6e9a596c57afd57fedd3 (patch)
treec560749093c3ae449955de3b688c007c018f2270 /.bashrc
parente2a5a414067c63cdc19f03fa1a7154fd1b8b04b6 (diff)
downloaddotfiles-32f07f459cc403807b1b6e9a596c57afd57fedd3.tar.gz
dotfiles-32f07f459cc403807b1b6e9a596c57afd57fedd3.tar.xz
dotfiles-32f07f459cc403807b1b6e9a596c57afd57fedd3.zip
.bashrc: restructure/split
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc59
1 files changed, 12 insertions, 47 deletions
diff --git a/.bashrc b/.bashrc
index df61c53..06eee2f 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,9 +1,9 @@
# .bashrc
-# Source global definitions
-if [ -f /etc/bashrc ]; then
- . /etc/bashrc
-fi
+# Source the other common definitions
+for f in /etc/bashrc ~/.bashrc-fedora ~/.bashrc-priv; do
+ [ -f "${f}" ] && source "${f}" || :
+done
# User specific aliases and functions
@@ -17,42 +17,8 @@ PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
alias mc='LESS="-RSX" mc'
-# see https://bugzilla.redhat.com/show_bug.cgi?id=852197
-pkgdep() {
- TMPFILE=$(mktemp rpqXXXX);
- repoquery --tree-requires -- "$1" \
- | grep -v -eglibc -e$(rpm -q python) -e$(rpm -q python-libs) \
- | sed -n '$q;/^.*bash/bend;p;d;:end n;bend' \
- | tac >${TMPFILE}
- while sed -i \
- 's/^\([ ]*\)|\([^|\\]*\)/\1 \2/;t;1bbad;:ok $q0;n;bok;:bad $q1;n;bbad' \
- ${TMPFILE}; do : ; done
- cat -- ${TMPFILE} | tac
- rm -f -- ${TMPFILE}
-}
-
-# something like "fedpkg prep"
-rpmbuild-patch() {
- local filter=cat verbose=
- if [ "$1" = "-v" ]; then
- verbose="--define \"_default_patch_flags $(rpm --eval %{_default_patch_flags}) --verbose\""
- shift
- fi
- [ -t 1 ] && filter='sed s|^\(Hunk.*\)|\x1b[1;31m\1\x1b[0m|'
- { LC=C eval rpmbuild -bp --nodeps \
- --define \"_builddir $(pwd)\" \
- --define \"_sourcedir $(pwd)\" \
- ${verbose} \"${@}\"
- } | ${filter}
-}
-
-# Jim Meyring's take on "display the programs with W and X memory"
-# http://lists.fedoraproject.org/pipermail/devel/2013-April/181747.html
-sec-wx-mem() {
- grep -lE '^[0-9a-f-]+ .wx' /proc/*/maps 2>/dev/null \
- | perl -ne 'm!^(/proc/(\d+))/.*! and printf qq(%5d %s\n), $2, `cat $1/cmdline`' \
- | tr '\0' ' '
-}
+alias gmy="cd ~/wrkspc/gmy"
+alias gwork="cd ~/wrkspc/gwork"
cdup() {
local up="."
@@ -65,11 +31,10 @@ cdmk() {
cd "$1" 2>/dev/null || { mkdir "$1"; cd "$1";}
}
-whichpkg() {
- rpm -qf "$(which "$1")"
+# Jim Meyring's take on "display the programs with W and X memory"
+# http://lists.fedoraproject.org/pipermail/devel/2013-April/181747.html
+sec-wx-mem() {
+ grep -lE '^[0-9a-f-]+ .wx' /proc/*/maps 2>/dev/null \
+ | perl -ne 'm!^(/proc/(\d+))/.*! and printf qq(%5d %s\n), $2, `cat $1/cmdline`' \
+ | tr '\0' ' '
}
-
-alias gmy="cd ~/wrkspc/gmy"
-alias gwork="cd ~/wrkspc/gwork"
-
-alias gkoji="cd ~/wrkspc/gkoji"