]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - wwwbin/consistency-check.sh
- _RPMVSF_NOSIGNATURES and _RPMVSF_NODIGESTS have been removed in rpm 5
[projects/pld-ftp-admin.git] / wwwbin / consistency-check.sh
1 #!/bin/sh
2
3 export LC_ALL=C
4
5 filter_deps() {
6         grep -Ev "(FileDigestParameterized|unsatisfied dependencies found|-multilib-|zsh/latest/functions|VirtualBox.*libc\.so\.6|obextool.*libc\.so\.6)" | \
7         grep -v "uname(release)" |
8         grep -v "/eclipse/"
9 }
10
11 # group errors by same error kind
12 group_deps() {
13         local t=$(mktemp)
14         cat > $t
15         sed -ne 's/.*req \(.*\) not found.*/\1/p' $t | sort -u | while read dep; do
16                 grep -F "req $dep not found" $t
17         done
18         rm -f $t
19 }
20
21 # convert pkg name to src.rpm name
22 # uses poldek
23 pkg2src() {
24         local t=$(mktemp)
25         local t3=$(mktemp)
26
27         # save input
28         cat > $t
29
30         # create list of N-V-R.A.rpm -> src-N pairs from error report
31         # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found
32         sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u | \
33                 xargs -d '\n' poldek --noignore -Q "$@" --cmd ls -q -s | \
34                 sed -rne "s/^([^\t ]+)[\t ]+(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\2/p" >$t3
35
36         local pkg error message srpm
37         while read error pkg message; do
38                 # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found
39                 srpm=$(awk -vpkg="${pkg%:}" '$1 == pkg {printf("%s.spec", $2)}' $t3)
40                 if [ -z "$srpm" ]; then
41                         echo >&2 "srpms: No match for [${pkg%:}]"
42                 fi
43                 echo "$error [$srpm] $pkg $message"
44         done < $t
45
46         rm -f $t $t3
47 }
48
49 gen_list() {
50         date
51         /usr/bin/poldek -O "auto directory dependencies = yes" \
52         --ignore "*-debuginfo-*" \
53         --ignore "opera-plugin32-*" \
54         --ignore "nspluginwrapper-*" \
55         --ignore "mbrola-voice-*" \
56         --ignore "pysql-*" \
57         --ignore "yasql-*" \
58         --ignore "kde4-kdenetwork-kopete-protocol-skype-*.x86_64" \
59         --ignore "libpurple-protocol-skype-*.x86_64" \
60         --ignore "*-video-nvidia-legacy3-*" \
61         --verify=deps -Q "$@" | filter_deps | group_deps | sort | pkg2src "$@"
62 }
63
64 gen_list_uniq() {
65         gen_list -O"unique package names = yes" "$@"
66 }
67
68 t=$(mktemp)
69 ftpdir=$HOME/ftp
70 gen_list      -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main.txt
71 gen_list_uniq -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/x86_64/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready.txt
72 gen_list_uniq -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/x86_64/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/x86_64/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test.txt
73
74 gen_list      -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i686.txt
75 gen_list_uniq -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i686/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-i686.txt
76 gen_list_uniq -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i686/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/i686/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test-i686.txt
77
78 gen_list      -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i486.txt
79 gen_list_uniq -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i486/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-i486.txt
80 gen_list_uniq -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i486/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/i486/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test-i486.txt
81
82 (date; $HOME/bin/ac-th-diff.py) > $t && cat $t > $HOME/www/ac-th-diff.txt
83
84 chmod 644 $HOME/www/*.txt
85 rm -f $t
This page took 0.05811 seconds and 3 git commands to generate.