From f4c0a9a353262f0a7d90e0f99740a6e81307cab6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 23 Aug 2009 17:05:16 -0700 Subject: [PATCH] cook.sh: move the "New Topics" generation to the template handler code --- cook.sh | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/cook.sh b/cook.sh index 471a8da98e..4d5864281e 100755 --- a/cook.sh +++ b/cook.sh @@ -287,6 +287,29 @@ perl -w -e ' } } + if (open I, "<$tmp.output.toc") { + $section = "New Topics"; + while () { + my ($branch, $oldserial) = /^(\S*) (\d+)$/; + next if (exists $branch{$branch}); + if (!exists $section{$section}) { + push @section, $section; + $section{$section} = []; + } + push @branch, [$branch, $section]; + $branch{$branch} = (scalar @branch) - 1; + if (!exists $description{$branch}) { + $description{$branch} = []; + } + open II, "<$tmp.output.$oldserial"; + while () { + push @{$description{$branch}}, $_; + } + close II; + } + close I; + } + open O, ">$tmp.template.blurb"; for (@{$description{$blurb}}) { print O $_; @@ -326,15 +349,6 @@ else cat "$tmp.output.blurb" fi | sed -e '$d' -while read branch serial -do - grep "^$branch " "$tmp.template.toc" >/dev/null && continue - - tmpserial=$(( $tmpserial + 1 )) - echo "$branch $tmpserial New Topics" >>"$tmp.template.toc" - cp "$tmp.output.$serial" "$tmp.template.$tmpserial" -done <"$tmp.output.toc" - current='-------------------------------------------------- [Graduated to "master"] ' -- 2.11.4.GIT