|
|
|
@@ -1,7 +1,9 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
package='tufte-latex' |
|
|
|
class='tufte-handout.cls' |
|
|
|
PACKAGE_NAME='tufte-latex' |
|
|
|
CLASS_FILES="tufte-handout.cls tufte-book.cls" |
|
|
|
STYLE_FILES="tufte-common.sty" |
|
|
|
SOURCE_FILES="sample-handout.{pdf,tex,bib} sample-book.{pdf,tex}" |
|
|
|
|
|
|
|
# Exit on first error: |
|
|
|
|
|
|
|
@@ -15,38 +17,53 @@ then |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
version=$1 |
|
|
|
CLASS_DATE=`date +%Y/%m/%d` # (with slashes) |
|
|
|
VERSION=$1 |
|
|
|
|
|
|
|
if ! echo $version | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" |
|
|
|
if ! echo $VERSION | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" |
|
|
|
then |
|
|
|
echo "VERSION should be of the form 1.2.5 (major.minor.revision)" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
if ! grep -q $version $class |
|
|
|
for CLASS in $CLASS_FILES; do |
|
|
|
if ! grep -q $VERSION $CLASS |
|
|
|
then |
|
|
|
echo "Error: version skew. '$VERSION' does not match that in $CLASS" |
|
|
|
grep -H ProvidesClass $CLASS |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
if ! grep -q $CLASS_DATE $CLASS; then |
|
|
|
echo "Error: date skew. '$CLASS_DATE' does not match that in $CLASS" |
|
|
|
grep -H ProvidesClass $CLASS |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
for STYLE in $STYLE_FILES; do |
|
|
|
if ! grep -q $VERSION $STYLE |
|
|
|
then |
|
|
|
echo "Error: version skew. '$VERSION' does not match that in $STYLE" |
|
|
|
grep -H ProvidesPackage $STYLE |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
if ! grep -q $CLASS_DATE $STYLE |
|
|
|
then |
|
|
|
echo "Error: date skew. '$CLASS_DATE' does not match that in $STYLE" |
|
|
|
grep -H ProvidesPackage $STYLE |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
if ! grep -q $VERSION History.txt |
|
|
|
then |
|
|
|
echo "Error: version skew. '$version' does not match that in class" |
|
|
|
grep -H ProvidesClass $class |
|
|
|
echo "Error: no release notes for '$VERSION' found in History.txt" |
|
|
|
grep -H $VERSION History.txt |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
if ! grep -q $version History.txt |
|
|
|
then |
|
|
|
echo "Error: no release notes for '$version' found in History.txt" |
|
|
|
grep -H $version History.txt |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
class_date=`date +%Y/%m/%d` # (with slashes) |
|
|
|
|
|
|
|
if ! grep -q $class_date $class |
|
|
|
then |
|
|
|
echo "Error: date skew. '$class_date' does not match that in class" |
|
|
|
grep -H ProvidesClass $class |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
history_date=`date +%Y-%m-%d` # (with dashes) |
|
|
|
HISTORY_DATE=`date +%Y-%m-%d` # (with dashes) |
|
|
|
|
|
|
|
if ! grep -q $history_date History.txt |
|
|
|
then |
|
|
|
@@ -55,7 +72,7 @@ then |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
# Refresh sample document |
|
|
|
# Refresh sample documents |
|
|
|
|
|
|
|
pdflatex sample-handout > refresh-sample.log |
|
|
|
bibtex sample-handout >> refresh-sample.log |
|
|
|
@@ -63,9 +80,18 @@ pdflatex sample-handout >> refresh-sample.log |
|
|
|
pdflatex sample-handout >> refresh-sample.log |
|
|
|
rm -f sample-handout.{aux,log,out,blg,bbl} refresh-sample.log |
|
|
|
|
|
|
|
pdflatex sample-book > refresh-sample.log |
|
|
|
bibtex sample-book >> refresh-sample.log |
|
|
|
texindy --language english sample-book.idx >> refresh-sample.log |
|
|
|
pdflatex sample-book >> refresh-sample.log |
|
|
|
pdflatex sample-book >> refresh-sample.log |
|
|
|
rm -f sample-bok.{aux,log,out,blg,bbl,idx,ind,toc} refresh-sample.log |
|
|
|
|
|
|
|
|
|
|
|
# To ease googlecode upload, make a distinct version of sample-handout: |
|
|
|
|
|
|
|
cp sample-handout.pdf sample-handout-$version.pdf |
|
|
|
cp sample-book.pdf sample-book-$version.pdf |
|
|
|
|
|
|
|
# Make bundle for Google Code release |
|
|
|
|
|
|
|
@@ -82,13 +108,13 @@ TDS_SRC_DIR=$TDS_DIR/source/latex/$package/ |
|
|
|
|
|
|
|
mkdir -p $TDS_DIR $TDS_TEX_DIR $TDS_DOC_DIR $TDS_SRC_DIR |
|
|
|
|
|
|
|
cp tufte-handout.cls $TDS_TEX_DIR/ |
|
|
|
cp $CLASS_FILES $STYLE_FILES $TDS_TEX_DIR/ |
|
|
|
|
|
|
|
cp History.txt README.txt sample-handout.{pdf,tex,bib} $TDS_DOC_DIR/ |
|
|
|
cp History.txt README.txt sample-handout.{pdf,tex,bib} sample-book.{pdf,tex} $TDS_DOC_DIR/ |
|
|
|
mkdir $TDS_DOC_DIR/graphics |
|
|
|
cp graphics/* $TDS_DOC_DIR/graphics/ |
|
|
|
|
|
|
|
cp tufte-handout.cls sample-handout.{tex,bib} $TDS_SRC_DIR/ |
|
|
|
cp $CLASS_FILES $STYLE_FILES $SOURCE_FILES $TDS_SRC_DIR/ |
|
|
|
|
|
|
|
( cd $TDS_DIR && zip -rq ../../$package-$version/$package.tds.zip * ) |
|
|
|
rm -fr pkg/$package |
|
|
|
|