Dev Week -- How do I update a package properly - Cesare Tirabassi -- Wed, Sep 3

(12:59:02 PM) norsetto: lets start then, while the iron is still hot ...
(12:59:19 PM) sebner: norsetto: \o/
(12:59:35 PM) norsetto: welcome everybody, I'm gonna talk about how to make a package update
(01:00:07 PM) norsetto: in particular, "all you wanted to know about whats next after dch -i" (at least I hope)
(01:00:11 PM) norsetto: hi sebner
(01:00:47 PM) norsetto: do we all know what we mean by a package upgrade?
(01:01:16 PM) rUkie: no i dont
(01:01:21 PM) norsetto: anyone ... don't feel shy ...
(01:01:26 PM) bobbo: upgrading to a new upstream release?
(01:01:34 PM) norsetto: bobbo: yes
(01:01:39 PM) norsetto: bobbo: thx
(01:01:42 PM) bobbo: \o/
(01:02:11 PM) norsetto: we do have a package in our repository, foo-1, and upstream just released a new shiny foo-2
(01:02:36 PM) norsetto: normally, we would get the update from debian, but there are cases when we don't
(01:02:56 PM) norsetto: for instance, if debian is in a freeze, or the package is orphaned, or its a native ubuntu package
(01:03:31 PM) norsetto: or we simply need it urgently, and then pass the result back to debian
(01:03:50 PM) norsetto: so far so good? please stop me if something is not clear, or I'm too slow/fast
(01:04:35 PM) norsetto: +<Coper> QUESTION: If i package a new package for Ubuntu should we notify debian so they get it?
(01:04:47 PM) norsetto: Coper: yes, definetively
(01:05:03 PM) Coper: how?
(01:05:25 PM) norsetto: ok, so, we now know we have a new upstream version, first thing to do is to get it
(01:05:31 PM) sebner: Coper: file a bug in Debian BTS
(01:06:02 PM) norsetto: Coper: you need to open a RFP or ITP bug in the bts, and submit the package to
(01:06:17 PM) mok0: Good topic for a lesson!
(01:06:42 PM) norsetto: we can get the tarball manually, using http or wget
(01:06:57 PM) norsetto: if there is a watch file in the current package, we can use that
(01:07:39 PM) norsetto: just check if there is a debian/watch file, or give the command "uscan" at the source tree root
(01:08:02 PM) norsetto: uscan --verbose just gives you some more info about what it is trying to do
(01:08:02 PM) rUkie left the room (quit: " HydraIRC -> <- *I* use it, so it must be good!").
(01:08:27 PM) norsetto: finally, there could be a get-orig-source target in debian/rules that we can use
(01:08:55 PM) norsetto: for instance you can do "make -f debian/rules get-orig-source" to execute it
(01:09:40 PM) norsetto: be carefull to read changelog, copyright and README.Source, the previous packager might mention few things to be doing on the upstream tarball
(01:10:20 PM) norsetto: like, removing non distributable content, or repackaging
(01:10:56 PM) norsetto: ok, now that we have an upstream tarball, we need to rename it in accordance to our policy
(01:11:30 PM) norsetto: foo-2.tar.gz will become foo_2.orig.tar.gz
(01:11:56 PM) norsetto: like as we would do for a shiny new package
(01:12:34 PM) norsetto: now, the simplest case is if there are no changes to packaging and no changes outside of debian
(01:13:04 PM) norsetto: just untar your tarball, copy the old debian dir to the new source tree
(01:13:37 PM) norsetto: and finally add the new changelog entry
(01:13:51 PM) norsetto: I wish all updates were this simple :-)
(01:13:59 PM) norsetto: you still with me?
(01:14:38 PM) norsetto: ok, more difficult if in the previous package there were changes outside of debian
(01:15:10 PM) norsetto: for instance the previous packager made inline changes instead of using a patch system, you can check this by checking the old diff.gz
(01:16:03 PM) norsetto: in this case just copying debian won't be enough, we have to make all those changes outside of debian too
(01:16:15 PM) norsetto: you can do that manually, or using patch
(01:16:53 PM) norsetto: for instance "zcat ../foo-1.diff.gz | patch -p1" (given at the src tree root)
(01:17:24 PM) norsetto: here we can already have some pain, as some of the old changes might not apply anymore, or not apply correctly
(01:18:04 PM) norsetto: all the above procedure can be automated by using uupdate
(01:18:48 PM) norsetto: again in the src tree root of the old package, give the comman uupdate ../foo_2.orig.tar.gz and all these steps will be automatically performed
(01:19:57 PM) norsetto: now, as you should have guessed already, before doing all this we need to know what has changed in the new upstream tarball, and we need to check what the previous packager did with the old package
(01:20:32 PM) norsetto: any idea how we can check what is the difference between the old tarball and the new ?
(01:20:52 PM) norsetto: +<mok0> QUESTION: What's the difference between uscan and uupdate?
(01:21:01 PM) sebner: norsetto: diff?
(01:21:09 PM) mok0: diff -r old new
(01:21:34 PM) norsetto: mok0: uscan just check and eventually download upstream tarball, uupdate do the update
(01:21:53 PM) norsetto: mok0: uscan can also do the update, depend on what it is in the watch file
(01:22:15 PM) norsetto: sebner: mok0: yes, diff is our friend
(01:22:24 PM) norsetto: I personally like diff -Nurb
(01:22:53 PM) norsetto: once you have the diff, you should check line by line and see what has changed upstream
(01:22:54 PM) RoAkSoAx: norsetto: uscan does the update if you add 'debian uupdate' in the watchfile right?
(01:23:09 PM) norsetto: RoAkSoAx: perfect
(01:23:29 PM) norsetto: tedious perhpas, but its really necessary
(01:24:01 PM) norsetto: ok, some example of the things that might have changed upstream and that needs to be considered in the packaging
(01:24:23 PM) norsetto: one important thing is license
(01:24:43 PM) norsetto: sometime upstream changes the licensing of their packages, or add new file with new licenses
(01:25:06 PM) norsetto: there is a tool you can use to help you detect these changes
(01:25:24 PM) norsetto: its called licensecheck and is in the devscripts package
(01:25:48 PM) norsetto: licensecheck -r --copyright
(01:26:05 PM) norsetto: will check all files in all subdirs and also check copyrights
(01:26:54 PM) norsetto: just an example, you may want to check bug 257664
(01:27:16 PM) norsetto: since ubottu is on strike
(01:27:17 PM) ubot5: Launchpad bug 257664 in picard "picard crashed with SIGSEGV in memset()" [Medium,Fix released]
(01:27:42 PM) norsetto: thanks ubot5, I love you
(01:28:10 PM) mok0: thanks for no link :-)
(01:28:11 PM) sebner: lol
(01:28:19 PM) norsetto: you may want to download the old and the new package and see the diff
(01:29:04 PM) norsetto: as you can see from the changelog I detected some changes in the licensing, and updated debian/copyright
(01:29:59 PM) norsetto: another example is
(01:30:01 PM) ubot5: Launchpad bug 243692 in source-highlight "web pages with ~ do not underline correctly" [Undecided,Fix released]
(01:30:40 PM) norsetto: as you can see in this case the license was changed from gpl-2 to gpl-3
(01:31:07 PM) norsetto: ok, any other things we should check? ideas?
(01:31:38 PM) norsetto: what about patches?
(01:31:58 PM) RoAkSoAx: norsetto: update patches to match new files ?
(01:32:05 PM) sebner: norsetto: another dependencies or newer versions
(01:32:21 PM) norsetto: RoAkSoAx: yes, does the old package have patches? Are they still needed anymore? Do they still apply correctly?
(01:33:04 PM) norsetto: sebner: yes, do we need new build-deps for instance
(01:33:47 PM) norsetto: sebner: this is usually reported in upstream ChnageLog, but sometime you only discover it by looking at upstream autoconf files (or Makefile)
(01:34:27 PM) norsetto: another thing to check, if the package includes a man page, check if there are upstream changes that needs to go in there
(01:34:53 PM) norsetto: and don't forget to update the man page date if you do that ;-)
(01:35:24 PM) norsetto: any change in file locations? Maybe upstream now isntall files differently, we may need to change our packaging
(01:35:57 PM) norsetto: will this new upstream version close an bug open in LP?
(01:36:08 PM) norsetto: if so, close it from the changelog
(01:36:25 PM) norsetto: is upstream web page changed?
(01:36:41 PM) norsetto: report the change in control and copyright
(01:37:05 PM) norsetto: is upstream now shipping a .desktop file, or new icons?
(01:37:14 PM) norsetto: make sure you install those
(01:37:35 PM) norsetto: maybe you need to remove those in the old package if they are obsolete
(01:38:03 PM) norsetto: sometime upstream changes few things which need you to change compilation flags
(01:38:31 PM) norsetto: for instance, some plugin which are now ON while you used OFF or viceversa
(01:38:55 PM) norsetto: if upstream is a library particular care has to be taken
(01:39:10 PM) norsetto: check if API/ABI change is reflected in SONAME/version
(01:39:29 PM) norsetto: you can use check-symbols or icheck to help you with that
(01:40:00 PM) norsetto: you may need a library transition, which involves perhpas rebuilding many packages already in the archive
(01:40:25 PM) norsetto: ok, perhaps at this point it is better to go together through an example
(01:40:36 PM) norsetto: anyone is working on an update at the moment?
(01:40:59 PM) sebner: norsetto: FF :P
(01:41:02 PM) nxvl: o/
(01:41:33 PM) norsetto: nxvl: do you want to tell us which package?
(01:41:52 PM) nxvl: norsetto: terminator
(01:42:28 PM) nxvl: but it's not a good example since i maintain it on upstream bzr
(01:42:30 PM) nxvl: :D
(01:42:38 PM) ***bobbo just did three...
(01:42:56 PM) norsetto: bobbo, ok, sounds good, bug numer?
(01:43:19 PM) bobbo: bug #249997
(01:43:54 PM) sebner: ubot5: hop hop hop
(01:43:55 PM) ubot5: Factoid 'hop hop hop' not found
(01:44:04 PM) norsetto: ok, we also have the new upstream tarball in there :-)
(01:44:35 PM) norsetto: lets download the old package, create a htop directory and download it with "apt-get source htop"
(01:44:41 PM) bobbo: (
(01:44:42 PM) ubot5: Launchpad bug 249997 in htop "Package is outdated " [Wishlist,Fix released]
(01:45:19 PM) norsetto: bobbo: ok your version is in the rchive already :)
(01:45:27 PM) nxvl left the room (quit: Read error: 104 (Connection reset by peer)).
(01:45:36 PM) RoAkSoAx: bug 256439
(01:45:56 PM) RoAkSoAx:
(01:45:57 PM) ubot5: Launchpad bug 256439 in ao40tlmview "Please update ao40tlmview to 1.04" [Wishlist,Confirmed]
(01:46:00 PM) bobbo: ooh, didnt know that, sorry!
(01:46:19 PM) norsetto: bobbo: no probelm :-)
(01:46:30 PM) norsetto: ok, lets check this one
(01:46:57 PM) norsetto: create an ao40tlmview dir and download teh src package in tehre with apt-get source ao40tlmview
(01:47:38 PM) norsetto: have we all got the current package?
(01:48:40 PM) norsetto: nobody?
(01:49:21 PM) RoAkSoAx left the room (quit: "ChatZilla 0.9.83 [Firefox 3.0.1/2008070208]").
(01:49:36 PM) norsetto: ok lets check the new upstream tarball
(01:49:52 PM) norsetto: there is no watch file, no link in the bug report
(01:50:05 PM) norsetto: we can check copyright and see what is the download location there
(01:50:48 PM) norsetto: which will give us this location:
(01:50:54 PM) nxvl [n=nxvl@ubuntu/member/nxvl] entered the room.
(01:51:05 PM) norsetto: lets get it with wget: "wget"
(01:51:37 PM) norsetto: now we have to rename it so that its compliant with out policy
(01:51:44 PM) norsetto: what would the correct name be?
(01:52:16 PM) RoAkSoAx [n=roaksoax@ubuntu/member/roaksoax] entered the room.
(01:52:20 PM) sebner: norsetto: ao40tlmview_1.04.orig.tgz
(01:52:25 PM) norsetto: sebner: indeed
(01:52:37 PM) norsetto: lets see what is the diff between these two upstream version
(01:52:57 PM) norsetto: lets untar the new tarball: tar xzvf ao40tlmview_1.04.orig.tar.gz
(01:53:33 PM) norsetto: and teh old one: tar xzvf ao40tlmview_1.03.orig.tar.gz
(01:54:15 PM) norsetto: now we can check the diff: diff -Nurb ao40tlmview_1.03.orig.tar.gz ao40tlmview_1.04.orig.tar.gz > ao40tlmview_1.04.diff
(01:54:48 PM) norsetto: sorry: diff -Nurb ao40tlmview-1.03 ao40tlmview-1.04 > ao40tlmview_1.04.diff
(01:55:39 PM) norsetto: as you can see there is only one interesting change
(01:56:05 PM) sebner: norsetto: makefile one?
(01:56:14 PM) norsetto: yes, this has no impact on us however
(01:56:22 PM) norsetto: so, its a very simple update
(01:57:17 PM) norsetto: if you check the old package, you will see that there are no changes outside of debian
(01:57:35 PM) norsetto: so, we just cipy the old debian dir and we add a new changelog entry
(01:58:31 PM) norsetto: we then rebuild the package
(01:58:57 PM) sebner: norsetto: though we have to change maintainer and that stuff
(01:59:01 PM) norsetto: if the rebuild is ok, we attach the new diff.gz to the bug report and ask a sponsor to upload it
(01:59:18 PM) norsetto: sebner: yes, if the package was not already an ubuntu package
(01:59:30 PM) norsetto: sebner: debuild will tell us anyhow ;-)
(01:59:38 PM) sebner: ^^ true
(01:59:54 PM) sebner: norsetto: and .dsc is not needed at the bug report?
(01:59:56 PM) norsetto: as you can see this is exactly what RoAkSoAx did, even if he added a coupld of additional changes
(02:00:02 PM) norsetto: sebner: no
(02:00:13 PM) sebner: norsetto: but it was once afaik!?
(02:00:13 PM) norsetto: ok, thats about it then
(02:00:30 PM) norsetto: sebner: no, as far as i know it was never required
(02:00:38 PM) sebner: O_o
(02:00:39 PM) sebner: ok
(02:00:48 PM) sebner: norsetto: thanks for this great session :D
(02:01:01 PM) norsetto: sebner: you may remember interdiff, but that is gone
(02:01:11 PM) norsetto: <albert23> norsetto: for an update, we should update the standards-version?
(02:01:35 PM) norsetto: albert23: you shouldn't in general, unless there is a change that warrants it
(02:01:52 PM) norsetto: albert23: but adding the watch file is a nice addition
(02:02:00 PM) sebner: norsetto: ah yes, interdiff
(02:02:35 PM) norsetto: any other question before I leave the floor to the next lecture?
(02:02:38 PM) sebner: norsetto: sebner@ubuntu:~/merges/ao40tlmview/ao40tlmview-1.03$ uupdate ../ao40tlmview_1.04.orig.tgz
(02:02:38 PM) sebner: uupdate: new version number not recognized from given filename
(02:02:38 PM) sebner: Please run uupdate with the -v option
(02:03:11 PM) norsetto: sebner: yes, thats because of the tgz extension
(02:03:35 PM) sebner: norsetto: ah only working with tar.gz?
(02:04:07 PM) norsetto: sebner: it should be ao40tlmview_1.04.orig.tar.gz or ao40tlmview-1.04.tgz (even though I'm not sure the latter will work)
(02:04:23 PM) sebner: norsetto: kk :) and shouldn it be licensecheck -r .  ?
(02:04:37 PM) norsetto: sebner: yes, or *
(02:04:49 PM) norsetto: who is the next lecturer?
(02:04:55 PM) sebner: norsetto: kk because you were using --copyright ^^
(02:05:02 PM) ***mathiaz waves at norsetto 
(02:05:16 PM) norsetto: sebner: yes, --copyright also gives you the cipyright it finds in the headers
(02:05:21 PM) norsetto: hi mathiaz!
(02:05:34 PM) mathiaz: norsetto: hi :)
(02:05:50 PM) norsetto: so, unless there are further q we can leave the floor to mathiaz, I can asnwer questions in ubuntu-motu anyway

MeetingLogs/devweek0809/PackageUpdates (last edited 2008-09-03 19:53:51 by ausimage)