1
0
Fork 0

Output prefixes are now handled by parent script

As they should be.
master
Mike Gerwitz 2013-03-10 22:49:45 -04:00
parent 84f3c589de
commit 0982212464
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
3 changed files with 31 additions and 9 deletions

View File

@ -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%-*}"

View File

@ -20,6 +20,26 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
_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" ] || {

6
rss
View File

@ -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