Friday, February 15, 2008

About Branches and PPAs

I've recently experienced a very successfully story regarding the benefits of using PPA in Launchpad, that I'd like to share with you.

As you know I'm not an official Ubuntu developer, I wish I could have the knowledge and time required to be part of such bright group of people, but it's not the case. So, I'm writing this as a mere enthusiast.

Going straight to the point, some days ago, I've got curious about Twitter (again time only allow me to see 'old' stuff in the net). I've signed up, typed some texts, followed some friends and it became very boring ...

I thought it could be better if they provide a standalone client and voilĂ , I found the upstream project and the ubuntu gutsy package

Internet is really fast above the equator.

I've installed '1.0~beta-5', but my dark theme didn't fit the darkblue text very well :(


Checked hardy version to see it got better support for GTK themes and it didn't.

I didn't think twice and took the liberty for quickly registering a product in Launchpad and imported the upstream SVN branch.

Then, expecting to get very lucky, after checking that the build dependencies where constant, I realized it could build on gutsy.

I've downloaded the hardy sourcepackage:

$ dget https://edge.launchpad.net/ubuntu/hardy/+source/gtwitter/1.0~beta-6ubuntu1/+files/gtwitter_1.0~beta-6ubuntu1.dsc

After unpacking and applied the diff, I've created registered and pushed a branch for the 1.0beta6 package series so I could keep track of my changes.

I already have a activated PPA, but following PPAQuickStart describes it in a very detailed way.

Felling brave, again, I've simply mocked a smaller version and uploaded a backported version to my PPA.

$ cd gtwitter-1.0beta
$ dch -D gutsy -b -v 1.0~beta-6ubuntu1~gutsy1
[type a changelog]
$ debuild -S -sa
[type your gpg passprase twice]
$ cd ..
$ dput my_ppa-production gtwitter_1.0~beta-6ubuntu1~gutsy1_source.changes

After 5 minutes I got an email from Launchpad informing that the source was accepted.

Got extremely surprised when, 40 minutes later, it was already successfully built (it is getting faster...)

[enabled my PPA in /etc/apt/sources.list]
$ sudo apt-get update
$ sudo apt-get install gtwitter
...
Setting up gtwitter (1.0~beta-6ubuntu1~gutsy1) ...

...

It is still dark and unreadable, true, but works very well in gutsy.

What's the problem ?! I do have the code :)

Using my non-existent c#-fu, I've managed to change the code the way I wanted , to use gray fonts.

My change will probably be considered offending by the upstream maintainers, but shhh, they don't need to know right now.

(you've gotta love the indentation pattern used by them)

$bzr ci -m "trying a new version, using 'gray' fonts to match my dark theme."
...
$bzr push

Code changes are there, publicly available to embarrass me for the rest of my life:

Well, let's upload the new version, I have a lot of friends using dark themes (it's the future !), they will send me cookies :)

$ dch -D gutsy -b -v 1.0~beta-6ubuntu1~gutsy2
[another creative changelog message]
$ debuild -S

[note that I've omitted the '-sa' option, the orig.tar.gz doesn't need to be sent again, it's already published]
$ cd ..

$ dput my_ppa-production gtwitter_1.0~beta-6ubuntu1~gutsy2_source.changes

5 minutes, I had the notification in my mail box, another successfully upload :)

Other 40 minutes and I got the binary I wanted.

$ sudo apt-get update
$ sudo apt-get install gtwitter
...
Setting up gtwitter (1.0~beta-6ubuntu1~gutsy2) ...

...




That's all, folks.

It's quite possible that you hated it ... No problem, all you need is:

bzr branch lp:gtwitter/1.0-beta6

to easily make it the way you want and then wait 45 minutes to spread the free-software joy amongst your friends.