Dev Week -- Fixing small Ubuntu bugs -- dholbach -- Mon, Jan 25
UTC
1 [17:02] <dholbach> Alrighty... welcome back to Ubuntu Developer Week - this time it's "Fixing small bugs in Ubuntu" :-)
2 [17:02] <dholbach> I picked a few small bugs and I hope a few things will be clearer:
3 [17:03] <dholbach> - how to use basic tools in every day situations later on
4 [17:03] <dholbach> - learn the process of fixing something, how to propose the fix to get accepted, etc.
5 [17:03] <dholbach> so we're not going to cover kernel hacks, crazy C++ stuff or anything else in here :-)
6 [17:04] <dholbach> ok... the first bug I want us to have a look at is: https://bugs.launchpad.net/ubuntu/+source/fsniper/+bug/486612
7 [17:05] <dholbach> if you check it out, you'll see that indeed it is a small bug, it's about a typo in the package description of fsniper
8 [17:05] <dholbach> to confirm it, just run
9 [17:05] <dholbach> apt-cache show fsniper
10 [17:05] <dholbach> and it says this towards the end:
11 [17:05] <dholbach> This packages comes with no generic rules, so you must write
12 [17:05] <dholbach> them yourself.
13 [17:05] <dholbach> so... we're going to fix it!
14 [17:06] <dholbach> first of all, let's get the package source:
15 [17:06] <dholbach> apt-get source fsniper
16 [17:06] <dholbach> if you run ls you will see that it downloaded a .orig.tar.gz, a .diff.gz and a .dsc file
17 [17:06] <dholbach> and that it created a directory called fsniper-1.3.1
18 [17:07] <dholbach> ok, here's how it all fits together:
19 [17:07] <cjohnston> < vishalrao_dsktop> QUESTION: where does apt-get source store source files?
20 [17:07] <dholbach> - orig.tar.gz is the file that the upstream authors released on their website as the source code
21 [17:07] <dholbach> - .diff.gz is the compressed set of changes we make to make the package build the "debian or ubuntu way"
22 [17:08] <dholbach> - .dsc is just meta-data like md5sums etc
23 [17:08] <dholbach> apt-get downloaded the source from the archive, checked the md5sum, untarred the .orig.tar.gz file and applied the .diff.gz changes
24 [17:09] <dholbach> ok... let's fix this bug now :)
25 [17:09] <dholbach> cd fsniper-1.3.1/
26 [17:09] <dholbach> cat debian/control
27 [17:09] <dholbach> debian/control was added (among other things) by the Debian/Ubuntu maintainers of the package
28 [17:10] <dholbach> and it describes the source and the resulting binary package (in this simple case just one binary package)
29 [17:10] <cjohnston> < michae> QUESTION : no fsniper dir . Normal?
30 [17:10] <dholbach> the description at the bottom is what we need to fix
31 [17:10] <dholbach> this call ought to fix it for us:
32 [17:10] <dholbach> sed -i 's/packages/package/g' debian/control
33 [17:11] <dholbach> michae: I'm sorry, I don't understand your question... can somebody help michae debug the problem in #ubuntu-classroom-chat please?
34 [17:11] <cjohnston> < thebwt-lernid> QUESTION: couldn't we just open our favorite editor and fix it as well? Why use sed?
35 [17:12] <dholbach> thebwt-lernid: yes, that'd work too and we'll make more use of the editor in due course :)
36 [17:12] <dholbach> ok... some folks said they ran into trouble because dpkg-dev was not installed - please make sure you have it
37 [17:13] <dholbach> so now that we fixed the problem, we need to document the changes we did
38 [17:13] <dholbach> please run
39 [17:13] <dholbach> dch -i
40 [17:13] <dholbach> (you need devscripts installed for that - session 1)
41 [17:14] <dholbach> if you attended the first session, you will see your name and email address now, if you weren't here or did something wrong, you need to type it in manually
42 [17:15] <dholbach> ok, let's go through the changelog entry one by one
43 [17:15] <dholbach> the first line looks like the following over here:
44 [17:15] <dholbach> fsniper (1.3.1-0ubuntu3) lucid; urgency=low
45 [17:15] <dholbach> first the name of the source package, next the version, then the version of Ubuntu where we want to fix it in and an urgency setting which we can ignore for now
46 [17:16] <dholbach> let's have another look at the version name
47 [17:16] <dholbach> 1.3.1-0ubuntu3 means: 1.3.1 release by upstream, package was not in Ubuntu yet, 3 revisions in Ubuntu
48 [17:17] <dholbach> oops, sorry make that "package was not in Debian yet"
49 [17:17] <dholbach> 0.6-4 would mean: 0.6 release by upstream, 4 revisions in Debian, no changes in Ubuntu
50 [17:17] <dholbach> 1.2.3-4ubuntu5 would mean: 1.2.3 as released by upstream, 4 revisions in Debian, 5 changes following changes in Ubuntu
51 [17:17] <dholbach> etc.
52 [17:18] <dholbach> I hope it gets clearer as we work our way through a few examples
53 [17:18] <dholbach> next up is the description... dch leaves it empty for us, but I put something like this in there:
54 [17:18] <dholbach> * debian/control: replaced "This packages" with "This package" (LP: #486612)
55 [17:18] <dholbach> when I write a changelog entry, I usually try to:
56 [17:18] <dholbach> - mention which files I changes
57 [17:18] <dholbach> - mention which files I changed
58 [17:18] <cjohnston> < SoftwareExplorer> QUESTION:Do the numbers after ubuntu reset when debian releases a new version?
59 [17:18] <dholbach> - mention what I changed
60 [17:19] <dholbach> - mention where the change was discussed (bug report, mailing list post, etc.)
61 [17:19] <dholbach> - and as (LP: #486612) means "Launchpad bug 4855112", in this special notation the bug will get automatically closed on upload :)
62 [17:20] <dholbach> SoftwareExplorer: no, if we introduce changes in Ubuntu, we need to either manually merge our changes with Debian changes or we need to decide to drop our changes altogehter and overwrite our package with that from Debian - in the latter case, yes, the version is "reset"
63 [17:21] <dholbach> https://wiki.ubuntu.com/UbuntuDevelopment/Merging has more info
64 [17:21] <cjohnston> < venuz> QUESTION:how do we resolve cyclic dependency?
65 [17:21] <dholbach> and on Friday, 17 UTC we will have a dedicated session about that
66 [17:21] <dholbach> venuz: that's a more complicated subject and nothing we can discuss in this session, can you please head to #ubuntu-devel and ask there?
67 [17:21] <dholbach> ok, let's move on
68 [17:22] <cjohnston> < strycore74> QUESTION: Is there a way to quickly view all the changes I made in the source code while I'm writing the source code ? Should I keep an intact verison of the source to diff with my
69 [17:22] <cjohnston> version ?
70 [17:22] <dholbach> so once you wrote something nice into the changelog entry, please save the file
71 [17:22] <dholbach> and run
72 [17:22] <dholbach> debuild -S
73 [17:22] <dholbach> strycore74: I'm going to mention that in just a sec :)
74 [17:23] <cjohnston> < xteejx71> QUESTION: what is the difference between the -S and the -S -sa commands?
75 [17:23] <dholbach> xteejx71: -S will build the source package, -sa is something we can ignore for now - it's just relevant if you want to upload the package somewhere (-sa will also upload the .orig.tar.gz tarball) - please refer to the debuild or dpkg-buildpackage manpage :)
76 === swoody__ is now known as Guest6758
77 [17:24] <dholbach> please run
78 [17:24] <dholbach> sudo apt-get install quilt
79 [17:24] <dholbach> if "debuild -S" gave you an error message
80 [17:24] <dholbach> and try again
81 [17:24] <dholbach> thanks dbell
82 [17:25] <dholbach> please let me know in #ubuntu-classroom-chat if that worked out for you :)
83 [17:25] <dholbach> ok, some of you seem to have got a debsign error. we can ignore that for now.
84 [17:26] <dholbach> it likely means that you either didn't set up your gpg key correctly, or you gave a different name and email address in your gpg set up and in DEBEMAIL/DEBFULLNAME in ~/.bashrc
85 [17:26] <dholbach> we don't need to sign it now, so please ignore it for now :)
86 [17:26] <dholbach> some of you might also need to run:
87 [17:26] <dholbach> sudo apt-get install debhelper
88 [17:26] <dholbach> sorry :)
89 [17:27] <dholbach> thanks vishalrao_dsktop
90 [17:27] <dholbach> you can run all these commands as regular user, 'sudo' should just be required for pbuilder
91 [17:28] <dholbach> alright, let's crack on, please rerun "debuild -S" once you install debhelper and quilt
92 [17:28] <dholbach> then please run
93 [17:28] <dholbach> cd ..
94 [17:28] <dholbach> now please run
95 [17:28] <dholbach> debdiff fsniper_1.3.1-0ubuntu2.dsc fsniper_1.3.1-0ubuntu3.dsc > fsniper.debdiff
96 [17:28] <cjohnston> < mhall119|work> QUESTION: I get a gpg error saying "secret key not available"
97 [17:29] <dholbach> mhall119|work: very likely whatever you have in DEBEMAIL / DEBFULLNAME in ~/.bashrc and in your gpg key set up don't match - please ignore it for now or try to debug it in #ubuntu-classroom-chat
98 [17:30] <dholbach> you might also need the patchutils package, so please install that too
99 [17:30] <dholbach> ok............
100 [17:31] <dholbach> once you have all that sorted out, please copy the content of fsniper.debdiff to http://paste.ubuntu.com
101 [17:31] <dholbach> and say something like MY-PATCH: http://paste.ubuntu.com/...... in #ubuntu-classroom-chat and I'll take a look at it
102 [17:32] <dholbach> if we did everything right, we might all have a nice patch ready now :)
103 [17:32] <dholbach> xteejx71: http://paste.ubuntu.com/362732/ looks great
104 [17:33] <dholbach> alastair: http://paste.ubuntu.com/362734/ looks good, just replace "karmic" with "lucid", karmic is release already - apart from that: great work!
105 [17:33] <dholbach> strycore74: http://paste.ubuntu.com/362731/ looks great
106 [17:34] <dholbach> vishalrao_dsktop: http://paste.ubuntu.com/362735/ looks great (just karmic -> lucid)
107 [17:35] <dholbach> netritious: http://pastebin.com/f28cffa07 looks good (karmic -> lucid too and maybe your realname :-))
108 [17:35] <cjohnston> < Ravm> QUESTION: So, if I made a mistake, do I just alter the patch, or redo the sequence?
109 [17:35] <dholbach> rmunn: http://paste.ubuntu.com/362740/ looks good, karmic->lucid too and I'd mention which file you changed :)
110 [17:36] <dholbach> Ravm: re-do the sequence in almost all circumstances
111 [17:36] <dholbach> Ravm: it's very easy to botch up the patch file and whoever is reviewing the patch later on can't apply it
112 [17:37] <dholbach> I'm proud of you guys! Awesome work! First patch done! YEEEEEEHAW! :-)
113 [17:37] <dholbach> ok, let's do another one... we have 23 minutes left :-D
114 [17:37] <cjohnston> < dbell> QUESTION: do we need to go through the whole process again to change karmic to lucid, do we need to run lucid, or can we just edit the debdiff and change it there?
115 [17:37] <dholbach> dbell: just update karmic to lucid, then run "debuild -S" again
116 [17:38] <dholbach> (and run "debdiff ...")
117 [17:38] <dholbach> the next bug I found it a bit more complicated :-)
118 [17:38] <cjohnston> < mhall119|work> QUESTION you wouldn't have to re-do the dch part unless it's been uploaded, right?
119 [17:38] <dholbach> mhall119|work: yes, you'd just run edit debian/changelog instead
120 [17:39] <dholbach> ok... here's the next bug: https://bugs.launchpad.net/ubuntu/+source/meld/+bug/417369
121 [17:39] <dholbach> somebody requests the meld package to be updated
122 [17:39] <cjohnston> < Navaneeth> QUESTION: Is this the same procedure to fix defects even if they are in code (C or C++)? If yes, Once they are fixed, will it goto original projects source repository?
123 [17:40] <dholbach> Navaneeth: the procedure can change somewhat, and the change needs to be forwarded to upstream authors by you manually
124 [17:40] <dholbach> ok... let's fix up meld now
125 [17:41] <dholbach> the bug requests 1.3.1
126 [17:41] <dholbach> in lucid I get the following:
127 [17:41] <dholbach> daniel@miyazaki:~$ apt-cache showsrc meld | grep ^V
128 [17:41] <dholbach> Version: 1.3.0-2
129 [17:41] <dholbach> daniel@miyazaki:~$
130 [17:41] <cjohnston> < xteejx71> QUESTION: Should we now remove all the old build files for hello and fsniper?
131 [17:41] <dholbach> xteejx71: as you like it
132 [17:41] <dholbach> ok, so we indeed have to fix meld
133 [17:41] <dholbach> apt-get source meld
134 [17:41] <dholbach> cd meld-1.3.0
135 [17:42] <cjohnston> < lbrinkma> QESTION: Should this upgrade performed upstream(debian)?
136 [17:42] <dholbach> now you need devscripts installed
137 [17:42] <dholbach> lbrinkma: in theory, yes, as much in Debian as possible
138 [17:42] <dholbach> lbrinkma: sometimes you will find that Debian is in a freeze period or that we need a fix urgently - in that case we upload to Ubuntu directly
139 [17:42] <dholbach> or if the Debian maintainer is on holidays, etc :)
140 [17:43] <dholbach> now please run:
141 [17:43] <dholbach> uscan
142 [17:43] <dholbach> if you run
143 [17:43] <dholbach> ls ..
144 [17:43] <cjohnston> < xteejx71> QUESTION: Does it make a difference if we update an Ubuntu package, since Ubuntu and Debian sync each other right?
145 [17:43] <dholbach> it will show you that it downloaded meld-1.3.1.tar.gz from the upstream website - cool, eh?
146 [17:44] <dholbach> (debian/watch does thaT)
147 [17:44] <dholbach> xteejx71: check out https://wiki.ubuntu.com/SyncRequestProcess and https://wiki.ubuntu.com/UbuntuDevelopment/Merging - Jorge and I will cover that explicitly in Adopt-An-Upstream :)
148 [17:45] <dholbach> next we use that tarball to "update the package"
149 [17:45] <dholbach> please run
150 [17:45] <dholbach> uupdate ../meld_1.3.1.orig.tar.gz
151 [17:46] <dholbach> what it does it the following:
152 [17:46] <dholbach> - untar the mentioned tarball
153 [17:46] <dholbach> - apply the current set of changes (1.3.0 .diff.gz)
154 [17:46] <dholbach> - add a template changelog entry
155 [17:46] <dholbach> nice, eh? :-)
156 [17:46] <dholbach> now please:
157 [17:46] <dholbach> cd ../
158 [17:46] <dholbach> diff -u meld-1.3.{0,1}/INSTALL
159 [17:47] <dholbach> what that command does is show you the differences between the INSTALL file (a document provided by upstream) between the two releases
160 [17:48] <dholbach> the important information we filter out now is:
161 [17:48] <dholbach> -## * pygtk-2.6.0
162 [17:48] <dholbach> -## * gnome-python-2.6.0
163 [17:48] <dholbach> +## * pygtk-2.8.0
164 [17:48] <dholbach> +## * gnome-python-2.8.0
165 [17:48] <dholbach> (it tells us that new versions of gnome-python and pygtk are required)
166 [17:48] <dholbach> if you intend to take care of a package update, be sure to check what changed internally so your users aren't confused afterwards :-)
167 [17:48] <dholbach> now
168 [17:48] <dholbach> cd meld-1.3.1
169 [17:48] <dholbach> and edit debian/control.in
170 [17:49] <dholbach> (in this case it's debian/control.in and not debian/control because of specialties in the Debian GNOME team)
171 [17:50] <dholbach> I'll now change this line python-gtk2 (>= 2.4), to use 2.8
172 [17:50] <dholbach> also I'll update python-gnome2, to have (>= 2.8)
173 [17:50] <dholbach> now save the file
174 [17:50] <dholbach> and run
175 [17:50] <dholbach> rm debian/patches/pythonpath.patch
176 [17:51] <dholbach> (this is a patch that is not required any more... I'm just saying it now as we only have 9 minutes left - I tested this before :-))
177 [17:52] <dholbach> now please edit debian/changelog and document your changes :)
178 === mike is now known as Guest50550
179 [17:53] <dholbach> now please run
180 [17:53] <dholbach> update-maintainer
181 [17:53] <dholbach> (from the ubuntu-dev-tools package)
182 [17:53] <dholbach> rationale: the Debian maintainers asked us to set an ubuntu.com email address as the Maintainer whenever we introduce a change over Debian so they don't get email for it :-)
183 [17:53] <dholbach> https://wiki.ubuntu.com/DebianMaintainerField
184 [17:54] <dholbach> also please edit debian/rules
185 [17:54] <dholbach> and remove the following line
186 [17:54] <dholbach> DEB_INSTALL_CHANGELOGS_ALL += changelog
187 [17:54] <dholbach> save the file
188 [17:54] <dholbach> and run
189 [17:54] <dholbach> debuild -S -sa
190 [17:55] <dholbach> you might need gnome-pkg-tools installed
191 [17:55] <dholbach> once you're done with this, you can build the package by running the following
192 [17:55] <dholbach> sudo pbuilder build meld_1.3.1-0ubuntu1.dsc
193 [17:55] <dholbach> or rather:
194 [17:55] <dholbach> cd ..
195 [17:55] <dholbach> sudo pbuilder build meld_1.3.1-0ubuntu1.dsc
196 [17:56] <dholbach> sorry for ploughing through this like this but we were running out of time
197 [17:56] <cjohnston> < Navaneeth> QUESTION: If I submitted a patch to launch pad and didn't send that to original authors. So does that lead into multiple versions of package? And what happens if the patch submitted to launch pad is not the one the real authors like to include? How ubuntu handles such scenarios?
198 [17:56] <dholbach> normally we would have fixed the bugs one by one
199 [17:56] <dholbach> Navaneeth: first of all the patch is not automatically sent upstream
200 [17:57] <dholbach> https://wiki.ubuntu.com/SponsorshipProcess explains how to get a patch reviewed for inclusion by Ubuntu developers
201 [17:57] <dholbach> sometimes they are going to ask you to get in touch with upstream developers and forward the patch there first (if it's not obvious)
202 [17:57] <dholbach> generally we prefer to stay in sync with upstream
203 [17:57] <dholbach> and want good reasons to deviate
204 [17:57] <dholbach> cjohnston: next
205 [17:57] <cjohnston> < Quintasan> QUESTION: what is the Build-Depends-Indep line?
206 [17:59] <dholbach> Quintasan: Build-Depends and Build-Depends-Indep are packages that are necessary to build packages
207 [17:59] <dholbach> if a package is Architecture: all, you list under Build-Depends all the packages that are necessary to run the clean target and the rest under build-depends-indep (sorry it's a bit short, but we#re out of time, sorry)
208 [18:00] <dholbach> have a look at https://wiki.ubuntu.com/PackagingGuide for more info
209 [18:00] <dholbach> https://wiki.ubuntu.com/MOTU/GettingStarted is what you need to bookmark :)
210 [18:00] <dholbach> and THANKS EVERYBODY
211 [18:00] <dholbach> this session was awesome! :-)