Which makes it look like a bothering sort of day

Dynamite Cloth Patches Tell It Like It IsMetacity has a script called patch-wrangler where it downloads and applies a patch given the patch number, and if the patch applies cleanly builds the program for testing.

I want to make it so that you give a bug number, instead, and it will download the relevant page from Bugzilla, and then if there’s only one current patch on that bug it will grab that one.  And it will also store the name and email address of the contributor, and the comment on that patch, from the HTML, and store them into a hidden file with the patch so that the commit script can put them into ChangeLog.

But I can’t do that, because Bugzilla doesn’t show email addresses unless you’re logged in.  I would be able to do that by passing ephy’s or firefox’s cookies.txt into wget, except that nobody apparently uses cookies.txt any more and it’s all gone to sqlite.  I could fix it all up by hand but it’s a major nuisance.

Bother.

Photo by Larry He’s So Fine.

Published by

Thomas Thurman

Mostly themes, triaging, and patch review.

6 thoughts on “Which makes it look like a bothering sort of day”

  1. sqlite3 $1 <<EOF | tr ” ” “\t”
    select host || ‘ TRUE ‘ || path || ‘ ‘ || ( case when isSecure = 1 then ‘TRUE’ else ‘FALSE’ end ) || ‘ ‘ || expiry || ‘ ‘ || name || ‘ ‘ || value from moz_cookies ;
    EOF

    Sends to stdout $1 (a sqlite cookies database from FF) converted to cookies.txt format

  2. Judging by the script you linked to, you’re using python? Why not just have python do the login? If you grab a copy of Bugzilla from http://www.bugzilla.org, there’s a “bugzilla-submit” script in the contrib directory which is written in python, and should be enough sample code for you to figure out how to log in and do basic stuff to Bugzilla. There’s also an XMLRPC API on newer versions of Bugzilla that you can use to, for example, grab just the list of attachments off a bug without having to download the entire bug.

  3. @alex:
    Oh, nice one. Thanks.

    @Claudio:
    I knew about Mech but the existing script’s in Python and I didn’t want to do a complete rewrite. Besides, cookie_jar doesn’t know how to read sqlite either, does it?

    @Dave Miller:
    I like that idea– thanks. I’m pretty sure our bugzilla isn’t new enough to use the XMLRPC, but the submit script might be helpful.

  4. Thomas,

    It will perform its own login with its own cookies. No need to read the firefox config/db…

    Anyway, if you want it to integrate in an already python script, I am sure Python has a similar module (ruby and java have…).

    C.

  5. @Claudio:

    I think we’re talking at cross-purposes here. I wanted a means to read a page using existing cookies to save time, but you seem to be suggesting logging in and then using THOSE cookies, which I can do in Python already. Thanks, though.

Leave a Reply

Your email address will not be published. Required fields are marked *