How to apply a patch (under Ubuntu)

Listen to this.

Someone wants to know how to apply Bugzilla patch 124290 under Ubuntu.

sudo apt-get build-dep metacity
apt-get source metacity
cd metacity-2.24.0
wget -O - http://bugzilla.gnome.org/attachment.cgi?id=124290 | patch -p1
./configure
make
sudo make install

(I would include the output but it’d be in Welsh.)

4 Comments

  1. Quikee
    Posted December 17, 2008 at 6:30 am | Permalink

    Alternatively you could also say “dpkg-buildpackage -rfakeroot” and “sudo dpkg -i metacity…” instead of “configure, make, make install” and the result would be deb packages.

  2. Ryan
    Posted December 17, 2008 at 8:38 am | Permalink

    Instead of configure/make/make install, how about ‘dch -i && dpkg-buildpackage -rfakeroot’ ?

  3. Posted December 17, 2008 at 10:16 am | Permalink

    I’d be inclined to replace the last three lines with

    dch -i
    # change the version number to ‘ubuntuXmypatch1′ or something
    # describe which the patch you’ve applied
    debuild
    sudo dpkg -i ../*metacity*deb

    That would let the packaging system know that you’ve got a slightly newer version of metacity than what Ubuntu currently does, but that the next Ubuntu version will be newer than the one you have.

  4. Posted December 17, 2008 at 3:45 pm | Permalink

    That works too, and is probably a better way to keep dpkg happy.