]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- replace tmux hack with xargs + poldek --cmd one
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 6 Aug 2012 12:49:25 +0000 (12:49 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 6 Aug 2012 12:49:25 +0000 (12:49 +0000)
Changed files:
    wwwbin/consistency-check.sh -> 1.5

wwwbin/consistency-check.sh

index 00cb96a23c5f2d424889e50e0e3666a59d2d9399..713cf1ef8e0a75823a3695d92b68ab891795e1fd 100644 (file)
@@ -18,31 +18,6 @@ group_deps() {
        rm -f $t
 }
 
-# hack for tmux server inside pkg2src
-poldek_server() {
-       local t2=$(mktemp)
-       cat | script $t2 -f -c "poldek $*" >/dev/null 2>&1
-
-       # poll until poldek output file is updated
-       local stat lstat
-       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
-
-       cat $t2
-       rm -f $t2
-}
-
 # convert pkg name to src.rpm name
 # uses poldek
 # TODO: simplify when these bugs get a solution:
@@ -59,26 +34,15 @@ pkg2src() {
 
        # 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
+       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
+       # hack around with xargs submitting input to 'ls' command
        # https://bugs.launchpad.net/poldek/+bug/1031767
-       if [ ! -s $t2 ]; then
-               local args=$*
-               tmux new-session -d "echo 'ls -s' | $0 poldek -q -Q --noignore ${args%-O*} > $t2"
-
-               # poll until there is output
-               while :; do
-                       if [ -s $t2 ]; then
-                               break
-                       fi
-                       sleep 3
-               done
-       fi
+       xargs --delimiter='\n' --arg-file=$t1 -- /usr/bin/poldek --noignore -Q "$@" --cmd ls -q -s >$t2
 
        # create N-V-R -> N list
        local pkg error message srpm
@@ -109,7 +73,7 @@ gen_list() {
        --ignore "opera-plugin32-*" \
        --ignore "nspluginwrapper-*" \
        --ignore "mbrola-voice-*" \
-    --ignore "hal" \
+       --ignore "hal" \
        --ignore "hal-libs" \
        --ignore "quicktime4linux*" \
        --ignore "compat-libstdc++-*" \
@@ -117,15 +81,9 @@ gen_list() {
 }
 
 gen_list_uniq() {
-       gen_list "$@" -O"unique package names = yes"
+       gen_list -O"unique package names = yes" "$@"
 }
 
-if [ "$1" = "poldek" ]; then
-       shift
-       poldek_server "$@"
-       exit $?
-fi
-
 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
This page took 0.089829 seconds and 4 git commands to generate.