![]() | ![]() | Building Debian Packages with git-buildpackage: Version: 0.4.10 | ![]() |
---|
If you have to handle non DFSG clean upstream sources you can use a different branch which you have to create once:
git branch dfsg_clean upstream
This creates the dfsg_clean branch from the tip of a
branch called upstream. Then, when importing a new
upstream version, you import the new version on the
upstream-branch
(by default named
upstream) as usual and just don't merge to the
debian-branch (by default named
master):
git-import-orig --no-merge /path/to/nondfsg-clean-package_10.4.orig.tar.gz
git tag
10.4
After the import you can switch to the dfsg_clean branch and get the newly imported changes from the upstream branch:
gitcheckout
dfsg_clean gitpull
. upstream
Now make this checkout dfsg clean (preverably by a cleanup script), commit
your changes and merge to your debian-branch
:
cleanup-script.sh git commit -a -m "Make source dfsg clean" git tag 10.4.dfsg git checkout master git pull . dfsg_clean
First create a branch that holds the NMUs from the tip of your
debian-branch
(default is master) once:
git branch
nmu master
To import an NMU instead of a new upstream version simply import the unpacked NUMs source tree into your repository using git-import-orig:
git checkout master git-import-orig-u
10-1.1--upstream-branch
=nmu /path/to/nmu-10/
This will import the NMU onto the branched named nmu branch instead of
the default upstream-branch
and merge the changes to the
debian-branch
as usual. This method can also be used to
import "old" releases into the Git repository when migrating to Git from
another VCS.
Since pbuilder use different command line arguments than Debuild and Dpkg-buildpackage we have to use a tiny script that gets invoked by git-buildpackage:
cat <<EOF >/usr/local/bin/git-pbuilder
#!/bin/sh
# pass all options to dpkg-buildpackage:
pdebuild --debbuildopts
"-i\.git -I.git $*"
EOF
chmod a+x /usr/local/bin/git-pbuilder
Furthermore we need a different clean command, since pdebuild
clean
means something different than debuild
clean
. We could put all this on the command line, but
let's put it into the config file to safe typing:
cat <<EOF > ~/.gbp.conf [DEFAULT] # tell git-buildpackage howto clean the source tree cleaner = fakeroot debian/rules clean # this is how we invoke pbuilder, arguments passed to git-buildpackage will be # passed to dpkg-buildpackge in the chroot builder = /usr/local/bin/git-pbuilderInvoking git-buildpackage will now invoke pdebuild
If you don't want this for all your invocations of git-buildpackage you can instead put this into .git/gbp.conf in one of your Git repositories.
Whenever you need to work on an arbitrary Debian package you can check it right into Git with one command:
apt-get source --download-only package git-import-dsc package*.dsc cd package git-branch debian
This puts the orig.tar.gz onto the upstream-branch
and
the Debian patch onto a branch called debian. Now you
can easily modify the package, revert changes you made, create other
branches for testing, see what changes you made, etc.. When finished just
do
git-commit -a git-diff debian --
to get a nice patch that can be submitted to the Debian BTS.
<<< Configuration files | Command Reference >>> |