]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blobdiff - wwwbin/consistency-check.sh
Support for split debugsource packaes
[projects/pld-ftp-admin.git] / wwwbin / consistency-check.sh
old mode 100644 (file)
new mode 100755 (executable)
index c823b11..d12d1a3
@@ -3,9 +3,14 @@
 export LC_ALL=C
 
 filter_deps() {
-       grep -Ev "(FileDigestParameterized|unsatisfied dependencies found|-multilib-|zsh/latest/functions|VirtualBox.*libc\.so\.6|obextool.*libc\.so\.6)" | \
-       grep -v "uname(release)" |
-       grep -v "/eclipse/"
+       boolean_deps="req \(.*\) not found"
+       common_deps="cpuinfo\(|uname\(release\)|-multilib-|\/eclipse\/|statifier|kernel-tools-perf-vdso"
+       x32_deps="libreoffice|nodejs|firefox|seamonkey|thunderbird"
+       if [ $1 = "x32" ]; then
+               grep -Ev "($boolean_deps|$common_deps|$x32_deps)"
+       else
+               grep -Ev "($boolean_deps|$common_deps)"
+       fi
 }
 
 # group errors by same error kind
@@ -22,34 +27,18 @@ group_deps() {
 # uses poldek
 pkg2src() {
        local t=$(mktemp)
-       local t1=$(mktemp)
-       local t2=$(mktemp)
        local t3=$(mktemp)
 
        # save input
        cat > $t
 
-       # create list of packages from error report
+       # create list of N-V-R.A.rpm -> src-N pairs from error report
        # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found
-       sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u > $t1
-
-       # create list of package -> src.rpm names
-       poldek --noignore -Q "$@" --cmd ls -q -s > $t2
-
-       # create N-V-R -> N list
-       local pkg error message srpm out
-       while read pkg; do
-               pkg=$(echo "$pkg" | sed -e 's,+,\\+,g')
-
-               # there's no space between the columns, so need to match with known archs
-               # see https://bugs.launchpad.net/poldek/+bug/1031767
-               out=$(sed -rne "s/^($pkg)\.(x86_64|i686|noarch)(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\3/p" $t2)
-               if [ -z "$out" ]; then
-                       echo >&2 "nvr: No match for [$pkg]"
-               fi
-               echo "$out"
-       done < $t1 > $t3
+       sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u | \
+               xargs -d '\n' poldek --noignore -Q "$@" --cmd ls -q -s | \
+               sed -rne "s/^([^\t ]+)[\t ]+(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\2/p" >$t3
 
+       local pkg error message srpm
        while read error pkg message; do
                # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found
                srpm=$(awk -vpkg="${pkg%:}" '$1 == pkg {printf("%s.spec", $2)}' $t3)
@@ -59,40 +48,48 @@ pkg2src() {
                echo "$error [$srpm] $pkg $message"
        done < $t
 
-       rm -f $t $t1 $t2 $t3
+       rm -f $t $t3
 }
 
 gen_list() {
+       arch=$1
+       shift
        date
-       /usr/bin/poldek -O "auto directory dependencies = yes" \
+       poldek --cleana
+       poldek \
+        -O "auto directory dependencies = yes" \
        --ignore "*-debuginfo-*" \
+       --ignore "*-debugsource-*" \
        --ignore "opera-plugin32-*" \
        --ignore "nspluginwrapper-*" \
        --ignore "mbrola-voice-*" \
        --ignore "pysql-*" \
        --ignore "yasql-*" \
-       --verify=deps -Q "$@" | filter_deps | group_deps | sort | pkg2src "$@"
+       --ignore "kde4-kdenetwork-kopete-protocol-skype-*.x86_64" \
+       --ignore "libpurple-protocol-skype-*.x86_64" \
+       --ignore "nagios-plugin-check_cciss-*" \
+       --ignore "libpng1*" \
+       --verify=deps -Q "$@" | filter_deps $arch | group_deps | pkg2src "$@" | sort
 }
 
 gen_list_uniq() {
-       gen_list -O"unique package names = yes" "$@"
+       arch=$1
+       shift
+       gen_list $arch -O "unique package names = yes" "$@"
 }
 
 t=$(mktemp)
 ftpdir=$HOME/ftp
-gen_list      -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main.txt
-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
-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
-
-gen_list      -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i686.txt
-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
-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
-
-gen_list      -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i486.txt
-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
-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
-
-(date; $HOME/bin/ac-th-diff.py) > $t && cat $t > $HOME/www/ac-th-diff.txt
+for arch in x86_64 i686 x32 ; do
+       if [ "$arch" = x86_64 ]; then
+               outfext=.txt
+       else
+               outfext=-$arch.txt
+       fi
+       gen_list      $arch -s $ftpdir/PLD/$arch/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main$outfext
+       gen_list_uniq $arch -s $ftpdir/PLD/$arch/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/$arch/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready$outfext
+       gen_list_uniq $arch -s $ftpdir/PLD/$arch/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/$arch/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/$arch/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test$outfext
+done
 
 chmod 644 $HOME/www/*.txt
 rm -f $t
This page took 0.071567 seconds and 4 git commands to generate.