Chapter 9. Versioning system

There's need to automate update process, but make it optimal for traffic. so it's quite good idea to use binary diff method. There's also a need to make update invisible. The trick is simple. When client program connects to server and finds out that it's version is outdated for current server (in server branch actually, as soon as project is growing there will be several incompaitable branches), one downloads binary patch from current version to latest (or just a new executable if patch is bigger then executable itself). After that current version shutdowns and calls fork () for new version with coords (protocol, host, port, room) of server. So we just bam and get back again with brand new version. Of course, it is important to make several builds for each brach like 'shared', 'static', 'glibc-2.4.x', etc.

Version numbering.  The first 3 numbers of version (also called 'General version') are important about network protocol. If general version of client and server matches, they are completely network compaitable and even look the same (or almost the same) way. The first 2 numbers of version are called 'Base version'. Versions with same base version and greater 3rd number of general version are backward compaitable with versions with smaller 3rd number. If base version doesn't match, versions are completely incompaitable. So if you want to have all servers compaitable client, you should have all base versions with latest general versions. All versions are stored in single executable, which means dynamic linking only with system-stored libraries (if dynamic version), so they are independent from $LD_LIBRARY_PATH, $PWD, etc. Such a versioning system makes update-in-place possible. This is done by calling exec () to up-to-date executable with command line args specifying previous server and room if needed. 'Release version' contains 4 digits. 'Full version' containts 4 digits and (possibly) some textual suffix describing sub-release. If current dump is release version (not 'pre', 'rc', etc.) then 'Full version' == 'Release version'.