Ubuntu logo

Packaging Guide

7. Uploading a package

После того, как предложение слияния проверено и утверждено, вы можете захотеть выгрузить свой пакетy либо в архив дистрибутива (если у вас есть соответствующие права), либо в ваш персональный архив пакетов (Personal Package Archive, или PPA). Вам также может понадобиться это сделать, если вы являетесь взяли на себя поручительство над чьими-нибудь изменениями.

7.1. Выгрузка изменений, сделанных вами

When you have a branch with a change that you would like to upload you need to get that change back on to the main source branch, build a source package, and then upload it.

First, you need to check that you have the latest version of the package in your checkout of the development package trunk:

$ cd tomboy/tomboy.dev
$ bzr pull

This pulls in any changes that may have been committed while you were working on your fix. From here, you have several options. If the changes on the trunk are large and you feel should be tested along with your change you can merge them into your bug fix branch and test there. If not, then you can carry on merging your bug fix branch into the development trunk branch. As of bzr 2.5 and bzr-builddeb 2.8.1, this works with just the standard merge command:

$ bzr merge ../bug-12345

Для более старых версий bzr можно использовать взамен команду merge-package:

$ bzr merge-package ../bug-12345

Эта команда сольёт два дерева и, возможно, сообщит о конфликтах, которые вам надо будет разрешить вручную.

Далее следует убедиться в правильности содержимого debian/changelog, то есть, что там правильно указан дистрибутив, номер версии и т.п.

Once that is done you should review the change you are about to commit with bzr diff. This should show you the same changes as a debdiff would before you upload the source package.

Следующий шаг — собрать и протестировать изменённый пакет исходного кода, как вы это обычно делаете:

$ bzr builddeb -S

When you’re finally happy with your branch, make sure you’ve committed all your changes, then tag the branch with the changelog’s version number. The bzr tag command will do this for you automatically when given no arguments:

$ bzr tag

This tag will tell the package importer that what is in the Bazaar branch is the same as in the archive.

Теперь вы можете выгрузить командой push изменения обратно на Launchpad:

$ bzr push ubuntu:tomboy

(Измените место назначения, если вы выгружаете SRU или что-то подобное.)

Вам нужен один последний шаг, чтобы отправить свои изменения в Ubuntu или ваш PPA: вам нужно загрузить с помощью dput пакет исходного кода в соответствующее место. Например, чтобы загрузить изменения в PPA, сделайте следующее:

$ dput ppa:imasponsor/myppa tomboy_1.5.2-1ubuntu5_source.changes

или, если у вас есть права загрузки в основной архив:

$ dput tomboy_1.5.2-1ubuntu5_source.changes

You are now free to delete your feature branch, as it is merged, and can be re-downloaded from Launchpad if needed.

7.2. Поручительство над изменением

Поручительство над чьим-нибудь изменением похоже на вышеописанную процедуру, но вместо слияния из созданной вами ветки вы выполняете слияние из ветки, имеющейся в предложении слияния:

$ bzr merge lp:~subgenius/ubuntu/raring/tomboy/bug-12345

If there are lots of merge conflicts you would probably want to ask the contributor to fix them up. See the next section to learn how to cancel a pending merge.

But if the changes look good, commit and then follow the rest of the uploading process:

$ bzr commit --author "Bob Dobbs <subgenius@example.com>"

7.3. Отмена выгрузки

At any time before you dput the source package you can decide to cancel an upload and revert the changes:

$ bzr revert

You can do this if you notice something needs more work, or if you would like to ask the contributor to fix up conflicts when sponsoring something.

7.4. Поручительство над чем-нибудь и внесение своих собственных изменений

Если вы являетесь поручителем над чьей-нибудь работой, но хотите дополнить её несколькими собственными изменениями, то вы можете сначала выполнить слияние их работы в отдельную ветку.

If you already have a branch where you are working on the package and you would like to include their changes, then simply run the bzr merge from that branch, instead of the checkout of the development package. You can then make the changes and commit, and then carry on with your changes to the package.

If you don’t have an existing branch, but you know you would like to make changes based on what the contributor provides then you should start by grabbing their branch:

$ bzr branch lp:~subgenius/ubuntu/raring/tomboy/bug-12345

then work in this new branch, and then merge it in to the main one and upload as if it was your own work. The contributor will still be mentioned in the changelog, and Bazaar will correctly attribute the changes they made to them.