[Xapian-devel] Starting to work for xapian

Olly Betts olly at survex.com
Thu Feb 16 22:48:50 GMT 2012


On Thu, Feb 16, 2012 at 02:04:13PM +0000, Charlie Hull wrote:
> On 16/02/2012 13:49, Rajan Walia wrote:
>> For starting I want to work on this:
>> Replace getopt() with popt() or similar
>>
>> A longer term aim is to be able to relicense Xapian under a more
>> liberal licence.
>
> I'm afraid there are considerably more things to do before this can be  
> considered: see http://trac.xapian.org/wiki/FAQ/CommercialLicence for  
> more details.

Rajan is just quoting the above from the wiki.  Just because there are
many things to do to achieve something doesn't mean it is pointless to
try to do one of them, especially as one aim of doing so is to get
familiar with the code.

>> One obstacle is that we use GNU getopt, which is GPL, so it would be
>> helpful to replace this with something else which provides at least
>> the same user functionality.

This is actually wrong though (probably my fault as I think I wrote
this) - GNU getopt is LGPL, so wouldn't block a relicensing of the
GPL code, though it would make the licensing situation clearer if
we didn't have any LGPL code involved.

>> One option is popt, which is MIT/X
>> licensed and provides a slightly higher level API:

Something with a higher level API would probably be an improvement.

OpenBSD also have a getopt_long() implementation, which seems to be
licensed suitably:

http://www.marko.homeunix.org/cgi-bin/man-cgi?getopt_long+3
ftp://ftp.irisa.fr/pub/OpenBSD/src/lib/libc/stdlib/getopt_long.c

Not sure if that uses any OpenBSD specific library features though.

Also the man page shows various differences from GNU getopt, so we
would need to carefully review that list and decide if any matter.

>> So that I can get a flow with the code before GSoC. I wanted little
>> tips to start working on this.

The first step is to check out the latest version.  I would recommend
using git for this - we found last year that the students using git had
fewer issues with it than the student using SVN:

http://xapian.org/bleeding#git

Then follow the instructions for building it there.

Once you've got that going, look at the GNU getopt API and how it is
used.  Pick a replacement to try, and read up on how to call it, and
then try changing one program to use it.

Cheers,
    Olly



More information about the Xapian-devel mailing list