tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [GsoC] Add pkgsrc support to packagekit


Thanks you for your response.

Le 29 mars 2011 à 12:12, Julio Merino a écrit :
>> I'm Sylvain a french student in Computer Sciences of "Université de Pau et 
>> des Pays de l'Adour" (UPPA). I discovered NetBSD more than 1 year ago, and 
>> this year I want to contribute to the project through the Google Summer Of 
>> Code.
>> I use NetBSD on my desktop (but I use it less often than my laptop), my 
>> Sheevaplug and plan to use on a dedicated server as soon as possible. Thanks 
>> to IRC I have learnt lot of things about NetBSD.
>> I'm currently working on writing a pkgin backend for PackageKit, so I'm 
>> really interested in the "Add pkgsrc support to packagekit" project.
>> My goal is to write a Python API for Pkgin to make the writing of the 
>> backend easier.
> My main question in your proposal is: why Python?
> Having an API to interact with pkgsrc and binary packages would be
> wonderful.  Unfortunately, Python is not part of NetBSD.  If you write
> the library in Python, it means that we cannot use it in the places
> where we need it most: in sysinst or in pkg_install so that an
> out-of-the-box NetBSD installation could easily retrieve/install new
> packages and keep the system up to date.
> Having said that, a Python API would work nicely as a prototype.  But
> you should investigate how this would play with the languages that are
> part of NetBSD (C, C++, shell and Lua).

The goal is not the create a full API for all the system, but a basic API to 
help to the creation of the backend. It is a layer which retrieves pkgsrc 
commands stream.
 It could be a good idea to create an API for C pkgsrc but I think it is for an 
other project.

>> Reading the Wiki I think I can make the same work with pkgsrc :
>> - Write an API for pkgsrc
>> - Use this API to write a backend
>> It may be possible to reuse part of the pkgin API for binary package 
>> management (or rewrite something equivalent for pkg_add).
>> The API will reproduce basics pkgin/pkg_add/pkgsrc commands and add useful 
>> methods like listing all outdated packages, listing installed packages in 
>> which package names, versions, etc are separate.
> In my opinion, the library should seamlessly manage packages from
> pkgsrc and binary packages (this is quite tricky but certainly
> doable).  An example: install/update everything from binaries if they
> are up-to-date, or otherwise fall back to building from pkgsrc.

The wiki says that the user have the choice to fall back, but I'm agree with 
you. May be it's possible to make the choice with an option :
- automatically install with pkgsrc if the package is not available as binary
- ask to the user if he want to install the package with pkgsrc
- do nothing and say to the user how he can install the package

> Nixpkgs ( does this successfully and the
> results are very handy.

I bookmarked the page. Thank you, I'll look at what it looks like this weekend.

>> The harder part will be the capability to build package from source because 
>> I have to reproduce what did "make" in Python for retrieving dependencies 
>> etc (The backend allows to make package if it is not available as binary)
> For this, you can just resort to calling make and parsing the results;
> this is slow but effective.  Alternatively, if the "summary" database
> exists, just parse that database to get much faster results; see
> pkg_summary(5).

Yes, for now I have two choice: parse the "make result" stream, or search by my 
own way into package files to retrieve deps.

> Lastly, I'd recommend to extend your proposal a bit more by including
> a list of deliverables, a preliminary schedule with a set of major
> milestones, and more examples on how your proposed API would look
> like.

I expect to make that very clear in my head. Really know what you expect the 
But if you really want a schedule, I can make an effort to do this very quickly.
For the API I don't know what type of example you want.

> Hope this helps!

Yes, it helps me. This is the first time I make a project so it's a bit 
confusing for me.

Sylvain "solevis" Mora

Home | Main Index | Thread Index | Old Index