#!/bin/sh # Print the aggregate SVN revision and date of the book, that is, the # highest revnum (and the date corresponding to that revnum) from # among the XML files that make up the book. The output looks like: # # 3287 (21 Feb 2025) # # (We can't just use the stock 'svnversion' script for this, because # we don't want a composite revision to result, and because we don't # want to use the revisions of any files other than book XML files.) XML_FILES="book.xml.in `grep '.xml"' en/book.xml | cut -d '"' -f 2`" TMP_FILE=aggrevision-$$.tmp > ${TMP_FILE} for name in ${XML_FILES}; do svn info en/${name} | grep 'Last Changed Rev: ' | cut -d ' ' -f 4 \ >> ${TMP_FILE} done REVNUM="`sort -nr ${TMP_FILE} | head -1`" DATE="`svn log -q -r${REVNUM} | grep -v -- '-------------' | cut -d ' ' -f 5`" echo "${REVNUM} (`date -d ${DATE} +"%d %b %Y"`)" rm ${TMP_FILE}