]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - wwwbin/consistency-check.sh
- skype-tools is noarch package
[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 t1=$(mktemp)
26         local t2=$(mktemp)
27         local t3=$(mktemp)
28
29         # save input
30         cat > $t
31
32         # create list of packages from error report
33         # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found
34         sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u > $t1
35
36         # create list of package -> src.rpm names
37         poldek --noignore -Q "$@" --cmd ls -q -s > $t2
38
39         # create N-V-R -> N list
40         local pkg error message srpm out
41         while read pkg; do
42                 pkg=$(echo "$pkg" | sed -e 's,+,\\+,g')
43
44                 # there's no space between the columns, so need to match with known archs
45                 # see https://bugs.launchpad.net/poldek/+bug/1031767
46                 out=$(sed -rne "s/^($pkg)\.(x86_64|i686|noarch)(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\3/p" $t2)
47                 if [ -z "$out" ]; then
48                         echo >&2 "nvr: No match for [$pkg]"
49                 fi
50                 echo "$out"
51         done < $t1 > $t3
52
53         while read error pkg message; do
54                 # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found
55                 srpm=$(awk -vpkg="${pkg%:}" '$1 == pkg {printf("%s.spec", $2)}' $t3)
56                 if [ -z "$srpm" ]; then
57                         echo >&2 "srpms: No match for [${pkg%:}]"
58                 fi
59                 echo "$error [$srpm] $pkg $message"
60         done < $t
61
62         rm -f $t $t1 $t2 $t3
63 }
64
65 gen_list() {
66         date
67         /usr/bin/poldek -O "auto directory dependencies = yes" \
68         --ignore "*-debuginfo-*" \
69         --ignore "opera-plugin32-*" \
70         --ignore "nspluginwrapper-*" \
71         --ignore "mbrola-voice-*" \
72         --ignore "pysql-*" \
73         --ignore "yasql-*" \
74         --ignore "kde4-kdenetwork-kopete-protocol-skype-*.x86_64" \
75         --ignore "libpurple-protocol-skype-*.x86_64" \
76         --ignore "*-video-nvidia-legacy3-*" \
77         --verify=deps -Q "$@" | filter_deps | group_deps | sort | pkg2src "$@"
78 }
79
80 gen_list_uniq() {
81         gen_list -O"unique package names = yes" "$@"
82 }
83
84 t=$(mktemp)
85 ftpdir=$HOME/ftp
86 gen_list      -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main.txt
87 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
88 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
89
90 gen_list      -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i686.txt
91 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
92 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
93
94 gen_list      -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i486.txt
95 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
96 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
97
98 (date; $HOME/bin/ac-th-diff.py) > $t && cat $t > $HOME/www/ac-th-diff.txt
99
100 chmod 644 $HOME/www/*.txt
101 rm -f $t
This page took 0.169986 seconds and 3 git commands to generate.