]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - shell/bashrc
- touchpkg() to touch every file from info file, needed for broken ftp admin scripts...
[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')
48a5f713 69 awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \
658c89f8 70 xargs -l1 -ri rpm -qp --qf '{} %{SIGGPG:pgpsig}\n' {} 2>/dev/null | \
54c516d5 71 awk -vk="$key" '$NF ~ k {print > "/dev/stderr"; next} {print $1}' | \
658c89f8 72 xargs -l512 -r rpm --resign
48a5f713
ER
73}
74
75testsignpkg() {
76 local pkg=$1
77 if [ ! -f $pkg ]; then
78 echo >&2 "testsignpkg: Specify existing info file"
79 return
80 fi
81 local out
82 out=$(
83 awk -F: '/^file:/{arch=$2; file=$3; printf("../../%s/RPMS/%s\n", arch, file)}' "$@" | \
84 xargs -l512 \
85 rpm -qp --qf '%{name}-%{version}-%{release}.%{arch} %{siggpg}\n' 2>/dev/null | \
86 fgrep '(none)' | \
87 sed -e 's,^,ERR: ,;s,(none),is not signed,'
88 )
89
90 if [ "$out" ]; then
91 echo "$out"
92 return 1
93 else
94 return 0
95 fi
96}
97
98unlocktree() {
99 local tree="$1"
100 (
101 cd ~/pld-ftp-admin/modules
102 python -c "
103import ftpio
104ftpio.connect()
105ftpio.unlock('$tree')
106"
107 )
108}
This page took 0.042242 seconds and 4 git commands to generate.