From 48a5f713c7f3796ef787c1bf683e0130720897d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 11 Sep 2007 20:25:01 +0000 Subject: [PATCH] - from pld-ac admin shell Changed files: shell/bash_profile -> 1.1 shell/bashrc -> 1.1 --- shell/bash_profile | 12 ++++++ shell/bashrc | 95 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 shell/bash_profile create mode 100644 shell/bashrc diff --git a/shell/bash_profile b/shell/bash_profile new file mode 100644 index 0000000..5e9f7aa --- /dev/null +++ b/shell/bash_profile @@ -0,0 +1,12 @@ +# .bashrc - file executed when executing bash + +# .bash_profile - file executed when logging in + +export EDITOR=vim + +# glen ;) +if [ "${SSH_CONNECTION%% *}" = "194.106.120.90" ]; then + export LC_ALL=C + export LANG=en_US + export TZ=EET +fi diff --git a/shell/bashrc b/shell/bashrc new file mode 100644 index 0000000..60a1996 --- /dev/null +++ b/shell/bashrc @@ -0,0 +1,95 @@ +# .bashrc - file executed when executing bash + +# Put your local aliases here +alias rmpkg="~/pld-ftp-admin/scripts/remove.py" +alias gen-indexes="~/pld-ftp-admin/scripts/gen-indexes.py" + +testmvpkg() { + ~/pld-ftp-admin/scripts/test-move.py "$@" || return $? + shift 2 + echo >&2 "Checking signatures" + testsignpkg "$@" || return $? +} + +mvpkg() { + __wrap_signpkg() { + shift 2 + testsignpkg "$@" || return $? + } + __wrap_signpkg "$@" || return $? + ~/pld-ftp-admin/scripts/move.py "$@" || return $? +} + +alias ls='ls --color=auto -BFN --show-control-chars' +alias l='ls -lh' +alias la='ls -la' +alias du='du -h' +alias df='df -Th' +alias vi='vim' +alias h='history $(($LINES-6))' + +# glen ;) +if [ "${SSH_CONNECTION%% *}" = "194.106.120.90" ]; then + . ~/okas/bashrc + alias cvsstat=~/okas/cvsstat +fi + +cp-kde-i18n() { + sarch=amd64 + info=$1 + if [ ! -f $info ]; then + echo >&2 "cp-kde-i18n: Specify existing info file" + return + fi + + for arch in alpha athlon i386 i586 i686 ppc sparc; do + awk -F: -vsarch=$sarch '/^file:/ && $2 == sarch {print $3}' $info | xargs -ri cp -al ../../$sarch/RPMS/{} ../../$arch/RPMS + awk -F: -vsarch=$sarch -varch=$arch '/^file:/ && $2 == sarch {printf("%s:%s:%s\n", $1, arch, $3)}' $info >> $info + done +} + +signpkg() { + local pkg=$1 + if [ ! -f $pkg ]; then + echo >&2 "signpkg: Specify existing info file" + return + fi + awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \ + xargs -l512 \ + rpm --resign +} + +testsignpkg() { + local pkg=$1 + if [ ! -f $pkg ]; then + echo >&2 "testsignpkg: Specify existing info file" + return + fi + local out + out=$( + awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \ + xargs -l512 \ + rpm -qp --qf '%{name}-%{version}-%{release}.%{arch} %{siggpg}\n' 2>/dev/null | \ + fgrep '(none)' | \ + sed -e 's,^,ERR: ,;s,(none),is not signed,' + ) + + if [ "$out" ]; then + echo "$out" + return 1 + else + return 0 + fi +} + +unlocktree() { + local tree="$1" + ( + cd ~/pld-ftp-admin/modules + python -c " +import ftpio +ftpio.connect() +ftpio.unlock('$tree') +" + ) +} -- 2.44.0