1.5 Шаг 1: Загрузка Samba

1.5 Шаг 1: Загрузка Samba

Currently, there are three methods to download the current Samba sources, either as a tarball of the latest stable release, or a development version via git or rsync. If you hope to work with the team on a development version to resolve issues you may hit via code changes, we recommend using the git method for downloading Samba, as it makes getting updates easier, and also allows you to integrate test patches from Samba developers more easily in case of problems.

На сегодняшний день существует три способа для получения исходных кодов Samba, в качестве tarball последнего стабильного релиза, или разрабатываемой версии через git или rsync. Если вы хотите использовать вновь добавляемые возможности, и использовать самый свежий пакет Samba, тогда используйте git метод для загрузки Samba. Так будет проще всего обновлять Samba, а в случае возникновения проблем проще накладывать патчи от разработчиков Samba. Eng.

In the following examples we will assume that your top-level source is named samba-master. If you downloaded a tarball this will instead be based on the name of the tarball downloaded (e.g. samba-4.0.0 for the tarball samba-4.0.0.tar.gz). Also note that in the master branch the Samba 4 code in our current git tree is now located in the top level directory.

В следующих примерах мы будем считать, что корневой директорией для исходных кодов на вашем сервере является папка samba-master. Если же вы скачали исходники в виде tarball архива, то за корень примем папку с именем загруженного tarball архива (то есть samba-4.0.0 для samba-4.0.0.tar.gz). Также заметьте, что master branch исходных кодов Samba 4 в текущем дереве git так же располагается в каталоге верхнего уровня. Eng.

1.5.1 Загрузка tarball

If you wish to use a released version of Samba 4.0, you can download the latest Samba 4.0 tarball from Samba website

В случае использования релиза Samba 4.0, загрузите последнюю версию tarball Samba 4.0 c Samba website. Eng.

1.5.2 Загрузка через git

Git allows you to download the source tree via either the git or http protocols. In general, the git protocol is the preferred choice since it compresses the data being transferred. To download the source tree via git, run the following command:

Git позволяет загрузить дерево исходных кодов через сеть по протоколам git или http. Лучше использовать git протокол, в виду того, что при его использовании происходит сжатие передаваемых данных через сеть. Для загрузки передаваемых данных через git, выполните следующую команду: Eng.

$ git clone git://git.samba.org/samba.git samba-master

Alternatively, if you prefer to use the http protocol, run the following command:

В случае использования протокола http следует выполнить команду: Eng.

$ git clonehttp://gitweb.samba.org/samba.git  samba-master

Either command will create a directory called samba-master in the current directory.

В результате выполнения команды в текущей директории появится каталог samba-master. Eng.

1.5.2.1 Обновление через git

If you already have downloaded the source tree via git and want to update the tree to the latest version, run the following command in your samba-master directory:

Если вы уже загружали через git исходный код ранее, то для обновления его до последней версии в папке samba-master просто выполните команду: Eng.

$ git pull

If you get an error like this:

В случае возникновения ошибки: Eng.

fatal: Unable to create '[...]/samba_master/.git/index.lock': File exists.

Run the command below to reset your tree.

Выполните команду для очистки вашего дерева исходного кода. Eng.

If you are having trouble compiling the source, it may be due to stale files. You can reset your git tree to correct these errors. To reset your git tree, run the following command in your samba-master directory:

Ошибки, возникающие при компиляции, могут быть связаны c устаревшими файлами. Вам нужно сбросить ваше git дерево для исправления этих ошибок. Для этого перейдите в директорию samba-master и выполните следующую команду: Eng.

 $ git clean -x -f -d

1.5.3 Загрузка через rsync

If git is not available to you, rsync is the next best choice. To download the source tree via rsync, run the following command:

В случае недоступности git репозитария вы можете загрузить исходные коды, используя программу rsync, выполните команду: Eng.

 $ rsync -avz samba.org::ftp/unpacked/samba_4_0_test/ samba-master

This command will create a directory called samba-master in the current directory, containing a checked out git repository. If you plan on using git to manage the tree, you will need to run the following commands in your samba-master directory:

В результате выполнения команды в текущей директории создастся папка samba-master, с копией нашего git репозитария. Если вы планируете использовать git в дальнейшем для обновления исходного кода, тогда выполните следующие команды в директории samba-master: Eng.

 $ cd samba-master/
 $ rm .git/refs/tags/*
 $ rm -r .git/refs/remotes/
 $ git config remote.origin.url git://git.samba.org/samba.git
 $ git config --add remote.origin.fetch +refs/tags/*:refs/tags/* (this line is optional)
 $ git fetch

Note you can ignore this error from git fetch:

В случае возникновения следующей ошибки, игнорируйте ее: Eng.

 error: refs/heads/master does not point to a valid object!

Refer to the Updating via git instructions on how to manage the source tree with git.

Изучите следующие инструкции 1.5.2.1 Обновление через git для понимания работы с репозитариями git. Eng.