[aur-dev] Package blacklist for the AUR

Lukas Fleischer archlinux at cryptocrack.de
Mon Feb 7 12:50:14 EST 2011


On Mon, Feb 07, 2011 at 10:08:54AM -0600, Dan McGee wrote:
> AUR side:
> * Using CHAR as a datatype is absolutely silly in new code, use
> VARCHAR, and why do anything shorter than 255 or 512?
> * On that note, almost all CHAR usages in the current schema are silly
> and should be using VARCHAR- anything on the Packages table,
> PackageCategories, PackageSources, TU_VoteInfo, AccountTypes,
> Username/Email/Passwd/IRCNick on Users.

I just copied that from another table schema, but you're absolutely
right. I'll work on replacing all that CHAR stuff with VARCHARs later.
Might become a kinda ugly updating process from 1.7.0 to 1.8.0 :)

> * Why not just make "Name" your primary key? The ID column is never used.

I'm not really sure about this. Some people insist on always having an
"ID" column. This will become useful if we add some web frontend to the
blacklist, e.g. Not sure if there are any coding guidelines about this
at all, but it's correct that we don't necessarily need this here.

> Blacklist helper side:
> * I won't lie, I think this is over-engineered a tad. This can be done
> in a much shorter and easier to hack shell script since all you need
> is package names- just pipe bsdtar output through some magic and you
> have package names. I've attached a sample starter script I use for
> archweb updates. I'd probably have it call bsdtar and then who knows
> what.

Our consensus was not to fetch tarballs via HTTP and extract them here,
but use libalpm instead. We already discussed using a small PHP script
that uses Archive::Tar (PEAR) but discarded that. Using libalpm, future
database format changes won't affect us and it just seems cleaner.

Of course, we could do that with some shell script which would have to
do following things tho: 

- parse the AUR "config.inc" file: read MySQL host name, socket, user
  name, password
- use pacman(8) to sync local databases
- convert packages to MySQL queries using some sed(1)/awk(1) magic
- pipe stuff to mysql(1), ensure no errors occurred

I just think that it wouldn't be much shorter (that C helper has about
100 SLOC if you strip all that error handling stuff), nor cleaner, nor
faster. Best thing would to have PHP bindings for libalpm here... Well.
Recommendations and patches welcome :p

> * Oh my, I forgot we are still on MyISAM for the AUR. Please to god
> switch to InnoDB and use transactions instead.

Full ack. I'll talk to Loui about that.


More information about the aur-dev mailing list