From d986321631f11ff106a664242525e8e0a79f53c5 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Fri, 11 Jun 2010 00:04:32 -0400 Subject: [PATCH] b=22790 generate debian/patches If we are running from a git checkout and there are patches on the branch, (not counting the always-present debian/changelog update patch, which is always assumed to be at the top of the patch stack) put them into debian/patches/ as dpatches and remove them from the source so that what's put into the source tarball is pristine. --- build/autoMakefile.am.toplevel | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index ba08fc9..b442aef 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -146,6 +146,23 @@ debs: cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \ if [ "$$lversion" != "$$cversion" ]; then \ echo -e "1i\nlustre ($$lversion-1) unstable; urgency=low\n\n * Automated changelog entry update\n\n -- Brian J. Murrell $$(date -R)\n\n.\nwq" | ed debian/changelog; \ + fi; \ + if [ -d .git ]; then \ + pdir="debian/patches"; \ + git format-patch -o $$pdir $$lversion..HEAD^; \ + pushd $$pdir; \ + rm -f 00list *.dpatch; \ + for file in [0-9][0-9][0-9][0-9]-*.patch; do \ + desc=$$(cat $$file | sed -e '1,/^$$/d' -e '/^---$$/,$$d'); \ + dpatch_file=$${file/.patch/.dpatch}; \ + sed -e '1,/^---$$/d' $$file | \ + dpatch patch-template -p "$$file" "$$desc" > \ + $$dpatch_file; \ + echo "faked by make debs run from git" > \ + ../patched/$$dpatch_file; \ + echo $$dpatch_file >> 00list; \ + rm -f $$file; \ + done; \ fi dpkg-buildpackage || { \ rc=$${PIPESTATUS[0]}; \ -- 1.8.3.1