From: Junio C Hamano Date: Mon, 24 Aug 2009 00:05:16 +0000 (-0700) Subject: cook.sh: move the "New Topics" generation to the template handler code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4c0a9a353262f0a7d90e0f99740a6e81307cab6;p=thirdparty%2Fgit.git cook.sh: move the "New Topics" generation to the template handler code --- 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"] '