diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-07-09 11:32:12 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-07-18 06:20:38 +0900 |
commit | 8408000daa11cd747cf693d39288d339761b7c12 (patch) | |
tree | 47df6d0b9ebcf30a07ae8748fd7f261c7142c80d | |
parent | 8ec22dd8c5c4fd6714b9dd9dc149c32ae56b44e6 (diff) | |
download | dotfiles-8408000daa11cd747cf693d39288d339761b7c12.tar.gz |
build script to finally deal with patches
-rw-r--r-- | .gbp.conf | 5 | ||||
-rwxr-xr-x | bin/build | 35 |
2 files changed, 35 insertions, 5 deletions
@@ -15,8 +15,3 @@ pristine-tar-commit = True # doesn't get invoked automatically # disable this -- means package is always signed despite -us -uc #postbuild=debsign --no-re-sign - -# For the sake of dgit we don't want dpkg's unapply-patches option set -# anywhere. Instead, we just pop off the patches whenever we run gbp. -prebuild = quilt-pop-all -postbuild = quilt-pop-all diff --git a/bin/build b/bin/build new file mode 100755 index 00000000..04daa736 --- /dev/null +++ b/bin/build @@ -0,0 +1,35 @@ +#!/bin/sh + +# The purpose of this script is to give the right magic invocation to +# build a Debian package, the traditional way, without using sbuild +# and friends. It could later be extended to build other things. + +# The main motivation for having the script is to deal with the fact +# that some repositories are committed to with quilt patches applied, +# and some are committed with quilt patches unapplied. This script +# should make that transparent, without using the +# d/source/local-options file, which interferes with dgit. + +if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + if git branch -a | grep -q "remotes/dgit"; then + # let dgit handle it + dgit "$@" build + lintian + else + # make the bold assumption we want to build with gbp + # TODO would it be enough to check for existence of d/gbp.conf? + ( + # unlike debuild, gbp must be invoked from the root of the + # repository + cd "$(git rev-parse --show-toplevel)" + if [ -d ".pc" ]; then + quilt pop -a + fi + git clean -xfd --exclude="debian/patches/*" # newly created patches + gbp buildpackage -us -uc -nc "$@" + ) + fi +else + # not a git repo, woo + debuild +fi |