Adam D. Barratt wrote: > On Mon, 2008-02-18 at 18:57 -0600, Raphael Geissert wrote: >> Just make sure to select only open bugs (and probably also ignore the >> pending ones) and call status() with the whole list of bugs (eval is your >> friend in this case). Doing it that way was, as I said, fast an easy.
I wasn't aware that one could pass the results of select() directly to status() (maybe Devscripts::Debbugs does some tricks there). > > Nah, /perl/ is my friend in this case ;-) And I did mean _perl_ (but forgot to say so?) > > It's easy, but I wouldn't say it was fast. I've attached a patch that > replaces the HTML parsing with SOAP calls (admittedly including pending > bugs; 129 out of 1945 isn't going to make a huge difference). It works, > but testing it here it takes between five and 10 times longer than the > original script. Admittedly my 'net connection's not the best, but the > tests were all run in the same environment so should be comparable. I'm afraid I'm unable to test the changes without upgrading devscripts, because of a 'Undefined subroutine &Devscripts::Debbugs::status called at -e line 6.' message. You could compare the results directly with (warning: '<<<' is a bashism ;): $ s=$(date +%s); o="$(./wnpp-alert.orig.sh 2>&1)"; echo "It took $(($(date +%s) - $s)) seconds with an output of $(wc -l <<< "$o") lines" $ s=$(date +%s); o="$(./wnpp-alert.new.sh 2>&1)"; echo "It took $(($(date +%s) - $s)) seconds with an output of $(wc -l <<< "$o") lines" By the way, what about rewriting the whole script in perl? Here the original script takes five seconds to run and list 44 packages, but the new script takes five seconds to display a simple error message (the one above). Something really needs to be optimised :). > > Adam Cheers, -- Atomo64 - Raphael Please avoid sending me Word, PowerPoint or Excel attachments. See http://www.gnu.org/philosophy/no-word-attachments.html -- To unsubscribe, send mail to [EMAIL PROTECTED]
