hashcache is now primed before processing
This is a temporary implementation to ensure crefs work properly; will optimize in future commits.master
parent
ba4eed71be
commit
01bdca9422
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Generates output filename for a given commit
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Mike Gerwitz
|
||||||
|
#
|
||||||
|
# This file is part of repo2html.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
# #
|
||||||
|
|
||||||
|
ts="${1?Missing timestamp}"
|
||||||
|
id="${2?Missing commit id}"
|
||||||
|
|
||||||
|
dateout="$( ./tsdate "$ts" %Y-%m-%d )"
|
||||||
|
month="$( ./tsdate "$ts" %m )"
|
||||||
|
year="${dateout%%-*}"
|
||||||
|
|
||||||
|
echo "$year/$month/$id.html"
|
|
@ -26,9 +26,6 @@ path_out="${2?Missing output path}"
|
||||||
# provide default message formatter if necessary
|
# provide default message formatter if necessary
|
||||||
msgfmt="${msgfmt:-./msgfmt}"
|
msgfmt="${msgfmt:-./msgfmt}"
|
||||||
|
|
||||||
# clear the cachefile
|
|
||||||
./hashcache clear
|
|
||||||
|
|
||||||
|
|
||||||
# output XHTML5 header
|
# output XHTML5 header
|
||||||
cat <<EOH
|
cat <<EOH
|
||||||
|
@ -73,7 +70,7 @@ while read hash commit ts id subject; do
|
||||||
lastyear="${lastyear:-$year}"
|
lastyear="${lastyear:-$year}"
|
||||||
firstyear="$year"
|
firstyear="$year"
|
||||||
|
|
||||||
pagefile="$year/$month/$id.html"
|
pagefile="$( ./outfgen "$ts" "$id" )"
|
||||||
fmtsubject="$( "$msgfmt" < <( echo "$subject"; echo ) )"
|
fmtsubject="$( "$msgfmt" < <( echo "$subject"; echo ) )"
|
||||||
|
|
||||||
[ "$prevdate" == "$dategroup" ] || {
|
[ "$prevdate" == "$dategroup" ] || {
|
||||||
|
|
|
@ -78,6 +78,15 @@ msgfmt="${msgfmt:-./msgfmt}"
|
||||||
# make configuration available to all scripts
|
# make configuration available to all scripts
|
||||||
export title desc copyright license msgfmt url_root
|
export title desc copyright license msgfmt url_root
|
||||||
|
|
||||||
|
# clear and prime the cachefile (TODO: we could maintain cache files from
|
||||||
|
# previous runs if we offer a flag that opts out of reprocessing previously
|
||||||
|
# processed commits)
|
||||||
|
echo "Priming hashcache..." >&2
|
||||||
|
./hashcache clear
|
||||||
|
"$repotype"/list | while read hash _ ts id _; do
|
||||||
|
./hashcache "$hash" "$( ./outfgen "$ts" "$id" )"
|
||||||
|
done
|
||||||
|
|
||||||
# pass commit list to the HTML and RSS processors
|
# pass commit list to the HTML and RSS processors
|
||||||
"$repotype"/list | tee \
|
"$repotype"/list | tee \
|
||||||
>( ./rss "$repotype" "$url_root" "$rss_count" > "$path_out/rss.xml" ) \
|
>( ./rss "$repotype" "$url_root" "$rss_count" > "$path_out/rss.xml" ) \
|
||||||
|
|
Loading…
Reference in New Issue