Article edited by dbart 1 year, 9 months ago

Selected Revision
Revision
1215
User
dbart
Date
2010-08-03 20:43
Compare To
Revision
915
User
dbart
Date
2010-06-17 00:29
Additions Deletions

Answer Diff [76]

The instructions on this page will help you download your own local branch of the [[MariaDB]] source code repository with the full revision history. If you want a tarball of the source without the revision history, see the [[http://mariadb.org/download|MariaDB download page]]. ¶

== Checking out the Source With Bazaar ¶

=== Prerequisites ¶

You need [[http://bazaar-vcs.org|Bazaar]] for revision control. ¶

=== Instructions ¶

# Prepare a directory to keep your MariaDB code in: <<code lang=sh inline=false>> ¶
mkdir $repo # where $repo is some directory (ex: ~/repos) ¶
cd $repo ¶
bzr init-repo maria --format=1.9 # this creates ~/repos/maria<</code>> ¶
# Get a clean local copy of the Maria repo with: <<code lang=sh inline=false>> ¶
cd $maria-repo # (ex: ~/repos/maria) ¶
bzr branch lp:maria trunk<</code>> ¶
The above will give you the latest stable MariaDB version. ¶
If you want to get another release use '''lp:maria/5.2''', ''lp:maria/5.3'''... ¶
For a complete list, go to [[http://launchpad.net/~maria-captains/+ownedbranches|Launchpad]] // **Note:** The initial branch operation can take a long time depending on the speed of your Internet connection and the load on launchpad. For this initial branch you need to download 600+ MB of data. // ¶
# If you get an error like: <<code lang=sh inline=false>> ¶
bzr: ERROR: Unknown repository format: 'Bazaar RepositoryFormatKnitPack6 (bzr 1.9)'<</code>> ¶
then the version of bzr you are using is too old. Using [[http://bazaar-vcs.org/Download|version 1.12]] or higher will fix this error. ¶
# If you have upgraded your bzr and are unable to successfully branch from launchpad, try using the source tree tarball (below) instead. ¶
# You can see the current history with: <<code lang=sh inline=false>> ¶
cd $maria-repo/trunk ¶
bzr log | less ¶
<</code>> ¶
# If you are going to be hacking on the MariaDB source code. See the [[Contributing Code]] page for help. ¶
# If you just want to compile MariaDB at this point, see the [[Compiling MariaDB]] page. ¶

== Source Tree Tarball ¶

For those that have trouble branching MariaDB from Launchpad we have created a tarball of a complete repository of the MariaDB tree. ¶

=== Prerequisites ¶

You need [[http://bazaar-vcs.org|Bazaar]] to work with the repository. ¶

=== Using the Source Tree Tarball ¶

# Download the mariadb-shared-repo.tgz file from
one of our[[http://askmonty.org/wiki/MariaDB:Download:Shared_Repo|one of the MariaDB mirrors]]. ¶
** The file is 292MB, so the download may take a long time to complete depending on your Internet connection. ¶
# The .tgz file contains a .bzr directory. The parent directory of ¶
this .bzr directory is (or becomes) a shared repository containing the ¶
MariaDB source code. It is recommended to create a new directory for ¶
this, so the next step is to create a directory to house the ¶
repository. Call this directory anything you like ("maria", "mariadb", ¶
"my", "src", etc...). Once created, cd into the directory and untar ¶
the file. Here is an example using the name "mariadb" for the new ¶
directory, with the directory located in a directory called "src" in ¶
the home directory of the current user, and the ¶
mariadb-shared-repo.tgz file located in a directory named Downloads ¶
(also in the current user's home directory): <<code lang=sh inline=false>> ¶
mariadbdir="mariadb" ¶
downloadsdir="${HOME}/Downloads" ¶
sourcecodedir="${HOME}/src" ¶
cd ${sourcecodedir} ¶
mkdir ${mariadbdir} ¶
cd ${mariadbdir} ¶
tar -zxvf ${downloadsdir}/mariadb-shared-repo.tgz<</code>> ¶
# After the untar step you will have a bzr shared repository, but not ¶
a working tree. While in the shared repository directory, use the ¶
<<code>> bzr branch <</code>> command to branch the MariaDB trees you are ¶
interested in. For example: ¶
** <<code lang=sh inline=true>> bzr branch lp:maria/5.2 <</code>> ¶
** <<code lang=sh inline=true>> bzr branch lp:maria <</code>> ¶
# Thanks to the repository, either of the above commands will complete very fast. ¶
# Before working with the code, make sure you pull down the latest version of the source code: <<code lang=sh inline=false>> ¶
cd mariadb-5.2 ¶
bzr pull <</code>> ¶
# You can now use this source tree as if you had branched it from launchpad directly. ¶