# .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 alias dump-locks=~/pld-ftp-admin/scripts/dump-locks.py testmvpkg() { from="$1" to="$2" ~/pld-ftp-admin/scripts/test-move.py "$@" || return $? shift 2 if [ "$to" = "PLD" -o "$to" = "updates" ]; then echo >&2 "Checking signatures" testsignpkg "$@" || return $? fi } mvpkg() { __wrap_signpkg() { shift 2 testsignpkg "$@" || return $? } if [ "$2" = "PLD" -o "$2" = "updates" ]; then __wrap_signpkg "$@" || return $? fi ~/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 [ -f /usr/share/okas/bashrc ] && . /usr/share/okas/bashrc fi cp-kde-i18n() { local sarch=$1 local info=$2 if [ -z "$sarch" -o ! -f "$info" ]; then echo >&2 "Usage: cp-kde-i18n [SOURCE ARCH] [INFO FILE]" return fi if [ $(grep -c "^file:$sarch:" "$info") = 0 ]; then echo >&2 "cp-kde-i18n: $sarch doesn't look like arch that has packages built" return fi for arch in amd64 alpha athlon i386 i586 i686 ppc sparc; do if [ "$arch" = "$sarch" ]; then continue fi 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 } touchpkg() { local pkg=$1 if [ ! -f $pkg ]; then echo >&2 "touchpkg: Specify existing info file" return fi awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \ xargs -l512 -r touch } signpkg() { local pkg=$1 if [ ! -f $pkg ]; then echo >&2 "signpkg: Specify existing info file" return fi echo "$@" | xargs awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' | \ xargs -l1 -I '%{F}' rpm --nodigest --nosignature -qp --qf '%|SIGGPG?{}:{%{F}\n}|' '%{F}' | \ xargs -r 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') " ) }