Merge lp:~barry/udd/docs into lp:udd

Proposed by Barry Warsaw
Status: Rejected
Rejected by: John A Meinel
Proposed branch: lp:~barry/udd/docs
Merge into: lp:udd
Diff against target: 1428 lines (+1360/-0)
13 files modified
.bzrignore (+1/-0)
docs/Makefile (+130/-0)
docs/conf.py (+216/-0)
docs/getting.rst (+102/-0)
docs/index.rst (+59/-0)
docs/latest.rst (+46/-0)
docs/merging.rst (+113/-0)
docs/newpackage.rst (+171/-0)
docs/patchsys.rst (+188/-0)
docs/setup.rst (+48/-0)
docs/sponsorship.rst (+110/-0)
docs/uploading.rst (+117/-0)
docs/working.rst (+59/-0)
To merge this branch: bzr merge lp:~barry/udd/docs
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+45932@code.launchpad.net

Description of the change

This converts the wiki documentation to a reStructuredText document. I got tired of editing the wiki. I have not yet added /usr/share/doc/bzr-builddeb/user_manual but I intend to do that once this branch lands and is published.

I'm not positive this is the best place for this, but I couldn't think of anything better. Also, we'll need a web server some place to throw this onto.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

Sorry for not reviewing this earlier. I think there is something wrong which is causing us to not see the review request. Maybe the default reviewer is set to something we don't see?

I didn't actually review the content, since I'm pretty sure what you wanted was just to have this included as rest docs.

I'm wondering if this is the best branch to have the documentation in. I suppose it is *a* branch which deals with this code. I might have said "udd-docs" or some other project, but in the short term, this seems fine. I'd rather have it available somewhere than nowhere.

Then we just need to figure out how to get this deployed so people can actually browse it.

Is it as simple as running "make" on Jubany and having the output in the right place for "package-import.ubuntu.com" to show it?

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

On Jan 28, 2011, at 04:06 PM, John A Meinel wrote:

>I didn't actually review the content, since I'm pretty sure what you wanted
>was just to have this included as rest docs.

Yep. I want to get the documentation out of the wiki.

>I'm wondering if this is the best branch to have the documentation in. I
>suppose it is *a* branch which deals with this code. I might have said
>"udd-docs" or some other project, but in the short term, this seems fine. I'd
>rather have it available somewhere than nowhere.

I agree that this is not the best place for the docs. Since submitting this
mp, I've chatted with Daniel and I actually think it's better in the new
packaging guide he's putting together. I plan on moving the docs over to that
project (thankfully, also in reST :).

>Then we just need to figure out how to get this deployed so people can
>actually browse it.

I'm pretty sure Daniel is working on that for the packaging guide, so we
should get that for free once it's integrated there.

>Is it as simple as running "make" on Jubany and having the output in the
>right place for "package-import.ubuntu.com" to show it?

I have no idea! ;)

Revision history for this message
Max Bowsher (maxb) wrote :

Hi Barry,

Based on your earlier comment in this MP and recent email on the u-d-d mailing list, is it correct that these docs are now targeted at landing in lp:ubuntu-packaging-guide ?

If so, would it be accurate to mark this MP as superseded so that it no longer shows up on udd's +activereviews page?

Thanks,
Max.

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

Hi Max. Yep, you're correct, and in fact they *have* landed in upg, so I'll close this merge proposal.

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

Well, it doesn't look like I can. I can only set the mp status to WiP, Needs review, or Merged. I have abandoned the branch and invalid'd the bug, but I'll leave it up to you to dispose of this mp.

Unmerged revisions

389. By Barry Warsaw

new packages

388. By Barry Warsaw

Added patchsys

387. By Barry Warsaw

More wiki conversion

386. By Barry Warsaw

Latest

385. By Barry Warsaw

uploading.rst

384. By Barry Warsaw

More page conversions.

383. By Barry Warsaw

Convert getting.

382. By Barry Warsaw

Twiddle.

381. By Barry Warsaw

sphinx-quickstart

380. By Barry Warsaw

The start of some documentation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2010-02-18 20:26:19 +0000
+++ .bzrignore 2011-01-11 23:17:27 +0000
@@ -1,1 +1,2 @@
1./tags1./tags
2_build
23
=== added directory 'docs'
=== added file 'docs/Makefile'
--- docs/Makefile 1970-01-01 00:00:00 +0000
+++ docs/Makefile 2011-01-11 23:17:27 +0000
@@ -0,0 +1,130 @@
1# Makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line.
5SPHINXOPTS =
6SPHINXBUILD = sphinx-build
7PAPER =
8BUILDDIR = _build
9
10# Internal variables.
11PAPEROPT_a4 = -D latex_paper_size=a4
12PAPEROPT_letter = -D latex_paper_size=letter
13ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14
15.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
16
17help:
18 @echo "Please use \`make <target>' where <target> is one of"
19 @echo " html to make standalone HTML files"
20 @echo " dirhtml to make HTML files named index.html in directories"
21 @echo " singlehtml to make a single large HTML file"
22 @echo " pickle to make pickle files"
23 @echo " json to make JSON files"
24 @echo " htmlhelp to make HTML files and a HTML help project"
25 @echo " qthelp to make HTML files and a qthelp project"
26 @echo " devhelp to make HTML files and a Devhelp project"
27 @echo " epub to make an epub"
28 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
29 @echo " latexpdf to make LaTeX files and run them through pdflatex"
30 @echo " text to make text files"
31 @echo " man to make manual pages"
32 @echo " changes to make an overview of all changed/added/deprecated items"
33 @echo " linkcheck to check all external links for integrity"
34 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
35
36clean:
37 -rm -rf $(BUILDDIR)/*
38
39html:
40 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
41 @echo
42 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
43
44dirhtml:
45 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
46 @echo
47 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
48
49singlehtml:
50 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
51 @echo
52 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
53
54pickle:
55 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
56 @echo
57 @echo "Build finished; now you can process the pickle files."
58
59json:
60 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
61 @echo
62 @echo "Build finished; now you can process the JSON files."
63
64htmlhelp:
65 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
66 @echo
67 @echo "Build finished; now you can run HTML Help Workshop with the" \
68 ".hhp project file in $(BUILDDIR)/htmlhelp."
69
70qthelp:
71 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
72 @echo
73 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
74 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
75 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/udd.qhcp"
76 @echo "To view the help file:"
77 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/udd.qhc"
78
79devhelp:
80 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
81 @echo
82 @echo "Build finished."
83 @echo "To view the help file:"
84 @echo "# mkdir -p $$HOME/.local/share/devhelp/udd"
85 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/udd"
86 @echo "# devhelp"
87
88epub:
89 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
90 @echo
91 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
92
93latex:
94 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
95 @echo
96 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
97 @echo "Run \`make' in that directory to run these through (pdf)latex" \
98 "(use \`make latexpdf' here to do that automatically)."
99
100latexpdf:
101 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102 @echo "Running LaTeX files through pdflatex..."
103 make -C $(BUILDDIR)/latex all-pdf
104 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
105
106text:
107 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
108 @echo
109 @echo "Build finished. The text files are in $(BUILDDIR)/text."
110
111man:
112 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
113 @echo
114 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115
116changes:
117 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118 @echo
119 @echo "The overview file is in $(BUILDDIR)/changes."
120
121linkcheck:
122 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
123 @echo
124 @echo "Link check complete; look for any errors in the above output " \
125 "or in $(BUILDDIR)/linkcheck/output.txt."
126
127doctest:
128 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
129 @echo "Testing of doctests in the sources finished, look at the " \
130 "results in $(BUILDDIR)/doctest/output.txt."
0131
=== added directory 'docs/_static'
=== added directory 'docs/_templates'
=== added file 'docs/conf.py'
--- docs/conf.py 1970-01-01 00:00:00 +0000
+++ docs/conf.py 2011-01-11 23:17:27 +0000
@@ -0,0 +1,216 @@
1# -*- coding: utf-8 -*-
2#
3# udd documentation build configuration file, created by
4# sphinx-quickstart on Tue Jan 11 13:19:17 2011.
5#
6# This file is execfile()d with the current directory set to its containing dir.
7#
8# Note that not all possible configuration values are present in this
9# autogenerated file.
10#
11# All configuration values have a default; values that are commented out
12# serve to show the default.
13
14import sys, os
15
16# If extensions (or modules to document with autodoc) are in another directory,
17# add these directories to sys.path here. If the directory is relative to the
18# documentation root, use os.path.abspath to make it absolute, like shown here.
19#sys.path.insert(0, os.path.abspath('.'))
20
21# -- General configuration -----------------------------------------------------
22
23# If your documentation needs a minimal Sphinx version, state it here.
24#needs_sphinx = '1.0'
25
26# Add any Sphinx extension module names here, as strings. They can be extensions
27# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28extensions = []
29
30# Add any paths that contain templates here, relative to this directory.
31templates_path = ['_templates']
32
33# The suffix of source filenames.
34source_suffix = '.rst'
35
36# The encoding of source files.
37#source_encoding = 'utf-8-sig'
38
39# The master toctree document.
40master_doc = 'index'
41
42# General information about the project.
43project = u'udd'
44copyright = u'2011, Barry Warsaw'
45
46# The version info for the project you're documenting, acts as replacement for
47# |version| and |release|, also used in various other places throughout the
48# built documents.
49#
50# The short X.Y version.
51version = '1.0'
52# The full version, including alpha/beta/rc tags.
53release = '1.0'
54
55# The language for content autogenerated by Sphinx. Refer to documentation
56# for a list of supported languages.
57#language = None
58
59# There are two options for replacing |today|: either, you set today to some
60# non-false value, then it is used:
61#today = ''
62# Else, today_fmt is used as the format for a strftime call.
63#today_fmt = '%B %d, %Y'
64
65# List of patterns, relative to source directory, that match files and
66# directories to ignore when looking for source files.
67exclude_patterns = ['_build']
68
69# The reST default role (used for this markup: `text`) to use for all documents.
70#default_role = None
71
72# If true, '()' will be appended to :func: etc. cross-reference text.
73#add_function_parentheses = True
74
75# If true, the current module name will be prepended to all description
76# unit titles (such as .. function::).
77#add_module_names = True
78
79# If true, sectionauthor and moduleauthor directives will be shown in the
80# output. They are ignored by default.
81#show_authors = False
82
83# The name of the Pygments (syntax highlighting) style to use.
84pygments_style = 'sphinx'
85
86# A list of ignored prefixes for module index sorting.
87#modindex_common_prefix = []
88
89
90# -- Options for HTML output ---------------------------------------------------
91
92# The theme to use for HTML and HTML Help pages. See the documentation for
93# a list of builtin themes.
94html_theme = 'default'
95
96# Theme options are theme-specific and customize the look and feel of a theme
97# further. For a list of options available for each theme, see the
98# documentation.
99#html_theme_options = {}
100
101# Add any paths that contain custom themes here, relative to this directory.
102#html_theme_path = []
103
104# The name for this set of Sphinx documents. If None, it defaults to
105# "<project> v<release> documentation".
106#html_title = None
107
108# A shorter title for the navigation bar. Default is the same as html_title.
109#html_short_title = None
110
111# The name of an image file (relative to this directory) to place at the top
112# of the sidebar.
113#html_logo = None
114
115# The name of an image file (within the static path) to use as favicon of the
116# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
117# pixels large.
118#html_favicon = None
119
120# Add any paths that contain custom static files (such as style sheets) here,
121# relative to this directory. They are copied after the builtin static files,
122# so a file named "default.css" will overwrite the builtin "default.css".
123html_static_path = ['_static']
124
125# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
126# using the given strftime format.
127#html_last_updated_fmt = '%b %d, %Y'
128
129# If true, SmartyPants will be used to convert quotes and dashes to
130# typographically correct entities.
131#html_use_smartypants = True
132
133# Custom sidebar templates, maps document names to template names.
134#html_sidebars = {}
135
136# Additional templates that should be rendered to pages, maps page names to
137# template names.
138#html_additional_pages = {}
139
140# If false, no module index is generated.
141#html_domain_indices = True
142
143# If false, no index is generated.
144#html_use_index = True
145
146# If true, the index is split into individual pages for each letter.
147#html_split_index = False
148
149# If true, links to the reST sources are added to the pages.
150#html_show_sourcelink = True
151
152# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
153#html_show_sphinx = True
154
155# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
156#html_show_copyright = True
157
158# If true, an OpenSearch description file will be output, and all pages will
159# contain a <link> tag referring to it. The value of this option must be the
160# base URL from which the finished HTML is served.
161#html_use_opensearch = ''
162
163# This is the file name suffix for HTML files (e.g. ".xhtml").
164#html_file_suffix = None
165
166# Output file base name for HTML help builder.
167htmlhelp_basename = 'udddoc'
168
169
170# -- Options for LaTeX output --------------------------------------------------
171
172# The paper size ('letter' or 'a4').
173#latex_paper_size = 'letter'
174
175# The font size ('10pt', '11pt' or '12pt').
176#latex_font_size = '10pt'
177
178# Grouping the document tree into LaTeX files. List of tuples
179# (source start file, target name, title, author, documentclass [howto/manual]).
180latex_documents = [
181 ('index', 'udd.tex', u'udd Documentation',
182 u'Barry Warsaw', 'manual'),
183]
184
185# The name of an image file (relative to this directory) to place at the top of
186# the title page.
187#latex_logo = None
188
189# For "manual" documents, if this is true, then toplevel headings are parts,
190# not chapters.
191#latex_use_parts = False
192
193# If true, show page references after internal links.
194#latex_show_pagerefs = False
195
196# If true, show URL addresses after external links.
197#latex_show_urls = False
198
199# Additional stuff for the LaTeX preamble.
200#latex_preamble = ''
201
202# Documents to append as an appendix to all manuals.
203#latex_appendices = []
204
205# If false, no module index is generated.
206#latex_domain_indices = True
207
208
209# -- Options for manual page output --------------------------------------------
210
211# One entry per manual page. List of tuples
212# (source start file, name, description, authors, manual section).
213man_pages = [
214 ('index', 'udd', u'udd Documentation',
215 [u'Barry Warsaw'], 1)
216]
0217
=== added file 'docs/getting.rst'
--- docs/getting.rst 1970-01-01 00:00:00 +0000
+++ docs/getting.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,102 @@
1==================
2Getting the source
3==================
4
5Every source package in Ubuntu has an associated source branch on Launchpad.
6These source branches are updated automatically by Launchpad, however if you
7notice any version skew (e.g. version 1.7 is available as a source package but
8only 1.5 as a source branch), see the `importer status page`_ for possible
9failures.
10
11If your source package is not yet available in Ubuntu, but it is available in
12Debian, see below for importing the Debian source package into a local Bazaar
13branch.
14
15Either way, if you want to work on a source package in bzr then you should
16create a shared repository on your machine in order to make future operations
17more efficient. Once you have that then you can checkout branches in to it.
18
19There are a couple of things that we do first in order to make things more
20efficient later. Once you are used to the process you will learn when it makes
21sense to skip these steps.
22
23
24Creating a shared repository
25============================
26
27Say we want to work on the `foobar` source package. We first create a shared
28repository to hold our branches for this package.
29
30We do this using the `bzr init-repo` command, passing it the directory name we
31would like to use::
32
33 $ bzr init-repo foobar
34
35You will see that a `foobar` directory is created in your current working
36area. Now we need to change to this new directory for the rest of our work::
37
38 $ cd foobar
39
40
41Getting the trunk branch
42========================
43
44We use the `bzr branch` command to create a local branch of the package, and
45the `ubuntu:` directory service (URL prefix) so that we can specify a shorter
46URL::
47
48 $ bzr branch ubuntu:foobar
49
50You will need at least bzr 2.3 to utilize the `ubuntu:` prefix, otherwise
51you'll use the `lp:` prefix for slightly longer URLs::
52
53 $ bzr branch lp:ubuntu/foobar
54
55This will create a branch in the new `foobar` directory. It will contain the
56contents of the source package for the current Ubuntu development release
57(also called a *distroseries*). If you prefer to name the resulting directory
58after the current distroseries, do something like::
59
60 $ bzr branch ubuntu:foobar natty
61
62This puts the branch for the `foobar` package in Natty_ into the `natty`
63directory.
64
65
66Getting a branch for a particular release
67=========================================
68
69When you want to do something like a `stable release update`_ (SRU), or you
70just want to examine the code in an old release, you may want to grab the
71branch corresponding to a particular pocket in a particular Ubuntu release.
72All package versions in all distroseries are exposed on Launchpad and
73available through both the `ubuntu:` and `lp:` directory services. For
74example, to get the `foobar` package for Maverick *one* of the following:
75
76 $ bzr branch ubuntu:m/foobar maverick
77 $ bzr branch ubuntu:maverick/foobar maverick
78 $ bzr branch lp:ubuntu/maverick/foobar maverick
79
80
81Importing a Debian source package
82=================================
83
84If the package you want to work on is available in Debian but not Ubuntu, it's
85still easy to import the code to a local bzr branch for development. Let's
86say you want to import the `newpackage` source package. We'll start by
87creating a shared repository as normal, but we also have to create a working
88tree to which the source package will be imported::
89
90 $ bzr init-repo newpackage
91 $ cd new-package
92 $ bzr init debian
93 $ cd debian
94 $ bzr import-dsc http://ftp.de.debian.org/debian/pool/main/n/newpackage/newpackage_1.0-1.dsc
95
96As you can see, we just need to provide the remote location of the dsc file,
97and bzr will do the rest. You've now got a bzr source branch.
98
99.. _`importer status page`: http://package-import.ubuntu.com/status
100.. _Natty: https://wiki.ubuntu.com/NattyNarwhal
101.. _`stable release update`: https://wiki.ubuntu.com/StableReleaseUpdates
102.. _Maverick: https://wiki.ubuntu.com/MaverickMeerkat
0103
=== added file 'docs/index.rst'
--- docs/index.rst 1970-01-01 00:00:00 +0000
+++ docs/index.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,59 @@
1==============================
2Ubuntu Distributed Development
3==============================
4
5*Ubuntu Distributed Development* (UDD) is a technique for developing Ubuntu
6 packages that uses tools, processes, and workflows similar to generic
7 distributed version control system-based software development. The dVCS used
8 for UDD is Bazaar_.
9
10UDD is an ongoing effort. This means that some things will not yet be
11documented, and some things that are documented will not yet work. Volunteers
12to help move this forward are of course, welcome.
13
14This document contains a series of task-oriented guides for helping you with
15common tasks. Intrepid_ or later is currently required for these instructions
16to work.
17
18
19Related information
20===================
21
22The UDD project has a `presence on the Ubuntu wiki`_ which contains a
23(probably out-of-sync) copy of this documentation, links to the bug tracker
24and `project page on Launchpad`_, as well as links and minutes of public
25meetings.
26
27Once the relevant packages are installed, you might also find useful
28information in `/usr/share/doc/bzr-builddeb/usr_manual/`.
29
30
31Table of Contents
32=================
33
34.. toctree::
35 :glob:
36
37 setup
38 getting
39 working
40 sponsorship
41 uploading
42 latest
43 merging
44 patchsys
45 newpackage
46
47
48Indices and tables
49==================
50
51* :ref:`genindex`
52* :ref:`modindex`
53* :ref:`search`
54
55
56.. _`Bazaar`: http://bazaar.canonical.com/en/
57.. _`Intrepid`: https://wiki.ubuntu.com/IntrepidIbex
58.. _`presence on the Ubuntu wiki`: https://wiki.ubuntu.com/DistributedDevelopment
59.. _`project page on Launchpad`: http://launchpad.net/udd
060
=== added file 'docs/latest.rst'
--- docs/latest.rst 1970-01-01 00:00:00 +0000
+++ docs/latest.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,46 @@
1==================
2Getting The Latest
3==================
4
5If someone else has landed changes on a package, you will want to pull down
6those changes in your own copies of the package branches.
7
8
9Updating your main branch
10=========================
11
12Updating your copy of a branch that corresponds to the package in a particular
13release is very simple, simply use `bzr pull` from the appropriate directory::
14
15 $ cd foobar/natty
16 $ bzr pull
17
18This works wherever you have a checkout of a branch, so it will work for
19things like branches of `maverick`, `hardy-proposed`, etc.
20
21
22Getting the latest in to your working branches
23==============================================
24
25Once you have updated your copy of a distroseries branch, then you may want to
26merge this in to your working branches as well, so that they are based on the
27latest code.
28
29You don't have to do this all the time though. You can work on slightly older
30code with no problems. The disadvantage would come if you were working on
31some code that someone else changed. If you are not working on the latest
32version then your changes may not be correct, and may even produce conflicts.
33
34The merge does have to be done at some point though. The longer it is left,
35the harder may be, so doing it regularly should keep each merge simple. Even
36if there are many merges the total effort would hopefully be less.
37
38To merge the changes you just need to use `bzr merge-package`, but you must
39have committed your current work first.
40
41 $ cd foobar/bug-12345
42 $ bzr merge-package ../natty
43
44Any conflicts will be reported, and you can fix them up. To review the
45changes that you just merged use `bzr diff`. To undo the merge use `bzr
46revert`. Once you are happy with the changes then use `bzr commit`.
047
=== added file 'docs/merging.rst'
--- docs/merging.rst 1970-01-01 00:00:00 +0000
+++ docs/merging.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,113 @@
1=======
2Merging
3=======
4
5Merging is one of the strengths of Bazaar, and something we do often in Ubuntu
6development. Updates can be merged from Debian, from a new upstream release,
7and from other Ubuntu developers.
8
9Doing it in bzr is pretty simple, and all based around the `bzr merge-package`
10command.
11
12The first thing to do is to check that the `package importer`_ hasn't failed
13for the package you're going to work on.
14
15When you are in any branch's working directory then you can merge from
16another. First check you have no uncommitted changes::
17
18 $ bzr status
19
20If that reports anything then you will either have to commit the changes,
21revert them, or shelve them to come back to later.
22
23
24Merging from Debian
25===================
26
27Next run `bzr merge-package` passing the URI of the branch to merge from. For
28instance, to merge from the version of the package in Debian Squeeze_ run::
29
30 $ bzr merge-package lp:debian/squeeze/foobar
31
32This will merge the changes since the last merge point and leave you with
33changes to review. This may cause some conflicts. You can see all that
34happened by running::
35
36 $ bzr status
37 $ bzr diff
38
39If conflicts are reported then you need to edit those files to make them look
40how they should, removing the *conflict markers*. Once you have done, run::
41
42 $ bzr resolve
43 $ bzr conflicts
44
45This will resolve any conflicted files that you fixed, and then tell you what
46else you have to deal with.
47
48Once any conflicts are resolved, and you have made any other changes that you
49need, you will add a new changelog entry, and commit::
50
51 $ dch -i
52 $ bzr commit
53
54as described earlier.
55
56However, before you commit, it is always a good thing to check all the Ubuntu
57changes by running::
58
59 $ bzr diff -r tag:0.6.10-5
60
61which will show the diff between the new Debian (0.6.10-5) and Ubuntu versions
62(0.6.10-5ubuntu1). In similar way you can compare to any other versions. To
63see all available version run::
64
65 $ bzr tags
66
67After testing and committing the merge, you will need to seek sponsorship or
68upload to the archive in the normal way.
69
70
71Merging a new upstream version
72==============================
73
74When upstream releases a new version (or you want to package a snapshot) then
75you have to merge a tarball into your branch.
76
77This is done using the `bzr merge-upstream` command. From inside the branch
78that you want to merge to you run something like::
79
80 $ bzr merge-upstream --version 1.2 http://example.org/releases/foobar-1.2.tar.gz
81
82This will download that tarball and merge it in to your branch, automatically
83adding a `debian/changelog` entry for you.
84
85The `--version` option is used to specify the upstream version that is being
86merged in, as the command isn't able to infer that yet.
87
88The last parameter is the location of the tarball that you are upgrading to;
89this can either be a local filesystem path, or a http, ftp, sftp, etc. URI as
90shown. The command will automatically download the tarball for you. If you
91point to a `.tar.bz2` or similar tarball then it will recompress it as needed,
92or convert it if you pass it a `.zip` or similar. If your package is v3
93(quilt) format and so can support `.tar.bz2` upstream tarballs then pass a
94`--v3` option to prevent the repacking (this should be `automatically
95detected`_).
96
97The `merge-upstream` command will either tell you that it completed
98successfully, or that there were conflicts. Either way you will be able to
99review the changes before committing as normal.
100
101If you are merging an upstream release into an existing bzr branch that has
102not previously used the UDD layout, `bzr merge-upstream` will fail with an
103error that the tag for the previous upstream version is not available; the
104merge can't be completed without knowing what base version to merge against.
105To work around this, create a tag in your existing existing repo for the last
106upstream version present there; e.g., if the last Ubuntu release was
107*1.1-0ubuntu3*, create the tag *upstream-1.1* pointing to the bzr revision you
108want to use as the tip of the upstream branch.
109
110
111.. _`package importer`: http://package-import.ubuntu.com/status/
112.. _Squeeze: http://wiki.debian.org/DebianSqueeze
113.. _`automatically detected`: https://bugs.edge.launchpad.net/bzr-builddeb/+bug/627718
0114
=== added file 'docs/newpackage.rst'
--- docs/newpackage.rst 1970-01-01 00:00:00 +0000
+++ docs/newpackage.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,171 @@
1======================
2Building a new package
3======================
4
5Let's say I have an upstream project that is not yet available for Ubuntu. I
6want to create a package from this project and make it available as a PPA_ so
7that other people can more easily use the code. This also makes a good first
8step in contributing your package to universe_.
9
10
11Example package
12===============
13
14I started with a Python library called `flufl.enum`_, which is a fairly
15typical setuptools-based Python package. Fortunately, it's also maintained in
16Launchpad using Bazaar, so that makes bootstrapping much easier. (TBD: add
17instructions for using other upstream VCSs.)
18
19Because we want to package the trunk branch, getting started is pretty
20simple::
21
22 $ bzr init-repo flufl.enum
23 $ cd flufl.enum
24 $ bzr branch lp:flufl.enum trunk
25 $ bzr branch trunk debianize
26 $ cd debianize
27
28
29Bootstrapping
30=============
31
32You need to get the initial ``debian`` directory created somehow, along with
33all the expected files inside that. There are many ways to bootstrap that,
34and hopefully there will eventually be `some convergence`_ in the methods,
35especially if you're building standard Python setuptools-based libraries and
36applications.
37
38
39The bzr-builddeb way
40--------------------
41
42You could of course just use `dh_make(8)` to get things going, or you could
43use `bzr dh-make`. The latter might provide some benefits, and can be run
44like so from inside your branch::
45
46 $ bzr dh-make PKGNAME VERSION DOWNLOADURL
47 $ bzr add debian
48
49If you don't have a URL to download a tarball from, you'll need to create the
50tarball locally first. Use ``bzr dh-make --help`` for details on this command.
51
52After you've created the ``debian`` directory template, be sure to ``bzr rm``
53any ``debian`` files you don't need (e.g. the ``*.ex`` files), and edit files
54such as ``debian/control``, ``debian/watch``, ``debian/copyright`` and
55``debian/changelog``. The following section may give you some hints about
56that.
57
58
59The stdeb way
60-------------
61
62Another way I've found useful for initializing the ``debian`` directory for
63Python setuptools-based packages, is to use the stdeb_ package. The full
64documentation for this package is available on the `upstream home`_, but you
65won't need all of the commands. stdeb has a command that is *exactly* what
66we're looking for!
67
68In either case, start by putting this in your ``~/.pydistutils.cfg`` file::
69
70 [global]
71 command.packages:stdeb.command
72
73
74Modern stdeb
75~~~~~~~~~~~~
76
77Here's how easy it is::
78
79 $ python setup.py debianize
80 $ bzr add debian
81 $ bzr commit -m'Debianize'
82
83
84We also need a ``debian/copyright`` file. Normally, we'd use ``dh_make -c``
85for that but again, that doesn't play nicely with UDD. ``dh_make`` expects a
86particular file system layout that we don't have. No matter, we'll add the
87copyright file manually::
88
89 $ cp /usr/share/debhelper/dh_make/licenses/lgpl3 debian/copyright
90 $ edit debian/copyright
91 $ bzr add debian/copyright
92 $ bzr commit -m'Added copyright file'
93
94
95stdeb <= 0.5.1
96~~~~~~~~~~~~~~
97
98If you have an older version of stdeb, use this command to create the basic
99``debian/`` directory layout::
100
101 $ python setup.py sdist_dsc
102
103This command leaves you with a ``deb_dist`` directory containing a
104``flufl.enum_3.0.1`` directory. Inside that is your ``debian/`` directory.
105Because we're using UDD we don't care about anything else that ``sdist_dsc``
106produces, so we can shuffle things around and remove the cruft.
107
108 $ mv deb_dist/munepy-2.0.1/debian .
109 $ rm -rf deb_dist
110 $ bzr add debian
111 $ bzr commit -m'Add debian directory'
112
113
114pkgme
115-----
116
117pkgme_ is a new tool that makes it easy to Debianize a new package. TBD:
118describe how to use it.
119
120
121debian/control file
122===================
123
124You probably want to edit the ``debian/control`` file at this point, adding
125any information that's missing, or fixing incorrect default information. For
126example, I needed to modify the ``Maintainer`` and ``Description`` fields, and
127add ``XS-Python-Version`` and ``Homepage`` fields.
128
129Now we want to build the source package. The easiest way to do that is with
130the ``bzr-builddeb`` plugin, however this requires a valid ``debian/watch``
131file so that builddeb can find the upstream tarball. This really should match
132the version of the checkout you've made.
133
134
135debian/watch file
136=================
137
138Here for example is the ``debian/watch`` file I'm using::
139
140 version=3
141 http://pypi.python.org/packages/source/f/flufl.enum/flufl.enum-(.*).tar.gz
142
143If your tarballs live on Launchpad, the ``debian/watch`` file is a little more
144complicated (see `Question 21146`_ and `Bug 231797`_ for why this is). In
145that case, use something like::
146
147 version=3
148 https://launchpad.net/flufl.enum/+download http://launchpad.net/flufl.enum/.*/flufl.enum-(.+).tar.gz
149
150So, then it's a matter of...::
151
152 $ bzr add debian/watch
153 $ bzr commit -m'added debian/watch file'
154
155
156Building the source package
157===========================
158
159Now we can build the source package and publish the package as we normally
160would, with ``bzr bd -S`` and ``dput``.
161
162
163.. _PPA: https://help.launchpad.net/Packaging/PPA
164.. _universe: https://wiki.ubuntu.com/MOTU/GettingStarted
165.. _`flufl.enum`: http://launchpad.net/flufl.enum
166.. _`some convergence`: http://launchpad.net/bugs/545361
167.. _stdeb: http://packages.ubuntu.com/lucid/python-stdeb
168.. _`upstream home`: http://github.com/astraw/stdeb#the-commands
169.. _pkgme: https://launchpad.net/pkgme
170.. _`Question 21146`: https://answers.launchpad.net/launchpad/+question/21146
171.. _`Bug 231797`: https://launchpad.net/bugs/231797
0172
=== added file 'docs/patchsys.rst'
--- docs/patchsys.rst 1970-01-01 00:00:00 +0000
+++ docs/patchsys.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,188 @@
1===========================
2Working with a patch system
3===========================
4
5Many existing packages that have changes from upstream express those changes
6using a `patch system`_, of which there are several to choose from. Usually,
7when you make an additional change to a package, you'll want to add a patch
8file to the patch system being used, rather than editing the source code in
9place. Note however that it is considered bad practice to add a patch system
10to a package that does not already have one. In that case, either coordinate
11with the Debian maintainer, or edit the files in place. You can find out if
12your package has a patch system by using the ``what-patch`` command (from the
13``ubuntu-dev-tools`` package).
14
15Although UDD, and in particular `Bazaar looms`_ makes it pretty easy to keep
16individual patches separated, if you're submitting changes to be uploaded,
17you're currently better off playing along with the package's patch system.
18*You will want at least bzr loom version 2.2.1dev, otherwise you'll have
19problems pushing and pulling your threads to Launchpad.* Do ``bzr plugins`` to
20find the version you're using.
21
22Here are some guidelines that I've found helpful. Clearly the existing tools
23can be improved, but for now this seems to work well enough. This assumes
24you're using looms to develop your patch, and that the package itself uses the
25quilt_ patch system.
26
27One important thing to know: all source branches reflect the tree after a
28``quilt push -a``. In other words, when you branch a source branch, you get
29the tree with all patches applied, ready for you to jump right into hacking.
30You do not need to ``quilt push -a`` manually, and in fact, you'll get a tree
31with lots of distracting modifications if you push or pop all the changes. Or
32to put it another way, once you have a branch, jump right in!
33
34
35Develop your patch
36==================
37
38Start as you normally would with UDD and looms::
39
40 $ bzr init-repo foobar
41 $ cd foobar
42 $ bzr branch ubuntu:foobar (or lp:ubuntu/foobar)
43 $ bzr branch foobar myfix
44 $ cd myfix
45 $ bzr loomify --base trunk
46 $ bzr create-thread sourcefix
47
48Now that you are in the ``sourcefix`` thread, just edit the source code,
49making whatever changes you need to fix the bug. Don't worry about the patch
50system at this point, at least until you are happy with your changes. If
51someone else pushes changes to the package while you're working on it, just
52``bzr down-thread`` to ``trunk``, pull the updates, and ``bzr up-thread
53--auto`` back to the ``sourcefix`` thread, resolving any conflicts along the
54way. You can periodically commit your changes, ``bzr record`` and push them
55to Launchpad as you go, of course linking your branch to the bug in Launchpad.
56So far, it's just normal development with looms.
57
58Once you're happy with your changes, you need to essentially import your
59thread's changes into a quilt patch. This is fairly easy to do::
60
61 $ bzr create-thread quiltfix
62 $ bzr diff -rthread:trunk..thread:sourcefix | quilt import -p0 -P myfix /dev/stdin
63 $ bzr add debian/patches/myfix
64 $ quilt push
65 $ quilt pop
66 $ bzr commit
67
68Why the last push/pop before the commit? The push gets the imported changes
69into the quilt patch, but also leaves the tree modified, so you'll essentially
70have the changes both in the ``debian/`` directory and in the tree. The pop
71undoes the tree changes (which are also available in the ``sourcefix``
72thread), but leaves the quilt change available. A ``bzr commit`` at this
73point gives you a thread with just the changes to ``debian/``.
74
75
76Problems
77========
78
79The problem comes when you want to modify the patch, e.g.::
80
81 $ bzr down-thread
82 <hack, commit>
83
84This does *not* work well::
85
86 $ bzr up-thread
87
88You'd expect at this point to be able to ``quilt fold`` your new changes to
89update your ``myfix`` quilt patch, but in fact, this doesn't work. You can
90end up with difficult to resolve conflicts, patch failures and rejections. My
91recommendation is that when you make changes to your ``sourcefix`` thread,
92blow away your ``quiltfix`` thread and regenerate it. Looms make this easy::
93
94 $ bzr up-thread
95 $ bzr revert
96 $ bzr combine-thread --force (throws away your quiltfix changes)
97 $ bzr create-thread quiltfix
98 $ bzr diff -rthread:trunk..thread:sourcefix | quilt import -p0 -P myfix /dev/stdin
99 etc...
100
101So you've thrown away the ``quiltfix`` thread, and recreated it, with your
102updated ``sourcefix`` changes.
103
104
105Gotchas
106=======
107
108One thing to keep in mind is that quilt uses a hidden ``.pc`` directory to
109record its status. This directory is under version control in all source
110branches. *Watch out* for changes to the ``.pc`` directory that are unrelated
111(or more accurately, uninteresting) to your patch. This can happen because
112the UDD source branch importer `currently includes any existing .pc
113directory`_ in the imported branch. This can cause conflicts, or other
114unwanted or unknown changes because you've essentially got two conflicting
115version control systems competing for the same thing (i.e. bzr and quilt3).
116For now, the best recommendation is to revert any changes to the ``.pc``
117directory in your branch.
118
119
120Publishing your changes
121=======================
122
123It's actually easier at this point to generate a diff for attaching to the bug
124report. Just::
125
126 $ bzr up-thread -auto
127 $ bzr diff -rthread: > mypatch.diff
128
129The differences between the ``quiltfix`` thread and the ``sourcefix`` thread
130are the interesting bits, and totally appropriate for committing and upload.
131Because of the way looms interacts with Launchpad, you can still link your
132branch to the bug and request a merge proposal, but understand that the diff
133will include all changes between ``quiltfix`` (top) and ``trunk`` (bottom)
134threads. So the merge proposal will include the changes in the ``debian/``
135directory, *and* the changes in the source tree. As long as you and your
136reviewer understands this, you should be okay, but it can be confusing at
137first.
138
139If you need a sponsor to merge and upload your changes, one thing they *do
140not* want to do is::
141
142 $ bzr branch ubuntu:foobar
143 $ cd foobar
144 $ bzr merge lp:~you/ubuntu/natty/foobar/yourfix
145
146Much badness (in the form of infinite *maximum recursion depth* exceptions)
147ensues. Yes, we need to file a bug on that.
148
149
150edit-patch
151==========
152
153``edit-patch`` is a nice little wrapper script that comes as part of the
154``ubuntu-dev-tools`` package. It pretty much hides the nasty details of
155dealing with the patch system specifically. For example, while the above
156works well if your package is using quilt already, you'll have to adjust the
157workflow, perhaps significantly, to work with `a different patch system`_. In
158theory ``edit-patch`` should solve this, but there are currently two blockers.
159
160 * By default, ``bzr diff`` produces a ``-p0`` patch, but ``edit-patch``
161 defers to the underlying patch system's default. For quilt, this is
162 ``-p1``. ``quilt import`` takes a ``-p`` argument to specify the prefix
163 level, but this isn't yet exposed in ``edit-patch``. If you're
164 adventurous, try changing the ``bzr diff`` command above to specify the
165 proper prefixes using its ``-p`` option.
166 * By default, ``edit-patch`` requires a path to an existing patch file, but
167 it's more convenient to pipe the output of ``bzr diff`` to the stdin of
168 ``edit-patch``, as shown above. The alternative would be to save the diff
169 in a temporary file, and then point ``edit-patch`` to this temporary file.
170
171
172Future
173======
174
175Ideally, it would be nice to add a ``bzr edit-patch`` or some such command
176which does the whole loom -> patch system import. At least ``edit-patch``
177could grow a ``-p`` and ``-P`` option, as well as read from stdin. Stay
178tuned, or get involved!
179
180There's now `a bug` that tracks this.
181
182
183.. _`patch system`: https://wiki.ubuntu.com/DistributedDevelopment/Documentation/PatchSystem/PackagingGuide/PatchSystems
184.. _`Bazaar looms`: https://launchpad.net/bzr-loom
185.. _quilt: http://www.wzdftpd.net/blog/index.php?2008/02/05/3-quilt-a-patch-management-system-how-to-survive-with-many-patches
186.. _`currently includes any existing .pc directory`: https://bugs.launchpad.net/udd/+bug/672740
187.. _`a different patch system`: http://wiki.debian.org/debian/patches
188.. _`a bug`: https://launchpad.net/bugs/620721
0189
=== added file 'docs/setup.rst'
--- docs/setup.rst 1970-01-01 00:00:00 +0000
+++ docs/setup.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,48 @@
1==========
2Setting up
3==========
4
5
6Installing Packages
7===================
8
9You will first need to install packages to make the tools available to you.
10The packages you need to install are `bzr` and `bzr-builddeb`::
11
12 $ sudo aptitude install bzr bzr-builddeb
13
14
15Introducing yourself to bzr
16===========================
17
18In order to properly attribute your work to you bzr needs to know your name
19and email address, which you can specify with the `bzr whoami` command::
20
21 $ bzr whoami "James Westby <james.westby@ubuntu.com>"
22
23You don't have to give your real name, and you don't have to give your
24email address, but doing so is a good idea for Ubuntu development.
25
26
27Telling bzr about your launchpad account
28========================================
29
30bzr can work better with Launchpad_ if you tell it what your Launchpad
31username is with the `bzr launchpad-login` command::
32
33 $ bzr launchpad-login james-w
34
35where you should substitute your own Launchpad id for `james-w`. If you don't
36have a Launchpad account you can easily `create one`_. If you don't know your
37Launchpad id, you can find out what this is by going to
38https://launchpad.net/people/+me and looking at the part after `~` in the URL.
39
40The `launchpad-login` command will fail if you haven't set up an SSH key in
41Launchpad yet, but it is `easy to do that`_.
42
43Now you are ready to use bzr to do Ubuntu development.
44
45
46.. _Launchpad: http://launchpad.net
47.. _`create one`: https://launchpad.net/+login
48.. _`easy to do that`: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
049
=== added file 'docs/sponsorship.rst'
--- docs/sponsorship.rst 1970-01-01 00:00:00 +0000
+++ docs/sponsorship.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,110 @@
1===================
2Seeking Sponsorship
3===================
4
5If you have made a change to the package and you do not have rights to upload
6the package then you will need to seek a sponsor.
7
8Note that many sponsorships are still done via debdiffs, and some sponsors
9will prefer that, so you may wish to attach a diff to the bug as well.
10
11
12Linking to bugs
13===============
14
15You will need a bug report to seek sponsorship, and you should refer to this
16issue from your `debian/changelog`. Fill in the changelog entry by running
17`dch -i` and add the `LP: #12345` entry as normal. For example::
18
19 foobar (1.0-2ubuntu1) natty; urgency=low
20
21 * debian/control: Fixed a crash in the baz submodule (LP: #12345)
22
23 -- Barry Warsaw <barry@ubuntu.com> Mon, 04 Jan 2010 15:33:52 -0500
24
25The format of the bug reference must match exactly; if you leave out the space
26or the `#` then the issue will not be closed correctly once your change
27lands. You may also want to use the `--fixes` option on the `bzr commit`
28command to link your branch to the bug report::
29
30 $ bzr commit --fixes lp:12345
31
32Now, when you push the branch to Launchpad it will link the branch to the bug
33report.
34
35It is not critical to have a link to a bug for every change you make,
36but if you are fixing reported bugs then linking to them will be useful.
37
38
39Pushing to Launchpad
40====================
41
42Now you should push the branch to Launchpad so that it can be retrieved
43by others. You do this by pushing it to a branch under your user id::
44
45 $ bzr push lp:~james-w/ubuntu/natty/foobar/bug-12345
46
47where you substitute your Launchpad user id for *james-w*, and the Ubuntu
48release code name you're targeting for *natty*. If you linked a commit to a
49bug number as shown above, then the Launchpad page for the bug will include a
50link to your branch.
51
52However, this usually isn't enough to get Ubuntu developers to review your
53change. You should next submit a *merge proposal* so that the developers can
54find your fix and review it.
55
56To do this open your page in a browser, e.g.
57
58 $ bzr lp-open
59
60if that fails, then you can use
61
62 $ xdg-open https://code.launchpad.net/~james-w/ubuntu/natty/foobar/bug-12345
63
64where most of the URL matches what you used for `bzr push`. On this page,
65you'll see a link that says *Propose for merging into another branch*. Type
66in an explanation of your change in the *Initial Comment* box. Lastly, click
67*Propose Merge* to complete the process.
68
69Merge proposals to package source branches will automatically subscribe the
70`~ubuntu-branches` team, which should be enough to reach an Ubuntu developer
71who can review and sponsor your package change.
72
73
74Generating a debdiff
75====================
76
77As noted above, many sponsors still prefer reviewing a *debdiff* attached to
78bug reports instead of a merge proposal. If you're requested to include a
79debdiff, you can generate one like this (from inside your `bug-12345`
80branch)::
81
82 $ bzr diff -rbranch:../natty
83
84Another way is to is to open the merge proposal and download the diff.
85
86You should ensure that diff has the changes you expect, no more and no less.
87Name the diff appropriately e.g. foobar-12345.debdiff and attach it to the bug
88report.
89
90
91Dealing with feedback from sponsors
92===================================
93
94If a sponsor reviews your change and asks you to change something then you can
95do this fairly easily. Simply go to the branch that you were working in
96before and make the changes requested, and then commit::
97
98 $ bzr commit
99
100Now you can push your changes up to Launchpad as before, but bzr will have
101remembered where you pushed to, so you can simply run::
102
103 $ bzr push
104
105You can then reply to the request for changes explaining what you changed, and
106asking for re-review, or you can reply on the merge proposal page in
107Launchpad.
108
109Note if you are sponsored via debdiff attached to a bug report you need to
110manually update it as described above.
0111
=== added file 'docs/uploading.rst'
--- docs/uploading.rst 1970-01-01 00:00:00 +0000
+++ docs/uploading.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,117 @@
1===================
2Uploading a package
3===================
4
5Once your merge proposal is reviewed and approved, you will want to upload
6your package, either to the archive (if you have permission) or to your
7*Personal Package Archive* (PPA). You might also want to do an upload if you
8are sponsoring someone else's changes.
9
10
11Uploading a change made by you
12==============================
13
14When you have a branch with a change that you would like to upload you need to
15get that change back on to the main branch and then upload it.
16
17First, you need to check that you have the latest version of the package in
18your checkout of the development package::
19
20 $ cd foobar/natty
21 $ bzr pull
22
23If this pulls in any changes that may have been committed while you were
24working on your fix. From here, you have several options. If the changes on
25the trunk are large, and it will take a while to merge them and test the
26package, then you can merge them back in to your work branch to do this. If
27not, then you can carry on merging your work branch in to the main one::
28
29 $ bzr merge-package ../bug-12345
30
31This will merge the two trees, possibly producing conflicts, which you'll need
32to resolve manually.
33
34Next you should make sure the `debian/changelog` is as you would like, with
35the correct distribution, version number, etc.
36
37Once that is done you should review the change you are about to commit
38with `bzr diff`. This should show you the same changes as a debdiff would
39before you upload the source package.
40
41The next step is to build and test the modified source package as you normally
42would. Once you are happy with the upload then you should `dput` the
43source package. For example, if you want to upload your changes to your PPA,
44then you'd do::
45
46 $ dput ppa:me/myppa foobar_1.0-2ubuntu1.dsc
47
48You might want to do one more `bzr commit` to make sure all your changes are
49committed in your working tree.
50
51The last step is to mark the change as being the same as the source package
52that was uploaded, so run::
53
54 $ bzr mark-uploaded
55
56This also tells the package importer that what is in bzr is the same as in the
57archive.
58
59Now you can push the changes back to Launchpad::
60
61 $ bzr push ubuntu:foobar
62
63(Change the destination if you are uploading an SRU or similar.)
64
65You are now free to delete your feature branch, as it is merged, and can
66be recovered if needed.
67
68
69Sponsoring a change
70===================
71
72Sponsoring a change is just like the above procedure, but instead of merging
73from a branch you created, you merge from the branch that the contributor asks
74you to.
75
76 $ bzr merge-package lp:~barry/ubuntu/natty/foobar/bug-12345
77
78The difference would be that if there are lots of merge conflicts then you
79would probably want to ask the contributor to fix them up. To do that see the
80next section.
81
82Cancelling an upload
83====================
84
85At any time before you `dput` the source package you can decide to cancel an
86upload.
87
88 $ bzr revert
89
90You can do this if you notice something needs more work, or if you would like
91to ask the contributor to fix up conflicts when sponsoring something.
92
93
94Sponsoring something and making your own changes
95================================================
96
97If you are going to sponsor someone's work, but you would like to roll it up
98with some changes of your own then you can merge their work in to a separate
99branch first.
100
101If you already have a branch where you are working on the package and you
102would like to include their changes, then simply run the `bzr merge-package`
103from that branch, instead of the checkout of the development package. You can
104then make the changes and commit, and then carry on with your changes to the
105package.
106
107If you don't have an existing branch, but you know you would like to make
108changes based on what the contributor provides then you should start by
109grabbing their branch.
110
111 $ bzr branch lp:~barry/ubuntu/natty/foobar/bug-12345
112
113then work in this new branch, and then merge it in to the main one and upload
114as if it was your own work. The contributor will still be mentioned in the
115changelog, and bzr will correctly attribute the changes they made to them.
116
117.. _`Personal Package Archive`: https://help.launchpad.net/Packaging/PPA
0118
=== added file 'docs/working.rst'
--- docs/working.rst 1970-01-01 00:00:00 +0000
+++ docs/working.rst 2011-01-11 23:17:27 +0000
@@ -0,0 +1,59 @@
1====================
2Working on a Package
3====================
4
5Once you have the package source you may wish to do more with it than just
6examine the source and the history.
7
8
9Branching for a change
10======================
11
12In order to work on a change to the package you should create a branch
13in which you work. You base this branch off the branch for the release
14that you plan to upload to, usually the development release.
15
16First check that you have latest code. Let's say I've already branched the
17`foobar` package from the latest Ubuntu development release, and I want to
18create a branch to fix bug 12345. I am in the shared repository directory
19that I created earlier for `foobar`::
20
21 $ bzr branch natty bug-12345
22 $ cd bug-12345
23
24Now you can do all my work in the `bug-12345` directory. You make changes
25there as necessary, committing as you go along. This is just like doing any
26kind of software development with Bazaar. You can make intermediate commits
27as often as you like, and when your changes are finished, you will use the
28standard `dch` command (from the `devscripts` package)::
29
30 $ dch -i
31
32This will drop you in an editor to add the `debian/changelog` entry. When you
33commit this change, the log message will be copied from that entry::
34
35 $ bzr commit
36
37
38Building the package
39====================
40
41In order to build the package you can use the `bzr builddeb` command from
42the `bzr-builddeb` package. You can build a source package with::
43
44 $ bzr bd -S
45
46(`bd` is an alias for `builddeb`.) You can leave the package unsigned by
47appending `-- -uc -us` to the command.
48
49It is also possible to use your normal tools, as long as they are able to
50strip the .bzr directories from the package, e.g.::
51
52 $ debuild -i -I
53
54If you ever see an error related to trying to build a native package without a
55tarball, check to see if there is a `.bzr-builddeb/default.conf` file
56erroneously specifying the package as native. If the changelog version has a
57dash in it, then it's not a native package, so remove the configuration file.
58Note that while `bzr bd` has a `--native` switch, it does not have a
59`--no-native` switch.

Subscribers

People subscribed via source and target branches