From 09822124647d4e4560c9ad6cd1360744afde4c4f Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 10 Mar 2013 22:49:45 -0400 Subject: [PATCH] Output prefixes are now handled by parent script As they should be. --- processor | 4 ++-- repo2html | 30 ++++++++++++++++++++++++++---- rss | 6 +++--- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/processor b/processor index f94ce5b..74bba7f 100755 --- a/processor +++ b/processor @@ -52,11 +52,11 @@ lasthash= while read hash commit ts id subject; do # ignore commits that begin with ':' [[ "$subject" == :* ]] && { - echo "[HTML] Ignoring $commit: $subject" >&2 + echo "Ignoring $commit: $subject" >&2 continue } - echo "[HTML] Found $commit: $subject" >&2 + echo "Found $commit: $subject" >&2 dateout="$( ./tsdate "$ts" %Y-%m-%d )" dategroup="${dateout%-*}" diff --git a/repo2html b/repo2html index f2ceba3..dbee0ff 100755 --- a/repo2html +++ b/repo2html @@ -20,6 +20,26 @@ # along with this program. If not, see . # # +_stderrout() +{ + prefix="$1" + sed 's/^/['"$prefix"'] /g' >&2 +} + +_rssout() +{ + _stderrout 'RSS' +} +_htmlout() +{ + _stderrout 'HTML' +} +_reout() +{ + _htmlout 2> >( _stderrout 'Reprocessing' ) +} + + # repository detection repotype= if repodir="$( git rev-parse --git-dir 2>/dev/null )"; then @@ -94,17 +114,19 @@ export cref_errlog="$cref_errlog_first" # reference and further processing) listcache=.list "$repotype"/list | tee \ - >( ./rss "$repotype" "$url_root" "$rss_count" > "$path_out/rss.xml" ) \ + >( ./rss "$repotype" "$url_root" "$rss_count" \ + > "$path_out/rss.xml" \ + 2> >( _rssout ) + ) \ "$listcache" \ - | ./processor "$repotype" "$path_out" + | ./processor "$repotype" "$path_out" 2> >( _htmlout ) # re-process cref errors (but only once; any errors at this point will be # considered to be problem refs) export cref_errlog=.cref-bad >"$cref_errlog" grep -f"$cref_errlog_first" "$listcache" \ - | ./processor "$repotype" "$path_out" \ - 2> >( sed 's/^/[Reprocessing] /g' >&2 ) + | ./processor "$repotype" "$path_out" 2> >( _reout ) # if any invalid crefs remain, then they're bad [ ! -s "$cref_errlog" ] || { diff --git a/rss b/rss index 1b2ca5e..225c9f1 100755 --- a/rss +++ b/rss @@ -44,11 +44,11 @@ EOH while read hash commit ts id subject; do # ignore commits that begin with ':' [[ "$subject" == :* ]] && { - echo "[RSS] Ignoring $commit: $subject" >&2 + echo "Ignoring $commit: $subject" >&2 continue } - echo "[RSS] Found $commit: $subject" >&2 + echo "Found $commit: $subject" >&2 # TODO: avoid HTML entities where browsers may decide not to render them (e.g. # the title) @@ -73,7 +73,7 @@ EOE # the check, meaning that if the count is 0, then we will output every commit ((i++)) [ "$i" -eq "$count" ] && { - echo "[RSS] Limit of $count reached." >&2 + echo "Limit of $count reached." >&2 break } done