Retrieving the Latest Snapshot from BitKeeper

BitKeeper is a commercial revision control system that MySQL uses to manage its massive amount of code and control updates. There may be situations in which you want the latest version of the code, and this is how to get it.

First, you need to install the BitKeeper client. You need to have zlib installed before you attempt to install BitKeeper (which may involve installing both the zlib and zlib-devel packages). When you have zlib, you need to download and install the BitKeeper client. This can be achieved with the following commands:

[alex@host]$ su - Password: [root@host]# cd /tmp/ [root@host]# wget http://www.bitmover.com/bk-client.shar --00:31:15-- http://www.bitmover.com/bk-client.shar => 'bk-client.shar' Resolving www.bitmover.com... 192.132.92.2 Connecting to www.bitmover.com[192.132.92.2]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 28,867 [application/x-shar] 100%[====================================>] 28,867 123.59K/s 00:31:16 (123.15 KB/s) - 'bk-client.shar' saved [28,867/28,867] [root@host]# sh bk-client.shar x - creating lock directory x - creating directory bk_client-1.1 x - extracting bk_client-1.1/demo.sh (text) x - extracting bk_client-1.1/Makefile (text) x - extracting bk_client-1.1/update.c (text) x - extracting bk_client-1.1/sfioball.c (text) x - extracting bk_client-1.1/sfio.c (text) x - extracting bk_client-1.1/system.h (text) [root@host]# cd bk_client-1.1/ [root@host]# make all cc -O2 -o sfio -lz sfio.c cc -O2 sfioball.c -o sfioball cc -O2 update.c -o update [root@host]# PATH=$PWD:$PATH

Now you need to download the latest copy of the source:

[root@host bk_client-1.1]# mkdir /usr/src/mysql [root@host bk_client-1.1]# cd /usr/src/mysql [root@host mysql]# sfioball bk://mysql.bkbits.net/mysql-5.0 5.0 OK-root OK

(More output appears as the latest source is retrieved.)

Next, you need to compile and install the code. You need GNU bison 1.75 (or newer), make, autoconf 2.58 (or newer), automake 1.8, libtool 1.5, and m4 to run the next set of commands. Even though many operating systems come with their own implementations of make, chances are good that the compilation will fail with strange error messages if you use their versions; therefore, it is highly recommended that you use GNU make (sometimes called gmake) instead.

The commands for compiling and installing the source code follow:

[root@host] cd 5.0 [root@host] bk -r edit [root@host] aclocal; autoheader [root@host] libtoolize --automake --force [root@host] automake --force --add-missing; autoconf [root@host] (cd innobase; aclocal; autoheader; autoconf; automake) [root@host] (cd bdb/dist; sh s_all) [root@host] ./configure --prefix=/usr/local/mysql -with-ndbcluster [root@host] make [root@host] BUILD/autorun.sh

If you get some strange errors at this stage, you should verify that you really have libtool installed. Otherwise, when the build is done, you should run make install. You need to be careful with this on a production machine because the command may overwrite your live release installation. If you have another installation of MySQL, you should run ./configure with different values for the --prefix, --with-tcp-port, and --unix-socket-path options than those used for your production server so your new source install runs in parallel and does not interfere with your production version. Of course, if you have the resources, it is highly recommended that you do your testing on non-production machines.

Note

Another way you can get a recent version of the source code, without needing BitKeeper or the automake toolchain, is to visit http://downloads.mysql.com. MySQL AB publishes nightly source code snapshots that are available for download at that location. These snapshots do the preceding steps for you and give you a version of the code that you can install exactly the same way you do the regular source code.

 

Upgrading a BitKeeper Installation

If you want to update the BitKeeper code any time after you first install it, you simply run these commands:

[alex@host]$ su - Password: [root@host]# cd /usr/src/mysql/ [root@host]# update bk://mysql.bkbits.net/mysql-5.0 5.0

Then you continue with the following commands:

[root@host] cd 5.0 [root@host] bk -r edit [root@host] aclocal; autoheader [root@host] libtoolize --automake --force [root@host] automake --force --add-missing; autoconf [root@host] (cd innobase; aclocal; autoheader; autoconf; automake) [root@host] (cd bdb/dist; sh s_all) [root@host] ./configure --prefix=/usr/local/mysql -with-ndbcluster [root@host] make [root@host] BUILD/autorun.sh

Категории