X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=macros%2Fchanges;h=c1e6946e4e4edd128fff206519800f4e14558668;hb=9c54db6ec648c690cc3111faa19c3312d51d041e;hp=be4dfec868ce86348c5b4e518d1b2f16d1c30dec;hpb=f8aef4eba181cf0ff368b96ffd26bdc30bd67852;p=shellwiki
diff --git a/macros/changes b/macros/changes
index be4dfec..c1e6946 100755
--- a/macros/changes
+++ b/macros/changes
@@ -4,9 +4,7 @@
. "$_EXEC/tools.sh"
. "$_EXEC/acl.sh"
-LANGUAGES=''
-
-glob="/" depth=-1
+LANGUAGES='' glob="/" depth=-1
while [ $# -gt 0 ]; do case $1 in
--system) glob_system_pages=true; shift 1;;
:*) LANGUAGES="${LANGUAGES}${LANGUAGES:+ }${1#:}"; shift 1;;
@@ -14,35 +12,41 @@ while [ $# -gt 0 ]; do case $1 in
*) glob="$1"; shift 1;;
esac; done
-printf '
\nPage | '
+page='' page_abs='' ostamp='' odate='' lstamp='' ldate='' row='' rowstate=''
+
+printf '\nPage | '
for l in $LANGUAGES; do printf '%s | ' "$l"; done
printf '\n\n'
page_glob "$glob" "$depth" |while read page; do
- acl_read "$page" || continue
+ page_abs="$(page_abs "$page")"
+ acl_read "${page_abs}" || continue
- printf ''
read ostamp odate <<-EOF
- $(git -C "$_DATA" log --pretty="format:%at %ar" -- "pages/${page}#page.md")
+ $(git -C "$_DATA" log --pretty="format:%at %ai" -- "pages${page_abs}#page.md")
EOF
- printf '%s%s | ' "$(HTML "$page")" "$(HTML "$page")" "${odate}"
+ row="$(HTML "$page")${odate%% +*} | "
+ rowstate=''
for l in $LANGUAGES; do
if [ -f "${_DATA}/pages/${page}:${l}/#page.md" ]; then
read lstamp ldate <<-EOF
- $(git -C "$_DATA" log --pretty="format:%at %ar" -- "pages/${page}:${l}/#page.md")
+ $(git -C "$_DATA" log --pretty="format:%at %ai" -- "pages$(page_abs "${page_abs}:${l}")/#page.md")
EOF
- if [ $lstamp -lt $ostamp ]; then
- printf 'outdated%s | ' "$(HTML "${page}:${l}")" "$ldate"
+ if [ $lstamp -lt $ostamp ] 2>&-; then
+ row="${row}outdated${ldate%% +*} | "
+ [ "$rowstate" = "${rowstate%*outdated*}" ] && rowstate="${rowstate}${rowstate:+ }outdated"
else
- printf 'current%s | ' "$(HTML "${page}:${l}")" "$ldate"
+ row="${row}current${ldate%% +*} | "
+ [ "$rowstate" = "${rowstate%*current*}" ] && rowstate="${rowstate}${rowstate:+ }current"
fi
else
- printf 'missing | ' "$(HTML "${page}:${l}")"
+ row="${row}missing | "
+ [ "$rowstate" = "${rowstate%*missing*}" ] && rowstate="${rowstate}${rowstate:+ }missing"
fi
done
- printf '
\n'
+ printf '%s
\n' "$rowstate" "$row"
done
printf '
'