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:
# 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
--ignore "opera-plugin32-*" \
--ignore "nspluginwrapper-*" \
--ignore "mbrola-voice-*" \
- --ignore "hal" \
+ --ignore "hal" \
--ignore "hal-libs" \
--ignore "quicktime4linux*" \
--ignore "compat-libstdc++-*" \
}
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