Back to Top

Thursday, July 05, 2007

Checking out CVS and creating patches

Update: Qemu moved from CVS to SVN. While the CVS repository is (and will be) available for some time, you should look at the new checkout instructions.

Lately I started to dive into open-source development, specifically Qemu. Since I'm relatively new, here are some commands I found useful:

cvs -z3 co qemu - to check out the source code from a CVS repository, the Qemu source code in this case. Unfortunately CVS by default (without SSH tunneling, etc) uses a rather strange port (2401), which is firewalled at most places.

cvs diff -u vl.c vl.h > ../dump_traffic_to_pcap.patch - to create a so called patch (a list of differences between the files on your hard drive and the ones in CVS) file which can later be applied to the source code by the maintainer(s) of the project if s/he so chooses. This command must be issued from within the directory where the project was checked out, so that it can pick up the settings of the checkout.

Some tips I picked up until now (again, I'm by no means an expert):

  • Use the conventions of the source code. This means everything from commenting style, number of tabs to types of functions used (do they use fopen or open?).
  • Make your patches against the latest CVS version. It makes it easier for the maintainer(s) to apply your patch
  • Use Meld or WinMerge to port your patch to a new CVS version
  • Use dos2unix and unix2dos if you are doing cross-platform development (they can be found in the tofrodos package if you are using Ubuntu)
  • Be patient


Post a Comment

You can use some HTML tags, such as <b>, <i>, <a>. Comments are moderated, so there will be a delay until the comment appears. However if you comment, I follow.