]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - shell/bashrc
- pointless
[projects/pld-ftp-admin.git] / shell / bashrc
CommitLineData
48a5f713
ER
1# .bashrc - file executed when executing bash
2
3# Put your local aliases here
4alias rmpkg="~/pld-ftp-admin/scripts/remove.py"
5alias gen-indexes="~/pld-ftp-admin/scripts/gen-indexes.py"
6
7testmvpkg() {
8 ~/pld-ftp-admin/scripts/test-move.py "$@" || return $?
9 shift 2
10 echo >&2 "Checking signatures"
11 testsignpkg "$@" || return $?
12}
13
14mvpkg() {
15 __wrap_signpkg() {
16 shift 2
17 testsignpkg "$@" || return $?
18 }
19 __wrap_signpkg "$@" || return $?
20 ~/pld-ftp-admin/scripts/move.py "$@" || return $?
21}
22
23alias ls='ls --color=auto -BFN --show-control-chars'
24alias l='ls -lh'
25alias la='ls -la'
26alias du='du -h'
27alias df='df -Th'
28alias vi='vim'
29alias h='history $(($LINES-6))'
30
31# glen ;)
32if [ "${SSH_CONNECTION%% *}" = "194.106.120.90" ]; then
33 . ~/okas/bashrc
34 alias cvsstat=~/okas/cvsstat
35fi
36
37cp-kde-i18n() {
38 sarch=amd64
39 info=$1
40 if [ ! -f $info ]; then
41 echo >&2 "cp-kde-i18n: Specify existing info file"
42 return
43 fi
44
45 for arch in alpha athlon i386 i586 i686 ppc sparc; do
46 awk -F: -vsarch=$sarch '/^file:/ && $2 == sarch {print $3}' $info | xargs -ri cp -al ../../$sarch/RPMS/{} ../../$arch/RPMS
47 awk -F: -vsarch=$sarch -varch=$arch '/^file:/ && $2 == sarch {printf("%s:%s:%s\n", $1, arch, $3)}' $info >> $info
48 done
49}
50
51signpkg() {
52 local pkg=$1
53 if [ ! -f $pkg ]; then
54 echo >&2 "signpkg: Specify existing info file"
55 return
56 fi
658c89f8 57 local key=$(rpm -E '%_gpg_name')
48a5f713 58 awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \
658c89f8 59 xargs -l1 -ri rpm -qp --qf '{} %{SIGGPG:pgpsig}\n' {} 2>/dev/null | \
54c516d5 60 awk -vk="$key" '$NF ~ k {print > "/dev/stderr"; next} {print $1}' | \
658c89f8 61 xargs -l512 -r rpm --resign
48a5f713
ER
62}
63
64testsignpkg() {
65 local pkg=$1
66 if [ ! -f $pkg ]; then
67 echo >&2 "testsignpkg: Specify existing info file"
68 return
69 fi
70 local out
71 out=$(
72 awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \
73 xargs -l512 \
74 rpm -qp --qf '%{name}-%{version}-%{release}.%{arch} %{siggpg}\n' 2>/dev/null | \
75 fgrep '(none)' | \
76 sed -e 's,^,ERR: ,;s,(none),is not signed,'
77 )
78
79 if [ "$out" ]; then
80 echo "$out"
81 return 1
82 else
83 return 0
84 fi
85}
86
87unlocktree() {
88 local tree="$1"
89 (
90 cd ~/pld-ftp-admin/modules
91 python -c "
92import ftpio
93ftpio.connect()
94ftpio.unlock('$tree')
95"
96 )
97}
This page took 0.036257 seconds and 4 git commands to generate.