diff --git a/outfgen b/outfgen new file mode 100755 index 0000000..9482083 --- /dev/null +++ b/outfgen @@ -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 . +# # + +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" diff --git a/processor b/processor index c8c7862..da94bdb 100755 --- a/processor +++ b/processor @@ -26,9 +26,6 @@ path_out="${2?Missing output path}" # provide default message formatter if necessary msgfmt="${msgfmt:-./msgfmt}" -# clear the cachefile -./hashcache clear - # output XHTML5 header cat <&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 "$repotype"/list | tee \ >( ./rss "$repotype" "$url_root" "$rss_count" > "$path_out/rss.xml" ) \