[arch-projects] [AUR] Querying package ID from main repo

tardo tardo at nagi-fanboi.net
Thu Oct 25 12:03:38 EDT 2007

Paul Mattal wrote:
> eliott wrote:
>> On 10/24/07, tardo <tardo at nagi-fanboi.net> wrote:
>>> I'd really like to be able to pull package ID numbers from the main
>>> site
>>> DB and put that in the AUR. From what I see, it seems like a simple
>>> SELECT statement (prefixed by a db_connect() or select_db() if on the
>>> same host). It's pretty trivial, and since handing out dumps of the
>>> main
>>> repo db just seems to be a no-no, how about someone look through the
>>> main site's code and finding that statement and throwing it in?
>> Are you suggesting we grant the aur access to the primary site
>> database so it can pull package data itself?
>> I really don't like that idea, and for two reasons.
>> 1. It is too tightly coupled. If the aur were ever to move to another
>> host, it would fail.
>> 2. From a security standpoint, it isn't optimal.
> This was actually originally contemplated, and a read-only account
> exists for the main db for this purpose, but has never been used.
> Not saying that actually makes it a good decision, just mentioning that
> it exists.

Granting SELECT only access to a user account is technically read-only.
I'm not aware of any security implications in this, and if AUR was moved
to another host, it's simply a matter of changing the host parameter in
db_connect() ... (assuming remote host allows remote connections).

>>> For the record, I don't care about searching for packages on the search
>>> page, just being able to pull the ID of the package so I can provide a
>>> good link to the dependencies is enough (current method just searches,
>>> seems kinda half-assed).
>> What are you talking about?
>> Just getting a link on the aur page for the upstream package depends?

Yes. That's it.

> I think I'd rather attack this problem by creating a page on the main
> site which lets you get at a package directly by name. It more cleanly
> maintains the separation of the systems, and would allow any system like
> the AUR to be able to link to a particular package's page on the main
> site.

I actually just tried this right now using a hunch, and lo and behold it
worked. Apparently http://archlinux.org/packages/$pkgname works (odd..
didn't work before...)

- tardo

More information about the arch-projects mailing list