[aur-dev] AurJson - orphan packages

Loui Chang louipc.ist at gmail.com
Thu Sep 17 01:41:52 EDT 2009


On Thu 17 Sep 2009 12:31 +0800, Gergely Imreh wrote:
> Also, I'm a bit puzzled by the objection to a single line of
> $row['Orphan'] = ($row['MaintainerUID'] == "0" ? "1" : "0");
> which was countered with a suggestion of a full database re-query.

> Would THAT really take that much shorter? Have to do some checks in my
> test aur install to wrap my head around it. Would have thought that
> AUR has a lot of other inefficiencies that can be improved (pretty
> sure that my PKGBUILD parsing routines are no exceptions), before we
> worry about a single "if".

My concern is that nowadays the JSON interface is being accessed quite a
lot. That can only grow as more users access the site and more features
are added. It's best to be prudent and get the best value out of the
code that we can. Those instructions don't add any value in my opinion.
I see it as the equivalent of adding:

    # This is a comment
    echo "";

> Having said all this, I can see the point of returning the username /
> "orphan" (or username / ""?) instead of Orphan logical variable. I

There's no possibility of someone having "" as a username, so that's
best. No extra processing either.

> wouldn't have chosen it myself originally because of the extra
> database hit, but now it seems to be more in line with the behaviour
> of the web interface.

Sorry. I was just showing how to grab the Username in a query.
You would build that into the existing queries, so there's only one
query per rpc request.

> Loui, do you want to write that changes, or should I send an updated
> patch? I don't mind either way, glad to get the job done. :)

You're certainly welcome to give it a shot.
If you're finding it difficult, I can write the patch.
I'm a bit lazy though. :P



More information about the aur-dev mailing list