Ubuntu logo

Packaging Guide

3. Ubuntu Distributed Development — введение

Это руководство фокусируется на работе с пакетами с использованием метода Ubuntu Distributed Development (UDD).

Ubuntu Distributed Development (UDD) — это новая технология разработки пакетов Ubuntu, использующая инструменты, процессы и последовательности действий, характерные для типичной схемы разработки программ, основанной на распределённой системе управления версиями (DVCS). DVCS, используемая в UDD — это Bazaar.

3.1. Ограничения традиционных методов создания пакетов

Традиционно пакеты Ubuntu хранятся в архивных tar-файлах. Традиционный пакет исходного кода состоит из tar-файла с исходным кодом из апстрима, “debian” tar-файла (или сжатого diff-файл для более старых пакетов), содержащего набор входных файлов для создания пакета, и файла .dsc с метаданными. Чтобы посмотреть на традиционный пакет, выполните команду:

$ apt-get source kdetoys

Она загрузит исходники из апстрима kdetoys_4.6.5.orig.tar.bz2, набор входных файлов kdetoys_4.6.5-0ubuntu1.debian.tar.gz и метаданные kdetoys_4.6.5-0ubuntu1~ppa1.dsc. Если у вас установлен dpkg-dev, она извлечёт их содержимое и предоставит вам пакет исходного кода.

Traditional packaging would edit these files and upload. However this gives limited opportunity to collaborate with other developers, changes have to be passed around as diff files with no central way to track them and two developers can not make changes at the same time. So most teams have moved to putting their packaging in a revision control system. This makes it easier for several developers to work on a package together. However there is no direct connection between the revision control system and the archive packages so the two must be manually kept in sync. Since each team works in its own revision control system a prospective developer must first work out where that is and how to get the packaging before they can work on the package.

3.2. Ubuntu Distributed Development

With Ubuntu Distributed Development all packages in the Ubuntu (and Debian) archive are automatically imported into Bazaar branches on our code hosting site Launchpad. Changes can be made directly to these branches in incremental steps and by anyone with commit access. Changes can also be made in forked branches and merged back in with Merge Proposals when they are large enough to need review or if they are by someone without direct commit access.

UDD branches are all in a standard location, so doing a checkout is easy:

$ bzr branch ubuntu:kdetoys

The merge history includes two separate branches, one for the upstream source and one which adds the debian/ packaging directory:

$ cd kdetoys
$ bzr qlog

(Эта команда использует в качестве графического интерфейса qbzr. Для вывода в консоль, запустите log вместо qlog.)

./_images/kdetoys-udd-branch.png

This UDD branch of kdetoys shows the full packaging for each version uploaded to Ubuntu with grey circles and the upstream source versions with green circles. Versions are tagged with either the version in Ubuntu such as 4:4.2.29-0ubuntu1 or for the upstream branch with the upstream version upstream-4.2.96.

Many Ubuntu packages are based on the packages in Debian, UDD also imports the Debian package into our branches. In the kdetoys branch above the Debian versions from unstable are from the merge with blue circles while those from Debian experimental are from the merge with yellow circles. Debian releases are tagged with their version number, e.g., 4:4.2.2-1.

Таким образом из UDD-ветки вы можете увидеть полную историю изменений пакета и сравнить любые две версии. Например, чтобы увидеть различия между версией 4.2.2 в Debian и 4.2.2 в Ubuntu, используйте:

$ bzr qdiff -r tag:4:4.2.2-1..tag:4:4.2.2-1ubuntu1

(Эта команда использует графический интерфейс qbzr. Запустите diff вместо qdiff для вывода в консоль.)

./_images/kdetoys-udd-diff.png

Здесь мы можем ясно увидеть, что было изменено в Ubuntu по сравнению с Debian-версией. Очень удобно.

3.3. Bazaar

Ветки UDD используют Bazaar — распределённую систему управления версиями, которая проста в использовании для тех, кто знаком с такими популярными системами, как Subversion, и в то же время предоставляет всю мощь Git.

Чтобы создавать пакеты с помощью UDD, вам нужно знать основы того, как использовать Bazaar для управления файлами. Для знакомства с Bazaar смотрите Пятиминутный урок по Bazaar и Руководство пользователя Bazaar.

3.4. Ограничения UDD

Ubuntu Distributed Development — новый метод работы с пакетами Ubuntu. В настоящее время он имеет некоторые существенных ограничения:

  • Doing a full branch with history can take a lot of time and network resources. You may find it quicker to do a lightweight checkout bzr checkout --lightweight ubuntu:kdetoys but this will need a network access for any further bzr operations.
  • Working with patches is fiddly. Patches can be seen as a branched revision control system, so we end up with RCS on top of RCS.
  • There is no way to build directly from branches. You need to create a source package and upload that.
  • Some packages have not been successfully imported into UDD branches. Recent versions of Bazaar will automatically notify you when this is the case. You can also check the status of the package importer manually before working on a branch.

All of the above are being worked on and UDD is expected to become the main way to work on Ubuntu packages soon. However currently most teams within Ubuntu do not yet work with UDD branches for their development. However because UDD branches are the same as the packages in the archive any team should be able to accept merges against them.