git

Revision 2 as of 2018-05-11 17:14:04

Clear message

The DesktopTeam uses git to manage its packages. Here's how to do some common things. You need git-buildpackage installed for most of this.

default ~/.gbp.conf

git-buildpackage uses this file for its default configuration; some tweaks are recommended. See gbp.conf(5) and the various --help for more options.

[DEFAULT]
# the default clean command:
cleaner = fakeroot debian/rules clean
# use pristine-tar:
pristine-tar = True

# Options only affecting git-buildpackage
[buildpackage]
# automatically GPG sign tags
sign-tags = True
# keyid to GPG sign tags with
keyid = 0xYOURKEYIDHERE
# use this for more svn-buildpackage like behaviour:
export-dir = ../build-area/
tarball-dir = ../tarballs/
# ignore uncommitted changes
ignore-new = True

check out a package

If the Vcs-Git field is correct, you can

ubuntu@gbp-demo:~$ debcheckout --git-track=* glib2.0
declared git repository at https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/glib2.0
git clone https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/glib2.0 glib2.0 ...
Cloning into 'glib2.0'...
remote: Counting objects: 133911, done.
remote: Compressing objects: 100% (24298/24298), done.
remote: Total 133911 (delta 109608), reused 133521 (delta 109263)
Receiving objects: 100% (133911/133911), 64.44 MiB | 880.00 KiB/s, done.
Resolving deltas: 100% (109608/109608), done.
Branch 'pristine-tar' set up to track remote branch 'pristine-tar' from 'origin'.
Branch 'upstream/2.56.x' set up to track remote branch 'upstream/2.56.x' from 'origin'.
Branch 'upstream/latest' set up to track remote branch 'upstream/latest' from 'origin'.

Otherwise, you can check out any git-buildpackage repository

ubuntu@gbp-demo:~$ gbp clone https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/glib2.0
gbp:info: Cloning from 'https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/glib2.0'

build a source package

ubuntu@gbp-demo:~/glib2.0$ gbp buildpackage -S
dh clean --with gnome,python3 --buildsystem=autoconf
   dh_auto_clean -O--buildsystem=autoconf
   dh_gnome_clean -O--buildsystem=autoconf
   debian/rules override_dh_clean
make[1]: Entering directory '/home/ubuntu/glib2.0'
rm -rf /home/ubuntu/glib2.0/debian/build \
       /home/ubuntu/glib2.0/debian/install \
       /home/ubuntu/glib2.0/debian/tmp-xdg-runtime-dir
dh_clean -Xorg.gtk.test.gschema.xml.orig
make[1]: Leaving directory '/home/ubuntu/glib2.0'
gbp:info: Tarballs 'glib2.0_2.56.1.orig.tar.xz' not found at '../tarballs/'
gbp:info: Creating /home/ubuntu/build-area/glib2.0_2.56.1.orig.tar.xz
gbp:info: Exporting 'HEAD' to '/home/ubuntu/build-area/glib2.0-tmp'
gbp:info: Moving '/home/ubuntu/build-area/glib2.0-tmp' to '/home/ubuntu/build-area/glib2.0-2.56.1'
gbp:info: Performing the build
...

If you used the gbp.conf given above, the source package is in ../build-area. We didn't have the orig.tar.xz to hand before this, but gbp used pristine-tar to reconstruct the same one you get from upstream. Check the sha256sum.

release a package

merge a new upstream version

merge with debian

cherry pick a patch

write a new patch