Monthly Archive for January, 2008

Ulf Lilleengen: Improving csup

 It's been a while. Partially because I've become a FreeBSD committer and had more productive stuff to do than writing in my weblog, and partially because my account was disabled after Google Summer of Code (Also, thanks to Google for SoC).

 Since last time, I've been working on getting my gvinum work of this summer into the tree, but since this has to be reviewed before going into the tree, and 7.0-RELEASE is much more important right now, it's sort of on hold. In the meantime I've been working on implementing CVSmode for csup. This is something I've been meaning to do for a long time, but never found the big motivation until my exam-period before last christmas. So, I'll tell you a bit of what I've done here. For those of you unfamiliar with cvsup, it's a network CVS file synchronization tool which is heavily used in FreeBSD. However, it is written in Modula-3 and is therefore not very easy to maintain and it doesn't integrate into the FreeBSD base system very well. So, Maxime Henrion started a C rewrite of cvsup called csup.

First, a bit on how csup works (or the cvsup protocol). The client runs three threads performing these tasks:

  • The lister, which examines the clients files, and sends information about them to the server.
  • The detailer, which recieves commands from server on what needs to be done ("this file needs updating, send me the details of it's revisions).
  • The updater, which recieves the actual updates from the server ("add this delta to the RCSfile").

More details on how the protocol works can be found on http://www.cvsup.org/howsofast.html

 So, what is CVSmode anyway? In csups normal operation, csup requests the files from a specific branch, called checkout mode. This is the typical way a user would use csup, fetching the src-tree for RELENG_7 for instance. However, a developer would often like to have the FreeBSD CVS repository on his local machine, and this is where CVSmode plays a part. CVSmode means that csup will recieve the entire CVS repository, and also fetch updates to the actual RCSfiles. So far, csup does only support the checkout mode.

So, what's needed for CVSMode to work?

  1. Support for the protocol, so the client is able to not only act correctly on the commands from the server, but also respond correctly. This involves modifying the detailer and the updater part of csup.  This part needs to be a bit cleaned up right now, but is in a working state.
  2. Correctly parse RCSFiles. Firstly, I made a lexer with flex and parser with yacc. Then I found out I needed reentrancy, and started using bison. After realizing using bison for this wasn't really nice since bison wasn't in base, I rewrote the parser in C.
  3. The ability to update RCSfiles. This required a RCSfile interface. This interface is used by both the parser and the updater, to import and edit RCSfiles. Writing this interface is probably what has taken most of my time.
  4. Writing the RCSFiles out with the new updates. This is done internally by the RCSfile implementation.

So, this is what I've been working on implementing the last month or two. And I have the most parts working. What's missing is a crucial part of (4). To write out the new RCSFiles to disk, a correct algorithm to apply diffs and reverse diffs is needed. The algorithm for applying diff was already created by csups author, but the reverse diff algorithm is a bit different. The last week or so, I've been studying the algorithm used in cvsup, and I've started to implement something similar although a bit different in it's implementation. So, hopefully I'll have this work pretty soon, at least before people start switching over to some new version control system :)

Pav Lucistnik: 18,000 ports

That’s a lot of these little suckers, isn’t it?

(I’ve been slacking the blog lately.) And what’s brewing inside the portmgr’s kitchen? First set of 6-STABLE packages in a long time, exprun with removal of XFree86-4 ports is now under progress, another with a bunch of minor infrastructure improvements and fixes is in the queue. Soon we hope to have a patchset introducing USE_CMAKE, and another updating the bulk of SDL libraries. Stay tuned.

Bernhard Froehlich: SVN::Web Charset Patch

Recently I discovered in my SVN::Web installation that they send out an Content-Type header with UTF-8 charset but i need ISO-8859-1 and there is no parameter in the config.

So i wrote a little patch for SVN::Web 0.53. If you use FreeBSD you can put this into /usr/ports/devel/p5-SVN-Web/files/patch-charset.diff and be happy with it. --- lib/SVN/Web.pm.orig 2007-04-29 19:22:51.000000000 +0000 +++ lib/SVN/Web.pm 2008-01-16 12:39:34.000000000 +0000 @@ -345,7 +345,7 @@

if(ref($html)) { print $cfg->{cgi}->header( - -charset => $html->{charset} || 'UTF-8', + -charset => $html->{charset} || 'ISO-8859-1', -type => $html->{mimetype} || 'text/html', -cookie => @cookies, ); @@ -361,7 +361,7 @@ } } else { print $cfg->{cgi}->header( - -charset => 'UTF-8', + -charset => 'ISO-8859-1', -type => 'text/html', -cookie => @cookies, ); @@ -391,7 +391,7 @@ if(ref($html)) { my $content_type = $html->{mimetype} || 'text/html'; $content_type .= '; charset='; - $content_type .= $html->{charset} || 'UTF-8'; + $content_type .= $html->{charset} || 'ISO-8859-1'; $cfg->{request}->content_type($content_type);

if(mod_perl_2) { @@ -411,7 +411,7 @@ $cfg->{request}->print($html->{body}); } } else { - $cfg->{request}->content_type('text/html; charset=UTF-8'); + $cfg->{request}->content_type('text/html; charset=ISO-8859-1');

if(mod_perl_2) { $cfg->{request}->headers_out();

Christian Brueffer: Five Year Anniversary

Today marks my five year anniversary with the FreeBSD project. All I can say is, it’s been a pleasure (most of the time). Although sometimes it’s very hard to find the motivation to do some work, seeing the cool stuff everyone else within the project is working on gets one going again pretty quickly.

Thanks to everyone I had the opportunity to work with so far, especially my doc mentor Ceri Davies and my src mentor Robert Watson. It was the operating system that brought me to FreeBSD, but it’s my fellow developers and the community that keep me here (that said, there will be a strong FreeBSD presence at <a href=”http://www.fosdem.org/2008/” mce_href=”http://www.fosdem.org/2008/”>FOSDEM</a> this year, hope to see lots of people in the joined BSD+PostgreSQL developer room).

Well then, off to another five years!

Giorgios Keramidas: Experimenting with Mercurial “named branches”


As an experiment with the “named branch” support of Mercurial (Hg hereafter), I’ve started updating the editors/emacs-devel port of FreeBSD, using an Hg repository with two branches:

  • HEAD is the main branch where history is imported from the official FreeBSD CVS repository
  • keramida is a named branch where my own, local changes are committed

The experiment seems to be going pretty well so far, and the port has been updated to a CVS snapshot of the GNU Emacs source tree obtained at 1 Jan 2008, 21:19:17 UTC. You can see the Hg repository with the two named branches at:

http://hg.hellug.gr/keramida/ports/emacs-devel/

I’ll keep the converted port repository around, and see how future updates work. I’m really interested to see what happens with “merges” of upstream code, after the current “keramida” branch has been committed upstream, to the official FreeBSD ports/ repository :-)