SVN: people/hawk/ftp_admin/.bashrc

hawk hawk at pld-linux.org
Wed Feb 20 12:29:18 CET 2008


Author: hawk
Date: Wed Feb 20 12:29:18 2008
New Revision: 9467

Added:
   people/hawk/ftp_admin/.bashrc
Log:
- as filename says, some usefull aliases


Added: people/hawk/ftp_admin/.bashrc
==============================================================================
--- (empty file)
+++ people/hawk/ftp_admin/.bashrc	Wed Feb 20 12:29:18 2008
@@ -0,0 +1,100 @@
+# .bashrc - file executed when executing bash
+
+if [ -f /etc/bashrc ]; then
+	. /etc/bashrc
+fi
+
+# 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')
+"
+	)
+}


More information about the pld-cvs-commit mailing list