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

tardo tardo at nagi-fanboi.net
Thu Oct 25 02:53:15 EDT 2007


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?

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).

If I had a db dump/site code, here's sort of what I'd implement:

db_connect( ... );
$q = "SELECT ID FROM Packages WHERE Name = 'pkgname'"; // table/columns 
may differ
db_query($q);

that should give a numerical result which I can link directly to on the 
package page, eg http://archlinux.org/packages/13418
If anyone can pull out the package ID, i can show what to change in the 
AUR (trivial really).

- tardo




More information about the arch-projects mailing list