Merge lp:~jr/ubuntu-packaging-guide/02-udd-introduction into lp:ubuntu-packaging-guide
- 02-udd-introduction
- Merge into trunk
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 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Barry Warsaw (community) | Approve | ||
Review via email: mp+68078@code.launchpad.net |
Commit message
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
Jonathan Riddell (jr) wrote : | # |
- 64. By Jonathan Riddell
-
add images
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
Jonathan Riddell (jr) wrote : | # |
Updated
- 67. By Jonathan Riddell
-
merge in trunk
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.
- 68. By Jonathan Riddell
-
simplify ensuring the version is up to date for new warnings built into bzr
Preview Diff
1 | === added file 'images/kdetoys-udd-branch.png' | |||
2 | 0 | Binary 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 | 0 | Binary 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 |
3 | === added file 'images/kdetoys-udd-diff.png' | |||
4 | 1 | Binary 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 | 1 | Binary 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 |
5 | === modified file 'index.rst' | |||
6 | --- index.rst 2011-07-22 15:08:17 +0000 | |||
7 | +++ index.rst 2011-07-25 09:48:39 +0000 | |||
8 | @@ -9,8 +9,14 @@ | |||
9 | 9 | The guide is split up into two sections: | 9 | The guide is split up into two sections: |
10 | 10 | 10 | ||
11 | 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. |
14 | 12 | * A set of articles that dig deeper into specific bits of our tools | 12 | * A set of knowledge-base articles that dig deeper |
15 | 13 | and workflows. | 13 | into specific bits of our tools and workflows. |
16 | 14 | |||
17 | 15 | This guide focuses on the Ubuntu Distributed Development packaging method. | ||
18 | 16 | This is a new way of packaging which uses Distributed Revision Control | ||
19 | 17 | branches. It currently has some limitations which mean many teams in Ubuntu | ||
20 | 18 | use :doc:`traditional packaging</traditional-packaging>` methods. See the | ||
21 | 19 | :doc:`UDD Introduction</udd-intro>` page for an introduction to the differences. | ||
22 | 14 | 20 | ||
23 | 15 | Articles | 21 | Articles |
24 | 16 | -------- | 22 | -------- |
25 | @@ -20,6 +26,7 @@ | |||
26 | 20 | 26 | ||
27 | 21 | introduction-to-ubuntu-development | 27 | introduction-to-ubuntu-development |
28 | 22 | getting-set-up | 28 | getting-set-up |
29 | 29 | udd-intro | ||
30 | 23 | fixing-a-bug | 30 | fixing-a-bug |
31 | 24 | fixing-a-bug-security | 31 | fixing-a-bug-security |
32 | 25 | 32 | ||
33 | @@ -31,7 +38,7 @@ | |||
34 | 31 | 38 | ||
35 | 32 | debian-dir-overview | 39 | debian-dir-overview |
36 | 33 | testing | 40 | testing |
38 | 34 | udd-intro | 41 | udd-getting-the-source |
39 | 35 | udd-working | 42 | udd-working |
40 | 36 | udd-sponsorship | 43 | udd-sponsorship |
41 | 37 | udd-uploading | 44 | udd-uploading |
42 | @@ -39,6 +46,7 @@ | |||
43 | 39 | udd-merging | 46 | udd-merging |
44 | 40 | udd-patchsys | 47 | udd-patchsys |
45 | 41 | udd-newpackage | 48 | udd-newpackage |
46 | 49 | traditional-packaging | ||
47 | 42 | 50 | ||
48 | 43 | 51 | ||
49 | 44 | Indices and tables | 52 | Indices and tables |
50 | 45 | 53 | ||
51 | === added file 'traditional-packaging.rst' | |||
52 | --- traditional-packaging.rst 1970-01-01 00:00:00 +0000 | |||
53 | +++ traditional-packaging.rst 2011-07-25 09:48:39 +0000 | |||
54 | @@ -0,0 +1,5 @@ | |||
55 | 1 | ===================== | ||
56 | 2 | Traditional Packaging | ||
57 | 3 | ===================== | ||
58 | 4 | |||
59 | 5 | FIXME describe traditional packaging here | ||
60 | 0 | 6 | ||
61 | === added file 'udd-getting-the-source.rst' | |||
62 | --- udd-getting-the-source.rst 1970-01-01 00:00:00 +0000 | |||
63 | +++ udd-getting-the-source.rst 2011-07-25 09:48:39 +0000 | |||
64 | @@ -0,0 +1,142 @@ | |||
65 | 1 | ================== | ||
66 | 2 | Getting the Source | ||
67 | 3 | ================== | ||
68 | 4 | |||
69 | 5 | Source package URLs | ||
70 | 6 | =================== | ||
71 | 7 | |||
72 | 8 | Bazaar provides some very nice shortcuts for accessing Launchpad's source | ||
73 | 9 | branches of packages in both Ubuntu and Debian. | ||
74 | 10 | |||
75 | 11 | To refer to source branches use:: | ||
76 | 12 | |||
77 | 13 | ubuntu:package | ||
78 | 14 | |||
79 | 15 | where *package* refers to the package name you're interested in. This URL | ||
80 | 16 | refers to the package in the current development version of Ubuntu. To | ||
81 | 17 | refer to the branch of Tomboy in the development version, you would use:: | ||
82 | 18 | |||
83 | 19 | ubuntu:tomboy | ||
84 | 20 | |||
85 | 21 | To refer to the version of a source package in an older release of Ubuntu, | ||
86 | 22 | just prefix the package name with the release's code name. E.g. to refer to | ||
87 | 23 | Tomboy's source package in Maverick_ use:: | ||
88 | 24 | |||
89 | 25 | ubuntu:maverick/tomboy | ||
90 | 26 | |||
91 | 27 | Since they are unique, you can also abbreviate the distro-series name:: | ||
92 | 28 | |||
93 | 29 | ubuntu:m/tomboy | ||
94 | 30 | |||
95 | 31 | You can use a similar scheme to access the source branches in Debian, although | ||
96 | 32 | there are no shortcuts for the Debian distro-series names. To access the | ||
97 | 33 | Tomboy branch in the current development series for Debian use: | ||
98 | 34 | |||
99 | 35 | debianlp:tomboy | ||
100 | 36 | |||
101 | 37 | and to access Tomboy in Debian Lenny_ use:: | ||
102 | 38 | |||
103 | 39 | debianlp:lenny/tomboy | ||
104 | 40 | |||
105 | 41 | |||
106 | 42 | .. _`Bazaar`: http://bazaar.canonical.com/en/ | ||
107 | 43 | .. _`Intrepid`: https://wiki.ubuntu.com/IntrepidIbex | ||
108 | 44 | .. _Maverick: https://wiki.ubuntu.com/MaverickMeerkat | ||
109 | 45 | .. _Lenny: http://debian.org/releases/stable/ | ||
110 | 46 | |||
111 | 47 | |||
112 | 48 | Getting the source | ||
113 | 49 | ================== | ||
114 | 50 | |||
115 | 51 | Every source package in Ubuntu has an associated source branch on Launchpad. | ||
116 | 52 | These source branches are updated automatically by Launchpad, although the | ||
117 | 53 | process is not currently foolproof. | ||
118 | 54 | |||
119 | 55 | There are a couple of things that we do first in order to make the workflow | ||
120 | 56 | more efficient later. Once you are used to the process you will learn when it | ||
121 | 57 | makes sense to skip these steps. | ||
122 | 58 | |||
123 | 59 | |||
124 | 60 | .. _branching: | ||
125 | 61 | |||
126 | 62 | Creating a shared repository | ||
127 | 63 | ---------------------------- | ||
128 | 64 | |||
129 | 65 | You want to work on the Tomboy package in Natty, and you've verified | ||
130 | 66 | that the source package is named ``tomboy``. Before actually | ||
131 | 67 | branching the code for Tomboy, create a shared repository to hold the | ||
132 | 68 | branches for this package. The shared repository will make future | ||
133 | 69 | work much more efficient. | ||
134 | 70 | |||
135 | 71 | Do this using the `bzr init-repo` command, passing it the directory name we | ||
136 | 72 | would like to use:: | ||
137 | 73 | |||
138 | 74 | $ bzr init-repo tomboy | ||
139 | 75 | |||
140 | 76 | You will see that a `tomboy` directory is created in your current working | ||
141 | 77 | area. Change to this new directory for the rest of your work:: | ||
142 | 78 | |||
143 | 79 | $ cd tomboy | ||
144 | 80 | |||
145 | 81 | |||
146 | 82 | Getting the trunk branch | ||
147 | 83 | ------------------------ | ||
148 | 84 | |||
149 | 85 | We use the `bzr branch` command to create a local branch of the package. | ||
150 | 86 | We'll name the target directory `tomboy.dev` just to keep things easy to | ||
151 | 87 | remember:: | ||
152 | 88 | |||
153 | 89 | $ bzr branch ubuntu:tomboy tomboy.dev | ||
154 | 90 | |||
155 | 91 | The tomboy.dev directory represents the version of Tomboy in the development | ||
156 | 92 | version of Ubuntu, and you can always ``cd`` into this directory and do a `bzr | ||
157 | 93 | pull` to get any future updates. | ||
158 | 94 | |||
159 | 95 | .. _up-to-date: | ||
160 | 96 | |||
161 | 97 | Ensuring the version is up to date | ||
162 | 98 | ---------------------------------- | ||
163 | 99 | |||
164 | 100 | When 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:: | ||
165 | 101 | |||
166 | 102 | Packaging branch status: OUT-OF-DATE | ||
167 | 103 | |||
168 | 104 | Means the importer has failed. You can find out why on | ||
169 | 105 | http://package-import.ubuntu.com/status/ and `file a bug on the UDD | ||
170 | 106 | project`_ to get the issue resolved. | ||
171 | 107 | |||
172 | 108 | |||
173 | 109 | Getting a branch for a particular release | ||
174 | 110 | ----------------------------------------- | ||
175 | 111 | |||
176 | 112 | When you want to do something like a `stable release update`_ (SRU), or you | ||
177 | 113 | just want to examine the code in an old release, you'll want to grab the | ||
178 | 114 | branch corresponding to a particular Ubuntu release. For example, to get the | ||
179 | 115 | Tomboy package for Maverick do:: | ||
180 | 116 | |||
181 | 117 | $ bzr branch ubuntu:m/tomboy maverick | ||
182 | 118 | |||
183 | 119 | |||
184 | 120 | Importing a Debian source package | ||
185 | 121 | --------------------------------- | ||
186 | 122 | |||
187 | 123 | If the package you want to work on is available in Debian but not Ubuntu, it's | ||
188 | 124 | still easy to import the code to a local bzr branch for development. Let's | ||
189 | 125 | say you want to import the `newpackage` source package. We'll start by | ||
190 | 126 | creating a shared repository as normal, but we also have to create a working | ||
191 | 127 | tree to which the source package will be imported (remember to cd out of the | ||
192 | 128 | `tomboy` directory created above):: | ||
193 | 129 | |||
194 | 130 | $ bzr init-repo newpackage | ||
195 | 131 | $ cd newpackage | ||
196 | 132 | $ bzr init debian | ||
197 | 133 | $ cd debian | ||
198 | 134 | $ bzr import-dsc http://ftp.de.debian.org/debian/pool/main/n/newpackage/newpackage_1.0-1.dsc | ||
199 | 135 | |||
200 | 136 | As you can see, we just need to provide the remote location of the dsc file, | ||
201 | 137 | and Bazaar will do the rest. You've now got a Bazaar source branch. | ||
202 | 138 | |||
203 | 139 | |||
204 | 140 | .. _`status of the package importer`: http://package-import.ubuntu.com/status | ||
205 | 141 | .. _`file a bug on the UDD project`: https://bugs.launchpad.net/udd | ||
206 | 142 | .. _`stable release update`: https://wiki.ubuntu.com/StableReleaseUpdates | ||
207 | 0 | 143 | ||
208 | === modified file 'udd-intro.rst' | |||
209 | --- udd-intro.rst 2011-07-13 11:27:47 +0000 | |||
210 | +++ udd-intro.rst 2011-07-25 09:48:39 +0000 | |||
211 | @@ -1,202 +1,130 @@ | |||
212 | 1 | =================================================== | 1 | =================================================== |
214 | 2 | Ubuntu Distributed Development - Getting the Source | 2 | Ubuntu Distributed Development - Introduction |
215 | 3 | =================================================== | 3 | =================================================== |
216 | 4 | 4 | ||
218 | 5 | *Ubuntu Distributed Development* (UDD) is a technique for developing Ubuntu | 5 | This guide focuses on packaging using the *Ubuntu Distributed Development* (UDD) |
219 | 6 | method. | ||
220 | 7 | |||
221 | 8 | *Ubuntu Distributed Development* (UDD) is a new technique for developing Ubuntu | ||
222 | 6 | packages that uses tools, processes, and workflows similar to generic | 9 | packages that uses tools, processes, and workflows similar to generic |
223 | 7 | distributed version control system (DVCS) based software development. The | 10 | distributed version control system (DVCS) based software development. The |
224 | 8 | DVCS used for UDD is Bazaar_. | 11 | DVCS used for UDD is Bazaar_. |
225 | 9 | 12 | ||
228 | 10 | You should already be familiar with basic Bazaar usage and workflow. For an | 13 | Traditional Packaging Limitations |
229 | 11 | introduction to Bazaar see the `Bazaar Five Minute Tutorial | 14 | --------------------------------- |
230 | 15 | |||
231 | 16 | Traditionally Ubuntu packages have been kept in tar archive files. A | ||
232 | 17 | traditional source package is made up of the upstream source tar, a "debian" tar | ||
233 | 18 | (or compressed diff file for older packages) containing the packaging and a | ||
234 | 19 | .dsc meta-data file. To see a traditional package run:: | ||
235 | 20 | |||
236 | 21 | $ apt-get source kdetoys | ||
237 | 22 | |||
238 | 23 | This will download the upstream source ``kdetoys_4.6.5.orig.tar.bz2``, the | ||
239 | 24 | packaging ``kdetoys_4.6.5-0ubuntu1.debian.tar.gz`` and the meta-data | ||
240 | 25 | ``kdetoys_4.6.5-0ubuntu1~ppa1.dsc``. Assuming you have dpkg-dev installed it | ||
241 | 26 | will extract these and give you the source package. | ||
242 | 27 | |||
243 | 28 | Traditional packaging would edit these files and upload. However this gives | ||
244 | 29 | limited opportunity to collaborate with other developers, changes have to be | ||
245 | 30 | passed around as diff files with no central way to track them and two developers | ||
246 | 31 | can not make changes at the same time. So most teams have moved to putting | ||
247 | 32 | their packaging in a revision control system. This makes it easier for several | ||
248 | 33 | developers to work on a package together. However there is no direct | ||
249 | 34 | connection between the revision control system and the archive packages so the | ||
250 | 35 | two must be manually kept in sync. Since each team works in its own revision | ||
251 | 36 | control system a prospective developer must first work out where that is and | ||
252 | 37 | how to get the packaging before they can work on the package. | ||
253 | 38 | |||
254 | 39 | Ubuntu Distributed Development | ||
255 | 40 | ------------------------------ | ||
256 | 41 | |||
257 | 42 | With Ubuntu Distributed Development all packages in the Ubuntu (and Debian) | ||
258 | 43 | archive are automatically imported into Bazaar branches on our code hosting | ||
259 | 44 | site Launchpad. Changes can be made directly to these branches in | ||
260 | 45 | incremental steps and by anyone with commit access. Changes can also be made | ||
261 | 46 | in forked branched and merged back in with Merge Proposals when they are large | ||
262 | 47 | enough to need review or if they are by someone without direct commit access. | ||
263 | 48 | |||
264 | 49 | UDD branches are all in a standard location so doing a checkout is easy:: | ||
265 | 50 | |||
266 | 51 | $ bzr branch ubuntu:kdetoys | ||
267 | 52 | |||
268 | 53 | The merge history includes two separate branches, one for the upstream source | ||
269 | 54 | and one which adds the ``debian/`` packaging directory:: | ||
270 | 55 | |||
271 | 56 | $ cd kdetoys | ||
272 | 57 | $ bzr qlog | ||
273 | 58 | |||
274 | 59 | (This command uses *qbzr* for a GUI, run ``log`` instead of ``qlog`` for | ||
275 | 60 | console output.) | ||
276 | 61 | |||
277 | 62 | .. image:: images/kdetoys-udd-branch.png | ||
278 | 63 | |||
279 | 64 | This UDD branch of *kdetoys* shows the full packaging for each version | ||
280 | 65 | uploaded to Ubuntu with grey circles and the upstream source versions with | ||
281 | 66 | green circles. Versions are tagged with either the version in Ubuntu such as | ||
282 | 67 | ``4:4.2.29-0ubuntu1`` or for the upstream branch with the upstream version | ||
283 | 68 | ``upstream-4.2.96``. | ||
284 | 69 | |||
285 | 70 | Many Ubuntu packages are based on the packages in Debian, UDD also imports the | ||
286 | 71 | Debian package into our branches. In the *kdetoys* branch above the Debian | ||
287 | 72 | versions from *unstable* are from the merge with blue circles while those from | ||
288 | 73 | *Debian experimental* are from the merge with yellow circles. Debian | ||
289 | 74 | released are tagged with their version number e.g. ``4:4.2.2-1``. | ||
290 | 75 | |||
291 | 76 | So from a UDD branch you can see the complete history of changes to the package | ||
292 | 77 | and compare any two versions. For example, to see the changes between version | ||
293 | 78 | 4.2.2 in Debian and the 4.2.2 in Ubuntu use:: | ||
294 | 79 | |||
295 | 80 | $ bzr qdiff -r tag:4:4.2.2-1..tag:4:4.2.2-1ubuntu1 | ||
296 | 81 | |||
297 | 82 | (This command uses *qbzr* for a GUI, run ``diff`` instead of ``qdiff`` for | ||
298 | 83 | console output.) | ||
299 | 84 | |||
300 | 85 | .. image:: images/kdetoys-udd-diff.png | ||
301 | 86 | |||
302 | 87 | From this we can clearly see what has changed in Ubuntu compared to Debian, | ||
303 | 88 | very handy. | ||
304 | 89 | |||
305 | 90 | Bazaar | ||
306 | 91 | ------ | ||
307 | 92 | |||
308 | 93 | UDD branches use Bazaar, a distributed revision control system intended to be | ||
309 | 94 | easy to use for those familiar with popular systems such as Subversion while | ||
310 | 95 | offering the power of Git. | ||
311 | 96 | |||
312 | 97 | To do packaging with UDD you will need to know the basics of how to use | ||
313 | 98 | Bazaar to manage files. For an introduction to Bazaar see the `Bazaar Five | ||
314 | 99 | Minute Tutorial | ||
315 | 12 | <http://doc.bazaar.canonical.com/bzr.dev/en/mini-tutorial/index.html>`_ and the | 100 | <http://doc.bazaar.canonical.com/bzr.dev/en/mini-tutorial/index.html>`_ and the |
316 | 13 | `Bazaar Users Guide | 101 | `Bazaar Users Guide |
317 | 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>`_. |
318 | 15 | 103 | ||
502 | 16 | 104 | Limitations of UDD | |
503 | 17 | Source package URLs | 105 | ------------------ |
504 | 18 | =================== | 106 | |
505 | 19 | 107 | Ubuntu Distributed Development is a new method for working with Ubuntu | |
506 | 20 | Bazaar provides some very nice shortcuts for accessing Launchpad's source | 108 | packages. It currently has some notable limitations: |
507 | 21 | branches of packages in both Ubuntu and Debian. | 109 | |
508 | 22 | 110 | * Doing a full branch with history can take a lot of time and network | |
509 | 23 | To refer to source branches use:: | 111 | resources. You may find it quicker to do a lightweight checkout ``bzr |
510 | 24 | 112 | checkout --lightweight ubuntu:kdetoys`` but this will need a network access | |
511 | 25 | ubuntu:package | 113 | for any further bzr operations. |
512 | 26 | 114 | ||
513 | 27 | where *package* refers to the package name you're interested in. This URL | 115 | * Working with patches is fiddly. Patches can be seen as a branched revision |
514 | 28 | refers to the package in the current development version of Ubuntu. To | 116 | control system, so we end up with RCS on top of RCS. |
515 | 29 | refer to the branch of Tomboy in the development version, you would use:: | 117 | |
516 | 30 | 118 | * There is no way to build directly from branches. You need to create a source | |
517 | 31 | ubuntu:tomboy | 119 | package and upload that. |
518 | 32 | 120 | ||
519 | 33 | To 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 |
520 | 34 | just prefix the package name with the release's code name. E.g. to refer to | 122 | should check the `status of the package importer`_ before working on a branch. |
521 | 35 | Tomboy's source package in Maverick_ use:: | 123 | |
522 | 36 | 124 | All of the above are being worked on and UDD is expected to become the main way | |
523 | 37 | ubuntu:maverick/tomboy | 125 | to work on Ubuntu packages soon. However currently most teams within Ubuntu do |
524 | 38 | 126 | not yet work with UDD branches for their development. However because UDD | |
525 | 39 | Since they are unique, you can also abbreviate the distro-series name:: | 127 | branches are the same as the packages in the archive any team should be able to |
526 | 40 | 128 | accept merges against them. | |
344 | 41 | ubuntu:m/tomboy | ||
345 | 42 | |||
346 | 43 | You can use a similar scheme to access the source branches in Debian, although | ||
347 | 44 | there are no shortcuts for the Debian distro-series names. To access the | ||
348 | 45 | Tomboy branch in the current development series for Debian use: | ||
349 | 46 | |||
350 | 47 | debianlp:tomboy | ||
351 | 48 | |||
352 | 49 | and to access Tomboy in Debian Lenny_ use:: | ||
353 | 50 | |||
354 | 51 | debianlp:lenny/tomboy | ||
355 | 52 | |||
356 | 53 | |||
357 | 54 | .. _`Bazaar`: http://bazaar.canonical.com/en/ | ||
358 | 55 | .. _`Intrepid`: https://wiki.ubuntu.com/IntrepidIbex | ||
359 | 56 | .. _Maverick: https://wiki.ubuntu.com/MaverickMeerkat | ||
360 | 57 | .. _Lenny: http://debian.org/releases/stable/ | ||
361 | 58 | |||
362 | 59 | |||
363 | 60 | Getting the source | ||
364 | 61 | ================== | ||
365 | 62 | |||
366 | 63 | Every source package in Ubuntu has an associated source branch on Launchpad. | ||
367 | 64 | These source branches are updated automatically by Launchpad, although the | ||
368 | 65 | process is not currently foolproof. | ||
369 | 66 | |||
370 | 67 | There are a couple of things that we do first in order to make the workflow | ||
371 | 68 | more efficient later. Once you are used to the process you will learn when it | ||
372 | 69 | makes sense to skip these steps. | ||
373 | 70 | |||
374 | 71 | |||
375 | 72 | .. _up-to-date: | ||
376 | 73 | |||
377 | 74 | Ensure the source branch is up-to-date | ||
378 | 75 | -------------------------------------- | ||
379 | 76 | |||
380 | 77 | Once you've determined which source package to work on, you should ensure that | ||
381 | 78 | the source branch for that package on Launchpad is up-to-date. Some package | ||
382 | 79 | imports fail for various reasons, and the `status of the package importer`_ is | ||
383 | 80 | always available online. If the source branch for a package you want to work | ||
384 | 81 | on is out of sync, you'll have to use ``apt-get source`` until the import of | ||
385 | 82 | that package is fixed. | ||
386 | 83 | |||
387 | 84 | Let's say you want to fix a problem in Tomboy in Natty. First, find out the | ||
388 | 85 | latest binary package versions that are available:: | ||
389 | 86 | |||
390 | 87 | $ rmadison tomboy | grep natty | ||
391 | 88 | tomboy | 1.5.2-1ubuntu4 | natty | source, amd64, i386 | ||
392 | 89 | |||
393 | 90 | You've already seen how to :ref:`determine the source package corresponding to | ||
394 | 91 | this binary package <what-to-fix>`. For Tomboy, the binary and source | ||
395 | 92 | packages are both named ``tomboy``. | ||
396 | 93 | |||
397 | 94 | Whenever the package importer processes a new source package version, it adds | ||
398 | 95 | a Bazaar tag corresponding to that new version. You can use this tag to | ||
399 | 96 | ensure that the import is up-to-date. To find the tag of the last revision | ||
400 | 97 | committed by the package importer, do:: | ||
401 | 98 | |||
402 | 99 | $ bzr log ubuntu:tomboy | grep ^tags | head -n 1 | ||
403 | 100 | tags: 1.5.2-1ubuntu4 | ||
404 | 101 | |||
405 | 102 | By comparing the version number returned by ``rmadison`` and the tag added by | ||
406 | 103 | the package importer, we can see that the ``tomboy`` source package for Natty | ||
407 | 104 | is up-to-date. | ||
408 | 105 | |||
409 | 106 | Here's an example of a package that is out-of-date. Let's say you want to fix | ||
410 | 107 | a problem in the ``initscripts`` binary package. First find out the | ||
411 | 108 | latest binary package versions that are available:: | ||
412 | 109 | |||
413 | 110 | $ rmadison initscripts | tail -n 1 | ||
414 | 111 | initscripts | 2.87dsf-4ubuntu25 | oneiric | amd64, i386 | ||
415 | 112 | |||
416 | 113 | Then determine the source package corresponding to this binary package:: | ||
417 | 114 | |||
418 | 115 | $ apt-cache showsrc initscripts | grep ^Package: | ||
419 | 116 | Package: sysvinit | ||
420 | 117 | |||
421 | 118 | Find the latest tag added by the package importer:: | ||
422 | 119 | |||
423 | 120 | $ bzr log ubuntu:sysvinit | grep ^tags | head -n 1 | ||
424 | 121 | tags: 2.86.ds1-61ubuntu13 | ||
425 | 122 | |||
426 | 123 | Here we can see that ``2.86.ds1-61ubuntu13`` is older than | ||
427 | 124 | ``2.87dsf-4ubuntu19`` so the source package is out of date, and in fact we can | ||
428 | 125 | verify that by looking at the status package for the package at | ||
429 | 126 | http://package-import.ubuntu.com/status/sysvinit.html. | ||
430 | 127 | |||
431 | 128 | When you find such out-of-date packages, be sure to `file a bug on the UDD | ||
432 | 129 | project`_ to get the issue resolved. | ||
433 | 130 | |||
434 | 131 | A feature in progress is for a warning to be automatically printed when | ||
435 | 132 | branching an out of date import, this will make the above obsolete. | ||
436 | 133 | |||
437 | 134 | .. _branching: | ||
438 | 135 | |||
439 | 136 | Creating a shared repository | ||
440 | 137 | ---------------------------- | ||
441 | 138 | |||
442 | 139 | Okay, you want to work on the Tomboy package in Natty, and you've verified | ||
443 | 140 | that the source package is up-to-date. Before actually branching the code for | ||
444 | 141 | Tomboy, create a shared repository to hold the branches for this package. | ||
445 | 142 | The shared repository will make future work much more efficient. | ||
446 | 143 | |||
447 | 144 | Do this using the `bzr init-repo` command, passing it the directory name we | ||
448 | 145 | would like to use:: | ||
449 | 146 | |||
450 | 147 | $ bzr init-repo tomboy | ||
451 | 148 | |||
452 | 149 | You will see that a `tomboy` directory is created in your current working | ||
453 | 150 | area. Change to this new directory for the rest of your work:: | ||
454 | 151 | |||
455 | 152 | $ cd tomboy | ||
456 | 153 | |||
457 | 154 | |||
458 | 155 | Getting the trunk branch | ||
459 | 156 | ------------------------ | ||
460 | 157 | |||
461 | 158 | We use the `bzr branch` command to create a local branch of the package. | ||
462 | 159 | We'll name the target directory `tomboy.dev` just to keep things easy to | ||
463 | 160 | remember:: | ||
464 | 161 | |||
465 | 162 | $ bzr branch ubuntu:tomboy tomboy.dev | ||
466 | 163 | |||
467 | 164 | The tomboy.dev directory represents the version of Tomboy in the development | ||
468 | 165 | version of Ubuntu, and you can always ``cd`` into this directory and do a `bzr | ||
469 | 166 | pull` to get any future updates. | ||
470 | 167 | |||
471 | 168 | |||
472 | 169 | Getting a branch for a particular release | ||
473 | 170 | ----------------------------------------- | ||
474 | 171 | |||
475 | 172 | When you want to do something like a `stable release update`_ (SRU), or you | ||
476 | 173 | just want to examine the code in an old release, you'll want to grab the | ||
477 | 174 | branch corresponding to a particular Ubuntu release. For example, to get the | ||
478 | 175 | Tomboy package for Maverick do:: | ||
479 | 176 | |||
480 | 177 | $ bzr branch ubuntu:m/tomboy maverick | ||
481 | 178 | |||
482 | 179 | |||
483 | 180 | Importing a Debian source package | ||
484 | 181 | --------------------------------- | ||
485 | 182 | |||
486 | 183 | If the package you want to work on is available in Debian but not Ubuntu, it's | ||
487 | 184 | still easy to import the code to a local bzr branch for development. Let's | ||
488 | 185 | say you want to import the `newpackage` source package. We'll start by | ||
489 | 186 | creating a shared repository as normal, but we also have to create a working | ||
490 | 187 | tree to which the source package will be imported (remember to cd out of the | ||
491 | 188 | `tomboy` directory created above):: | ||
492 | 189 | |||
493 | 190 | $ bzr init-repo newpackage | ||
494 | 191 | $ cd newpackage | ||
495 | 192 | $ bzr init debian | ||
496 | 193 | $ cd debian | ||
497 | 194 | $ bzr import-dsc http://ftp.de.debian.org/debian/pool/main/n/newpackage/newpackage_1.0-1.dsc | ||
498 | 195 | |||
499 | 196 | As you can see, we just need to provide the remote location of the dsc file, | ||
500 | 197 | and Bazaar will do the rest. You've now got a Bazaar source branch. | ||
501 | 198 | |||
527 | 199 | 129 | ||
528 | 200 | .. _`status of the package importer`: http://package-import.ubuntu.com/status | 130 | .. _`status of the package importer`: http://package-import.ubuntu.com/status |
529 | 201 | .. _`file a bug on the UDD project`: https://bugs.launchpad.net/udd | ||
530 | 202 | .. _`stable release update`: https://wiki.ubuntu.com/StableReleaseUpdates |
Builds on https:/ /code.launchpad .net/~jr/ ubuntu- packaging- guide/fixes/ +merge/ 67951