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