Friday, July 13, 2007

Learn Python in a few minutes

http://www.poromenos.org/tutorials/python

Use CVS in less than 5 minutes

Using CVS for your personal projects/little utilities.

Applies to Cygwin, *nix environments. For windows, use the extremely cute tool called TortoiseCVS or better TortoiseSVN.
If you want to use the power of CVS for your simple project, solely for the purpose of keeping track of the changes you make within a span of a few days within the development cycle, you can use a local repository of CVS. (Remember, you probably don't get file backup facilities etc with this).

Set your CVSROOT environment variable to the directory which you want to use as repository. For example "work/cvsroot in your home directory.
$ mkdir ~/work/cvsroot
$ export CVSROOT=~/work/cvsroot

Then you ininitalize the cvs repository by saying
$ cvs init

Now you import the first version of the code into the repository, by "adding module" technique. Suppose your root module directory is rootModule.
$ cd rootModule
$ cvs import -m "yor comment in quotes" rootModule ROOTMODULE_DIST ROOTMODULE_0_0_1

Now you have a repository with a module added to it. To work on it you need to "checkout" the content into a work area, say ~/devp.

$ cs ~/devp
$ cvs co rootModule
Now you have the entire module checked out into your ~/devp.
Make the necessary modifications to all the files. Once you are satisfied, review the references, cvs diff command.
$ cvs diff
It lists all the changes made on the console in diff format. You can view this in [g]vim which is the galaxy's best text editor. Once you are sure everything is alright, it's time to "checkin" the files back into the repository, (while retaining the ability to go back to your earlier versions, which is what CVS is all about).
$ cvs commit
It will let you know the files which have changed and ask for conformation. Once you are done, you may tag the new version with an appropriate name so you can use that version later if you need to. I found the following command helpful, but use your imagination here.
$ cvs tag -R -b <APPROPRIATE_TAGNAME>

And continue the above steps peacefully, knowing that you can make mistakes and correct them later or track them to where they happened. History is important, and not just for politicians!!!! Heck, it doesn't teach them anything anyway, but it does a lot of good for us software labourers.

Thursday, July 12, 2007

The awesome 'team' of GNU autotools

When was the last time you ran "configure && make && make install"!!! Did you know it's best to run it from a directory other than the source directory? Yes. That way you get to keep the source tree intact and delete the build directory where you ran the configure and make without any trouble and start over.

Also, alternatively you could have a source anywhere in your network, and run the "configure && make && make install" from many machines of different flavors, like say, 'cygwin, linux, solaris' etc all from a common source tree on your friends gmail account (if you have a gmailFs drive that is), even if the source tree is read only.

Well, while it is easy to use, it's not that easy for a beginner to provide all these in a perfect fashion. You can spend a day or two to figure out which of the millions of resources in the 'wild wild' web, is relevant for you. I found the presentation pasted below to be great with its simplicity, well updated content and just enough to get you started.

http://www-src.lip6.fr/homepages/Alexandre.Duret-Lutz/dl/autotools.pdf


I did not know about 'autoreconf' till I went through this one. You can get additional information about a particular tool, specificity of usage etc, via any of the various ways like 'info', man, or the "plain old" internet.

Once you are through with the above document, which is excellent, just in case if I didn't mentioned it before :), you might want a refresher and more with http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html.

Have fun auto-tooling.... and tune in for more updates...