[Buildd-tools-devel] PostgreSQL code for Debian version checking and sorting

Roger Leigh rleigh at codelibre.net
Sat Jan 3 19:19:17 UTC 2009


Hi dak folks,

While working on a PostgreSQL schema for wanna-build as a replacement
for the dated and inflexible Perl MLDBM backend currently in use, I've
developed a new user-defined PostgreSQL datatype (debversion) which I
thought I'd let you know about in case it's any use for your purposes.

Since it's derived from the text type you use in projectb for versions,
it's a drop-in replacement.  It uses code from Dpkg::Version for
version checking and comparison in PL/Perl, with PostgreSQL operators
in PL/pgSQL.  If we used the untrusted form of PL/PerlU we could
"use Dpkg::Version" directly and avoid the need to copy the code.

The initial revision of this is available from my copy of the sbuild
repo (not yet merged into the main repo).

http://git.debian.org/?p=users/rleigh/sbuild.git;a=blob;f=db/version.sql;h=44dc311308ef3d5aa7604ea0b511a544002d788d;hb=e151e7bb96567817a580118c8c0d5b6cf1fa9b38

The main schema is here, which has some similarities to parts of the
projectb schema, but is geared towards the needs of wanna-build.

http://git.debian.org/?p=users/rleigh/sbuild.git;a=blob;f=db/db.sql;h=2540c7d9781e16bce0d8dad938e09fbf0c65a99a;hb=e151e7bb96567817a580118c8c0d5b6cf1fa9b38


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.



More information about the Buildd-tools-devel mailing list