From cc45286e3556a48b10b3a9c1f01ae5846ba88a69 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Mon, 18 Oct 2010 14:10:48 -0400 Subject: [PATCH] make debs refinement When looking for the most recent tag, look for only tags matching v*. That should hopefully weed out any non-versioning tags. Don't convert debian/changelog commits to patches since the changelog has to be in place right when dpkg-buildpackage starts. This does mean that one should NEVER commit to another file in the same commit as a debian/changelog commit. Make sure debian/patche{s,d} are clean before starting. --- build/autoMakefile.am.toplevel | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index eb9b048..986e6fc 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -148,7 +148,7 @@ debs: 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 \ - ver=$$(git describe --tags); \ + ver=$$(git describe --match v\* --tags); \ if [[ $$ver = *-*-* ]]; then \ hash=$${ver##*-}; \ ffw=$${ver#*-}; \ @@ -164,25 +164,29 @@ debs: -e 's/_/./g'); \ fi; \ pdir="debian/patches"; \ - git format-patch -o $$pdir $$tag..HEAD^; \ - if [ ! -d $$pdir ]; then \ - mkdir $$pdir; \ + if [ -d $$pdir ]; then \ + rm -rf $$pdir; \ fi; \ + mkdir $$pdir; \ + git format-patch -o $$pdir $$tag..HEAD; \ pushd $$pdir; \ - if [ ! -d ../patched ]; then \ - mkdir ../patched; \ + if [ -d ../patched ]; then \ + rm -rf ../patched; \ fi; \ + mkdir ../patched; \ 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%.patch}" \ - "$$desc" > $$dpatch_file; \ - echo "faked by make debs run from git" > \ - ../patched/$$dpatch_file; \ - echo $$dpatch_file >> 00list; \ + if ! grep -q "^ debian/changelog" $$file; then \ + desc=$$(cat $$file | sed -e '1,/^$$/d' \ + -e '/^---$$/,$$d'); \ + dpatch_file=$${file/.patch/.dpatch}; \ + sed -e '1,/^---$$/d' $$file | \ + dpatch patch-template -p "$${file%.patch}" \ + "$$desc" > $$dpatch_file; \ + echo "faked by make debs run from git" > \ + ../patched/$$dpatch_file; \ + echo $$dpatch_file >> 00list; \ + fi; \ rm -f $$file; \ done; \ fi; \ -- 1.8.3.1