Merge lp:~jr/ubuntu-packaging-guide/02-udd-introduction into lp:ubuntu-packaging-guide

Proposed by Jonathan Riddell
Status: Merged
Approved by: Barry Warsaw
Approved revision: 67
Merged at revision: 48
Proposed branch: lp:~jr/ubuntu-packaging-guide/02-udd-introduction
Merge into: lp:ubuntu-packaging-guide
Diff against target: 530 lines (+275/-192)
4 files modified
index.rst (+11/-3)
traditional-packaging.rst (+5/-0)
udd-getting-the-source.rst (+142/-0)
udd-intro.rst (+117/-189)
To merge this branch: bzr merge lp:~jr/ubuntu-packaging-guide/02-udd-introduction
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Review via email: mp+68078@code.launchpad.net

Description of the change

split out udd-intro into a real introduction to UDD and a separate page for getting the source, also add some honesty about UDD on the front page and stub article for traditional packaging

To post a comment you must log in.
Revision history for this message
Jonathan Riddell (jr) wrote :
64. By Jonathan Riddell

add images

Revision history for this message
Barry Warsaw (barry) wrote :

I guess there's some overlap with your other merge proposal. I can't review the whole thing again. Any chance you can make this branch depend on your other branch so that only the diffs in this branch are visible?

65. By Jonathan Riddell

merge in trunk

66. By Jonathan Riddell

no change commit to refresh merge proposal

Revision history for this message
Jonathan Riddell (jr) wrote :

Updated

67. By Jonathan Riddell

merge in trunk

Revision history for this message
Barry Warsaw (barry) wrote :

Couple of notes:

* There's some very cool stuff in the dev branch of bzr that will make the rmadison checks go away. I've been trying them out and they're fantastic.

* Often, when a package is out of date, instead of using apt-get source, i'll use `bzr import-dsc <url>` where the url is the remote url to the .dsc file. I usually grab those from packages.ubuntu.com. I like this a bit better because, while you cannot merge these import-dsc branches with the udd branch, you still get all the other benefits of version control.

review: Approve
68. By Jonathan Riddell

simplify ensuring the version is up to date for new warnings built into bzr

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'images/kdetoys-udd-branch.png'
0Binary files images/kdetoys-udd-branch.png 1970-01-01 00:00:00 +0000 and images/kdetoys-udd-branch.png 2011-07-25 09:48:39 +0000 differ0Binary files images/kdetoys-udd-branch.png 1970-01-01 00:00:00 +0000 and images/kdetoys-udd-branch.png 2011-07-25 09:48:39 +0000 differ
=== added file 'images/kdetoys-udd-diff.png'
1Binary files images/kdetoys-udd-diff.png 1970-01-01 00:00:00 +0000 and images/kdetoys-udd-diff.png 2011-07-25 09:48:39 +0000 differ1Binary files images/kdetoys-udd-diff.png 1970-01-01 00:00:00 +0000 and images/kdetoys-udd-diff.png 2011-07-25 09:48:39 +0000 differ
=== modified file 'index.rst'
--- index.rst 2011-07-22 15:08:17 +0000
+++ index.rst 2011-07-25 09:48:39 +0000
@@ -9,8 +9,14 @@
9The guide is split up into two sections:9The guide is split up into two sections:
1010
11* A list of articles based on tasks, things you want to get done.11* A list of articles based on tasks, things you want to get done.
12* A set of articles that dig deeper into specific bits of our tools12* A set of knowledge-base articles that dig deeper
13 and workflows.13 into specific bits of our tools and workflows.
14
15This guide focuses on the Ubuntu Distributed Development packaging method.
16This is a new way of packaging which uses Distributed Revision Control
17branches. It currently has some limitations which mean many teams in Ubuntu
18use :doc:`traditional packaging</traditional-packaging>` methods. See the
19:doc:`UDD Introduction</udd-intro>` page for an introduction to the differences.
1420
15Articles21Articles
16--------22--------
@@ -20,6 +26,7 @@
2026
21 introduction-to-ubuntu-development27 introduction-to-ubuntu-development
22 getting-set-up28 getting-set-up
29 udd-intro
23 fixing-a-bug30 fixing-a-bug
24 fixing-a-bug-security31 fixing-a-bug-security
2532
@@ -31,7 +38,7 @@
3138
32 debian-dir-overview39 debian-dir-overview
33 testing40 testing
34 udd-intro41 udd-getting-the-source
35 udd-working42 udd-working
36 udd-sponsorship43 udd-sponsorship
37 udd-uploading44 udd-uploading
@@ -39,6 +46,7 @@
39 udd-merging46 udd-merging
40 udd-patchsys47 udd-patchsys
41 udd-newpackage48 udd-newpackage
49 traditional-packaging
4250
4351
44Indices and tables52Indices and tables
4553
=== added file 'traditional-packaging.rst'
--- traditional-packaging.rst 1970-01-01 00:00:00 +0000
+++ traditional-packaging.rst 2011-07-25 09:48:39 +0000
@@ -0,0 +1,5 @@
1=====================
2Traditional Packaging
3=====================
4
5FIXME describe traditional packaging here
06
=== added file 'udd-getting-the-source.rst'
--- udd-getting-the-source.rst 1970-01-01 00:00:00 +0000
+++ udd-getting-the-source.rst 2011-07-25 09:48:39 +0000
@@ -0,0 +1,142 @@
1==================
2Getting the Source
3==================
4
5Source package URLs
6===================
7
8Bazaar provides some very nice shortcuts for accessing Launchpad's source
9branches of packages in both Ubuntu and Debian.
10
11To refer to source branches use::
12
13 ubuntu:package
14
15where *package* refers to the package name you're interested in. This URL
16refers to the package in the current development version of Ubuntu. To
17refer to the branch of Tomboy in the development version, you would use::
18
19 ubuntu:tomboy
20
21To refer to the version of a source package in an older release of Ubuntu,
22just prefix the package name with the release's code name. E.g. to refer to
23Tomboy's source package in Maverick_ use::
24
25 ubuntu:maverick/tomboy
26
27Since they are unique, you can also abbreviate the distro-series name::
28
29 ubuntu:m/tomboy
30
31You can use a similar scheme to access the source branches in Debian, although
32there are no shortcuts for the Debian distro-series names. To access the
33Tomboy branch in the current development series for Debian use:
34
35 debianlp:tomboy
36
37and to access Tomboy in Debian Lenny_ use::
38
39 debianlp:lenny/tomboy
40
41
42.. _`Bazaar`: http://bazaar.canonical.com/en/
43.. _`Intrepid`: https://wiki.ubuntu.com/IntrepidIbex
44.. _Maverick: https://wiki.ubuntu.com/MaverickMeerkat
45.. _Lenny: http://debian.org/releases/stable/
46
47
48Getting the source
49==================
50
51Every source package in Ubuntu has an associated source branch on Launchpad.
52These source branches are updated automatically by Launchpad, although the
53process is not currently foolproof.
54
55There are a couple of things that we do first in order to make the workflow
56more efficient later. Once you are used to the process you will learn when it
57makes sense to skip these steps.
58
59
60.. _branching:
61
62Creating a shared repository
63----------------------------
64
65You want to work on the Tomboy package in Natty, and you've verified
66that the source package is named ``tomboy``. Before actually
67branching the code for Tomboy, create a shared repository to hold the
68branches for this package. The shared repository will make future
69work much more efficient.
70
71Do this using the `bzr init-repo` command, passing it the directory name we
72would like to use::
73
74 $ bzr init-repo tomboy
75
76You will see that a `tomboy` directory is created in your current working
77area. Change to this new directory for the rest of your work::
78
79 $ cd tomboy
80
81
82Getting the trunk branch
83------------------------
84
85We use the `bzr branch` command to create a local branch of the package.
86We'll name the target directory `tomboy.dev` just to keep things easy to
87remember::
88
89 $ bzr branch ubuntu:tomboy tomboy.dev
90
91The tomboy.dev directory represents the version of Tomboy in the development
92version of Ubuntu, and you can always ``cd`` into this directory and do a `bzr
93pull` to get any future updates.
94
95.. _up-to-date:
96
97Ensuring the version is up to date
98----------------------------------
99
100When you do your ``bzr branch`` you will get a message telling you if the packaging branch is up to date. Occationally the importer fails and packaging branches do not match what is in the archive. A message saying::
101
102 Packaging branch status: OUT-OF-DATE
103
104Means the importer has failed. You can find out why on
105http://package-import.ubuntu.com/status/ and `file a bug on the UDD
106project`_ to get the issue resolved.
107
108
109Getting a branch for a particular release
110-----------------------------------------
111
112When you want to do something like a `stable release update`_ (SRU), or you
113just want to examine the code in an old release, you'll want to grab the
114branch corresponding to a particular Ubuntu release. For example, to get the
115Tomboy package for Maverick do::
116
117 $ bzr branch ubuntu:m/tomboy maverick
118
119
120Importing a Debian source package
121---------------------------------
122
123If the package you want to work on is available in Debian but not Ubuntu, it's
124still easy to import the code to a local bzr branch for development. Let's
125say you want to import the `newpackage` source package. We'll start by
126creating a shared repository as normal, but we also have to create a working
127tree to which the source package will be imported (remember to cd out of the
128`tomboy` directory created above)::
129
130 $ bzr init-repo newpackage
131 $ cd newpackage
132 $ bzr init debian
133 $ cd debian
134 $ bzr import-dsc http://ftp.de.debian.org/debian/pool/main/n/newpackage/newpackage_1.0-1.dsc
135
136As you can see, we just need to provide the remote location of the dsc file,
137and Bazaar will do the rest. You've now got a Bazaar source branch.
138
139
140.. _`status of the package importer`: http://package-import.ubuntu.com/status
141.. _`file a bug on the UDD project`: https://bugs.launchpad.net/udd
142.. _`stable release update`: https://wiki.ubuntu.com/StableReleaseUpdates
0143
=== modified file 'udd-intro.rst'
--- udd-intro.rst 2011-07-13 11:27:47 +0000
+++ udd-intro.rst 2011-07-25 09:48:39 +0000
@@ -1,202 +1,130 @@
1===================================================1===================================================
2Ubuntu Distributed Development - Getting the Source2Ubuntu Distributed Development - Introduction
3===================================================3===================================================
44
5*Ubuntu Distributed Development* (UDD) is a technique for developing Ubuntu5This guide focuses on packaging using the *Ubuntu Distributed Development* (UDD)
6method.
7
8*Ubuntu Distributed Development* (UDD) is a new technique for developing Ubuntu
6packages that uses tools, processes, and workflows similar to generic9packages that uses tools, processes, and workflows similar to generic
7distributed version control system (DVCS) based software development. The10distributed version control system (DVCS) based software development. The
8DVCS used for UDD is Bazaar_.11DVCS used for UDD is Bazaar_.
912
10You should already be familiar with basic Bazaar usage and workflow. For an13Traditional Packaging Limitations
11introduction to Bazaar see the `Bazaar Five Minute Tutorial14---------------------------------
15
16Traditionally Ubuntu packages have been kept in tar archive files. A
17traditional source package is made up of the upstream source tar, a "debian" tar
18(or compressed diff file for older packages) containing the packaging and a
19.dsc meta-data file. To see a traditional package run::
20
21 $ apt-get source kdetoys
22
23This will download the upstream source ``kdetoys_4.6.5.orig.tar.bz2``, the
24packaging ``kdetoys_4.6.5-0ubuntu1.debian.tar.gz`` and the meta-data
25``kdetoys_4.6.5-0ubuntu1~ppa1.dsc``. Assuming you have dpkg-dev installed it
26will extract these and give you the source package.
27
28Traditional packaging would edit these files and upload. However this gives
29limited opportunity to collaborate with other developers, changes have to be
30passed around as diff files with no central way to track them and two developers
31can not make changes at the same time. So most teams have moved to putting
32their packaging in a revision control system. This makes it easier for several
33developers to work on a package together. However there is no direct
34connection between the revision control system and the archive packages so the
35two must be manually kept in sync. Since each team works in its own revision
36control system a prospective developer must first work out where that is and
37how to get the packaging before they can work on the package.
38
39Ubuntu Distributed Development
40------------------------------
41
42With Ubuntu Distributed Development all packages in the Ubuntu (and Debian)
43archive are automatically imported into Bazaar branches on our code hosting
44site Launchpad. Changes can be made directly to these branches in
45incremental steps and by anyone with commit access. Changes can also be made
46in forked branched and merged back in with Merge Proposals when they are large
47enough to need review or if they are by someone without direct commit access.
48
49UDD branches are all in a standard location so doing a checkout is easy::
50
51 $ bzr branch ubuntu:kdetoys
52
53The merge history includes two separate branches, one for the upstream source
54and one which adds the ``debian/`` packaging directory::
55
56 $ cd kdetoys
57 $ bzr qlog
58
59(This command uses *qbzr* for a GUI, run ``log`` instead of ``qlog`` for
60console output.)
61
62.. image:: images/kdetoys-udd-branch.png
63
64This UDD branch of *kdetoys* shows the full packaging for each version
65uploaded to Ubuntu with grey circles and the upstream source versions with
66green circles. Versions are tagged with either the version in Ubuntu such as
67``4:4.2.29-0ubuntu1`` or for the upstream branch with the upstream version
68``upstream-4.2.96``.
69
70Many Ubuntu packages are based on the packages in Debian, UDD also imports the
71Debian package into our branches. In the *kdetoys* branch above the Debian
72versions from *unstable* are from the merge with blue circles while those from
73*Debian experimental* are from the merge with yellow circles. Debian
74released are tagged with their version number e.g. ``4:4.2.2-1``.
75
76So from a UDD branch you can see the complete history of changes to the package
77and compare any two versions. For example, to see the changes between version
784.2.2 in Debian and the 4.2.2 in Ubuntu use::
79
80 $ bzr qdiff -r tag:4:4.2.2-1..tag:4:4.2.2-1ubuntu1
81
82(This command uses *qbzr* for a GUI, run ``diff`` instead of ``qdiff`` for
83console output.)
84
85.. image:: images/kdetoys-udd-diff.png
86
87From this we can clearly see what has changed in Ubuntu compared to Debian,
88very handy.
89
90Bazaar
91------
92
93UDD branches use Bazaar, a distributed revision control system intended to be
94easy to use for those familiar with popular systems such as Subversion while
95offering the power of Git.
96
97To do packaging with UDD you will need to know the basics of how to use
98Bazaar to manage files. For an introduction to Bazaar see the `Bazaar Five
99Minute Tutorial
12<http://doc.bazaar.canonical.com/bzr.dev/en/mini-tutorial/index.html>`_ and the100<http://doc.bazaar.canonical.com/bzr.dev/en/mini-tutorial/index.html>`_ and the
13`Bazaar Users Guide101`Bazaar Users Guide
14<http://doc.bazaar.canonical.com/bzr.dev/en/user-guide/index.html>`_.102<http://doc.bazaar.canonical.com/bzr.dev/en/user-guide/index.html>`_.
15103
16104Limitations of UDD
17Source package URLs105------------------
18===================106
19107Ubuntu Distributed Development is a new method for working with Ubuntu
20Bazaar provides some very nice shortcuts for accessing Launchpad's source108packages. It currently has some notable limitations:
21branches of packages in both Ubuntu and Debian.109
22110* Doing a full branch with history can take a lot of time and network
23To refer to source branches use::111 resources. You may find it quicker to do a lightweight checkout ``bzr
24112 checkout --lightweight ubuntu:kdetoys`` but this will need a network access
25 ubuntu:package113 for any further bzr operations.
26114
27where *package* refers to the package name you're interested in. This URL115* Working with patches is fiddly. Patches can be seen as a branched revision
28refers to the package in the current development version of Ubuntu. To116 control system, so we end up with RCS on top of RCS.
29refer to the branch of Tomboy in the development version, you would use::117
30118* There is no way to build directly from branches. You need to create a source
31 ubuntu:tomboy119 package and upload that.
32120
33To refer to the version of a source package in an older release of Ubuntu,121* Some packages have not been successfully imported into UDD branches. You
34just prefix the package name with the release's code name. E.g. to refer to122 should check the `status of the package importer`_ before working on a branch.
35Tomboy's source package in Maverick_ use::123
36124All of the above are being worked on and UDD is expected to become the main way
37 ubuntu:maverick/tomboy125to work on Ubuntu packages soon. However currently most teams within Ubuntu do
38126not yet work with UDD branches for their development. However because UDD
39Since they are unique, you can also abbreviate the distro-series name::127branches are the same as the packages in the archive any team should be able to
40128accept merges against them.
41 ubuntu:m/tomboy
42
43You can use a similar scheme to access the source branches in Debian, although
44there are no shortcuts for the Debian distro-series names. To access the
45Tomboy branch in the current development series for Debian use:
46
47 debianlp:tomboy
48
49and to access Tomboy in Debian Lenny_ use::
50
51 debianlp:lenny/tomboy
52
53
54.. _`Bazaar`: http://bazaar.canonical.com/en/
55.. _`Intrepid`: https://wiki.ubuntu.com/IntrepidIbex
56.. _Maverick: https://wiki.ubuntu.com/MaverickMeerkat
57.. _Lenny: http://debian.org/releases/stable/
58
59
60Getting the source
61==================
62
63Every source package in Ubuntu has an associated source branch on Launchpad.
64These source branches are updated automatically by Launchpad, although the
65process is not currently foolproof.
66
67There are a couple of things that we do first in order to make the workflow
68more efficient later. Once you are used to the process you will learn when it
69makes sense to skip these steps.
70
71
72.. _up-to-date:
73
74Ensure the source branch is up-to-date
75--------------------------------------
76
77Once you've determined which source package to work on, you should ensure that
78the source branch for that package on Launchpad is up-to-date. Some package
79imports fail for various reasons, and the `status of the package importer`_ is
80always available online. If the source branch for a package you want to work
81on is out of sync, you'll have to use ``apt-get source`` until the import of
82that package is fixed.
83
84Let's say you want to fix a problem in Tomboy in Natty. First, find out the
85latest binary package versions that are available::
86
87 $ rmadison tomboy | grep natty
88 tomboy | 1.5.2-1ubuntu4 | natty | source, amd64, i386
89
90You've already seen how to :ref:`determine the source package corresponding to
91this binary package <what-to-fix>`. For Tomboy, the binary and source
92packages are both named ``tomboy``.
93
94Whenever the package importer processes a new source package version, it adds
95a Bazaar tag corresponding to that new version. You can use this tag to
96ensure that the import is up-to-date. To find the tag of the last revision
97committed by the package importer, do::
98
99 $ bzr log ubuntu:tomboy | grep ^tags | head -n 1
100 tags: 1.5.2-1ubuntu4
101
102By comparing the version number returned by ``rmadison`` and the tag added by
103the package importer, we can see that the ``tomboy`` source package for Natty
104is up-to-date.
105
106Here's an example of a package that is out-of-date. Let's say you want to fix
107a problem in the ``initscripts`` binary package. First find out the
108latest binary package versions that are available::
109
110 $ rmadison initscripts | tail -n 1
111 initscripts | 2.87dsf-4ubuntu25 | oneiric | amd64, i386
112
113Then determine the source package corresponding to this binary package::
114
115 $ apt-cache showsrc initscripts | grep ^Package:
116 Package: sysvinit
117
118Find the latest tag added by the package importer::
119
120 $ bzr log ubuntu:sysvinit | grep ^tags | head -n 1
121 tags: 2.86.ds1-61ubuntu13
122
123Here we can see that ``2.86.ds1-61ubuntu13`` is older than
124``2.87dsf-4ubuntu19`` so the source package is out of date, and in fact we can
125verify that by looking at the status package for the package at
126http://package-import.ubuntu.com/status/sysvinit.html.
127
128When you find such out-of-date packages, be sure to `file a bug on the UDD
129project`_ to get the issue resolved.
130
131A feature in progress is for a warning to be automatically printed when
132branching an out of date import, this will make the above obsolete.
133
134.. _branching:
135
136Creating a shared repository
137----------------------------
138
139Okay, you want to work on the Tomboy package in Natty, and you've verified
140that the source package is up-to-date. Before actually branching the code for
141Tomboy, create a shared repository to hold the branches for this package.
142The shared repository will make future work much more efficient.
143
144Do this using the `bzr init-repo` command, passing it the directory name we
145would like to use::
146
147 $ bzr init-repo tomboy
148
149You will see that a `tomboy` directory is created in your current working
150area. Change to this new directory for the rest of your work::
151
152 $ cd tomboy
153
154
155Getting the trunk branch
156------------------------
157
158We use the `bzr branch` command to create a local branch of the package.
159We'll name the target directory `tomboy.dev` just to keep things easy to
160remember::
161
162 $ bzr branch ubuntu:tomboy tomboy.dev
163
164The tomboy.dev directory represents the version of Tomboy in the development
165version of Ubuntu, and you can always ``cd`` into this directory and do a `bzr
166pull` to get any future updates.
167
168
169Getting a branch for a particular release
170-----------------------------------------
171
172When you want to do something like a `stable release update`_ (SRU), or you
173just want to examine the code in an old release, you'll want to grab the
174branch corresponding to a particular Ubuntu release. For example, to get the
175Tomboy package for Maverick do::
176
177 $ bzr branch ubuntu:m/tomboy maverick
178
179
180Importing a Debian source package
181---------------------------------
182
183If the package you want to work on is available in Debian but not Ubuntu, it's
184still easy to import the code to a local bzr branch for development. Let's
185say you want to import the `newpackage` source package. We'll start by
186creating a shared repository as normal, but we also have to create a working
187tree to which the source package will be imported (remember to cd out of the
188`tomboy` directory created above)::
189
190 $ bzr init-repo newpackage
191 $ cd newpackage
192 $ bzr init debian
193 $ cd debian
194 $ bzr import-dsc http://ftp.de.debian.org/debian/pool/main/n/newpackage/newpackage_1.0-1.dsc
195
196As you can see, we just need to provide the remote location of the dsc file,
197and Bazaar will do the rest. You've now got a Bazaar source branch.
198
199129
200.. _`status of the package importer`: http://package-import.ubuntu.com/status130.. _`status of the package importer`: http://package-import.ubuntu.com/status
201.. _`file a bug on the UDD project`: https://bugs.launchpad.net/udd
202.. _`stable release update`: https://wiki.ubuntu.com/StableReleaseUpdates

Subscribers

People subscribed via source and target branches