]> 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 5e12c2e..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
@@ -20,104 +25,71 @@ group_deps() {
 
 # convert pkg name to src.rpm name
 # uses poldek
-# TODO: simplify when these bugs get a solution:
-# https://bugs.launchpad.net/poldek/+bug/1031762
-# https://bugs.launchpad.net/poldek/+bug/1031767
 pkg2src() {
        local t=$(mktemp)
-       local t1=$(mktemp)
-       local t2=$(mktemp)
        local t3=$(mktemp)
 
        # save input
        cat > $t
 
+       # 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
-       # need to include arch as '*', due this bug: https://bugs.launchpad.net/poldek/+bug/1031762
-       sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u > $t1
-
-       # poldek:/all-avail> ls -s arcconf-7.0.18786-1.*
-       # arcconf-7.0.18786-1.x86_64     arcconf-7.0.18786-1.src.rpm
-       #poldek --cmd < $t > $t2
-       # poldek is an ass, it doesn't allow stdout to be redirected: "error: not a tty"
-       # hack around with script(1) by capturing whole ls output
-       # https://bugs.launchpad.net/poldek/+bug/1031767
-       if [ ! -s $t2 ]; then
-               local args=$*
-               echo 'ls -s' | script $t2 -f -c "poldek -q -Q --noignore ${args%-O*}" >/dev/null 2>&1
+       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
 
-               # now poll until poldek command runs in this tty
-               local stat lstat tty=$(tty < /proc/self/fd/2)
-               while :; do
-                       stat=$(stat -c %Y $t2)
-                       if [ -s $t2 ]; then
-                               # break if stat and last stat are same
-                               if [ "$stat" = "$lstat" ]; then
-                                       break
-                               fi
-                       fi
-                       lstat=$stat
-                       sleep 3
-               done
-               killall -v script 2>/dev/null
-               sed -i -e 's,poldek:/all-avail> ,,' $t2
-       fi
-
-       # create N-V-R -> N list
        local pkg error message srpm
-       while read pkg; do
-               sed -rne "s/^($pkg)\.(x86_64|i686|noarch)(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\3/p" $t2
-       done < $t1 > $t3
-
        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)
+               if [ -z "$srpm" ]; then
+                       echo >&2 "srpms: No match for [${pkg%:}]"
+               fi
                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" \
-       --ignore "*-debuginfo-*" --ignore "db4.6*" \
-       --ignore "boost*1.34*" \
-       --ignore "krb5*" \
-       --ignore "libjpeg6*" \
-       --ignore "libpthread-stubs-devel*" \
-       --ignore "monodoc-*" \
-       --ignore "arts-*" --ignore "artsc-*" \
-       --ignore "esound-*" \
+       poldek --cleana
+       poldek \
+        -O "auto directory dependencies = yes" \
+       --ignore "*-debuginfo-*" \
+       --ignore "*-debugsource-*" \
        --ignore "opera-plugin32-*" \
        --ignore "nspluginwrapper-*" \
        --ignore "mbrola-voice-*" \
-    --ignore "hal" \
-       --ignore "hal-libs" \
-       --ignore "quicktime4linux*" \
-       --ignore "compat-libstdc++-*" \
-       --verify=deps -Q "$@" | filter_deps | group_deps | sort | pkg2src "$@"
+       --ignore "pysql-*" \
+       --ignore "yasql-*" \
+       --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.046006 seconds and 4 git commands to generate.