diff --git a/debian/bin/test-patches b/debian/bin/test-patches new file mode 100755 index 000000000..cb361a28b --- /dev/null +++ b/debian/bin/test-patches @@ -0,0 +1,81 @@ +#!/bin/bash + +set -e +shopt -s extglob + +# Set defaults from the running kernel +arch="$(dpkg --print-architecture)" +kernelabi="$(uname -r)" +ff="${kernelabi#+([^-])-@(trunk|+([0-9]))-}" +if [ "x$ff" != "x$kernelabi" ]; then + flavour="${ff#@(openvz|vserver|xen)-}" + if [ "x$flavour" != "x$ff" ]; then + featureset="${ff%-$flavour}" + else + featureset=none + fi +else + flavour= + featureset=none +fi + +eval "set -- $(getopt -n "$0" -- "f:j:s:" "$@")" +while true; do + case "$1" in + -f) flavour="$2"; shift 2 ;; + -j) export DEBIAN_KERNEL_JOBS="$2"; shift 2 ;; + -s) featureset="$2"; shift 2 ;; + --) shift 1; break ;; + esac +done + +if [ $# -lt 1 ]; then + echo >&2 "Usage: $0 [] ..." + cat >&2 < specify the 'flavour' of kernel to build, e.g. 686 + -j specify number of compiler jobs to run in parallel + -s specify an optional featureset to apply, e.g. xen +EOF + exit 2 +fi + +if [ -z "$flavour" ]; then + echo >&2 "You must specify a flavour to build with the -f option" + exit 2 +fi + +dpkg-checkbuilddeps -B + +# Append 'a~test' to Debian version; this should be less than any official +# successor and easily recognisable +version="$(dpkg-parsechangelog | sed 's/^Version: //; t; d')" +if [ "${version%a~test}" = "$version" ]; then + version="$version"a~test + dch -v "$version" "Testing patches $*" +fi +debversion="${version##*-}" + +# Copy all patches into a new directory +rm -rf debian/patches/test/ +mkdir debian/patches/test +cp -t debian/patches/test/ "$@" + +# Generate patch series for the new version +>debian/patches/series/"$debversion" +for patch in "$@"; do + echo "+ test/$(basename "$patch")" >>debian/patches/series/"$debversion" +done + +# Regenerate control and included rules +rm debian/control debian/rules.gen +debian/rules debian/control-real && exit 1 || true +test -f debian/control +test -f debian/rules.gen + +# Clean and patch source +debian/rules clean +debian/rules source + +# Build selected binaries +fakeroot make -f debian/rules.gen binary-arch_"$arch"_"$featureset"_"$flavour" diff --git a/debian/changelog b/debian/changelog index 0ddaa1472..f42f9dead 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linux-2.6 (2.6.31-1~experimental.3a~test) UNRELEASED; urgency=low + + * Testing patches /dev/null + + -- Ben Hutchings Mon, 26 Oct 2009 00:56:08 +0000 + linux-2.6 (2.6.31-1~experimental.3) UNRELEASED; urgency=low [ Ben Hutchings ]