1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-29 14:17:10 +02:00

Reduce the number of I/O redirections.

- scripts/schhist2web: instead of having many >>"$index", just put one at
  the enclosing construct
This commit is contained in:
Werner Almesberger 2010-08-30 21:05:25 -03:00
parent 20184edd25
commit 6260614015

View File

@ -360,17 +360,17 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do
s="$s<TD>" s="$s<TD>"
continue continue
fi fi
echo "$s" >>"$index" echo "$s"
s= s=
empty=false empty=false
wrapped_png "$out" "$next" "$m" >>"$index" wrapped_png "$out" "$next" "$m"
done < <(ls -1 "$out/names") done < <(ls -1 "$out/names")
if ! $empty; then if ! $empty; then
echo "$s<TD valign=\"middle\">" >>"$index" echo "$s<TD valign=\"middle\">"
commit_entry "$dir" $next >>"$index" commit_entry "$dir" $next
fi fi
next=$n next=$n
done done >>"$index"
# --- Add creation entries for all files in the first commit ------------------ # --- Add creation entries for all files in the first commit ------------------
@ -378,7 +378,7 @@ done
if [ -d "$cache/ppm_$next" ]; then # could this ever be false ? if [ -d "$cache/ppm_$next" ]; then # could this ever be false ?
empty=true empty=true
echo "<TR>" >>"$index" echo "<TR>"
mkdir -p "$out/diff_$next" "$out/thumb_$next" mkdir -p "$out/diff_$next" "$out/thumb_$next"
while read m; do while read m; do
ppm="$cache/ppm_$next/$m.ppm" ppm="$cache/ppm_$next/$m.ppm"
@ -386,7 +386,7 @@ if [ -d "$cache/ppm_$next" ]; then # could this ever be false ?
diff="$out/diff_$next/$m.png" diff="$out/diff_$next/$m.png"
thumb="$out/thumb_$next/$m.png" thumb="$out/thumb_$next/$m.png"
echo "<TD>" >>"$index" echo "<TD>"
[ -f "$ppm" ] || continue [ -f "$ppm" ] || continue
pngdiff cat "$diff" -f -c 0,1,0 "$ppm" "$ppm" || exit pngdiff cat "$diff" -f -c 0,1,0 "$ppm" "$ppm" || exit
pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$fat" "$fat" \ pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$fat" "$fat" \
@ -395,13 +395,13 @@ if [ -d "$cache/ppm_$next" ]; then # could this ever be false ?
mkdir -p "$out/pdf_$next" mkdir -p "$out/pdf_$next"
schps2pdf -T NEW -o "$out/pdf_$next/$m.pdf" \ schps2pdf -T NEW -o "$out/pdf_$next/$m.pdf" \
"$cache/ps_$next/$m.ps" || exit "$cache/ps_$next/$m.ps" || exit
wrapped_png "$out" "$next" "$m" >>"$index" wrapped_png "$out" "$next" "$m"
done < <(ls -1 "$out/names") done < <(ls -1 "$out/names")
if ! $empty; then if ! $empty; then
echo "<TD valign=\"middle\">" >>"$index" echo "<TD valign=\"middle\">"
commit_entry "$dir" $next >>"$index" commit_entry "$dir" $next
fi
fi fi
fi >>"$index"
# --- Finish ------------------------------------------------------------------ # --- Finish ------------------------------------------------------------------