diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-28 23:18:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-28 23:18:30 +0000 |
commit | f5e7ac879be880f67746b785fa8060fcc0e4d8d9 (patch) | |
tree | 5e3bd27e7b20d54a4451a47f667cabae1e1aed13 /Master/texmf-dist/doc/latex/ctable/inst | |
parent | 6b81c4307611bdb01ffbced307b4b29133f2fbf0 (diff) |
sansmathfonts (28apr13)
git-svn-id: svn://tug.org/texlive/trunk@30147 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/ctable/inst')
-rwxr-xr-x | Master/texmf-dist/doc/latex/ctable/inst | 188 |
1 files changed, 131 insertions, 57 deletions
diff --git a/Master/texmf-dist/doc/latex/ctable/inst b/Master/texmf-dist/doc/latex/ctable/inst index 01656d9325e..7c5a60a8651 100755 --- a/Master/texmf-dist/doc/latex/ctable/inst +++ b/Master/texmf-dist/doc/latex/ctable/inst @@ -1,6 +1,8 @@ #!/bin/bash NAME=ctable +LOCAL=`kpsewhich --expand-var '$TEXMFLOCAL'`/tex/latex/$NAME + # this script generates NAME's documentation into NAME.pdf # and then installs (unless the environment variable NOINSTALL is not empty) # NAME in TEXMFLOCAL @@ -8,71 +10,143 @@ NAME=ctable # inst with the --Clean option, then run inst without options. function die { - echo -e "$1" - exit 1 + echo -e "$*" + exit 1 } -LOCAL=`kpsewhich --expand-var '$TEXMFLOCAL'`/tex/latex/$NAME -CLEAN={aux,idx,ilg,chk,fls,ind,log,glo,gls,out,tex} -ALLCLEAN={aux,idx,ilg,chk,fls,ind,log,glo,gls,out,tex,sty,cls,pdf} +function help { + cat <<-EOD + Usage: inst [option] + Options: + -h, --help Print this help + -c, --clean Clean up, but keep $NAME.{sty,pdf} + -C, --Clean Clean up all files that can be regenerated + -z, --zip Create zip for CTAN (developer only) + EOD + exit +} function clean { - eval "rm -f $NAME.$CLEAN doc/*.$CLEAN" + rm -f {$NAME,doc/*}.{aux,idx,ilg,chk,fls,ind,log,glo,gls,out,tex} + rm -f doc/*.pdf } function Clean { - eval "rm -f $NAME.$ALLCLEAN doc/*.$ALLCLEAN" + clean + rm -f {$NAME,doc/*}.{sty,cls,pdf} +} + +function makeall { + echo y |tex $NAME.ins >/dev/null + ( # recompile example graphics if any is missing: + cd doc + ln -sf ../$NAME.sty || exit 1 # use the $NAME.sty version to be installed + for i in [0-9][0-9]?; do + if [ ! -f $i.pdf -o ! -f s$i.pdf ]; then + echo Creating example graphics + ./doit || exit 1 + ./doit -c + break + fi + done + rm $NAME.sty + cd .. + + echo Creating documentation + pdflatex --recorder --interaction=batchmode $NAME.dtx || die "`texlog_extract $NAME.log`" + if [ -f $NAME.glo ]; then + makeindex -q -s gglo.ist -o $NAME.gls $NAME.glo || echo makeindex-error + fi + if [ -f $NAME.idx ]; then + makeindex -q -s gind.ist -o $NAME.ind $NAME.idx || exit 1 + fi + pdflatex --recorder --interaction=nonstopmode $NAME.dtx > /dev/null || exit 1 + + # set environment variable NOINSTALL to skip installation in your textree + if [ "$NOINSTALL" = "" ]; then + echo Installing $NAME.{dtx,sty,pdf} + rm -rf $LOCAL + mkdir -p $LOCAL + cp $NAME.{dtx,sty,pdf} $LOCAL || exit 1 + fi + sudo -i mktexlsr $LOCAL + exit 0 + ) + if [ $? != 0 ]; then + echo errors detected, see $NAME.log + else + echo $NAME successfully installed + fi + texlog_extract $NAME } -case "$1" -in --c|--clean) clean; exit;; --C|--Clean) Clean; exit;; --h|--help) echo 'Usage: ./inst [-c|C|h]'; exit;; -?*) echo 'Illegal argument(s): use -c|-C|-h|--clean|--Clean|--help'; exit;; -esac +function mkzip { + # is cvs up to date? + cvs -Q status 2>&1 |grep Status:|grep -v Up-to-date + if [ $? -eq 0 ]; then + echo -n 'Still go on (y/N) ' + read yn + if [[ ! $yn =~ ^[yY] ]]; then echo Quitting...; exit 1; fi + fi + + # create sty and pdf if need so: + NOINSTALL=true ./inst || echo die Problems creating sty and pdf files + + files=( $NAME/{README,inst} $NAME/$NAME.{dtx,ins,sty,pdf} $NAME/doc/{[0-9][0-9][a-z],doit,lion.png,penguin.jpg}) + cd .. + for i in ${files[@]}; do + test -e $i || die File $i does not exist + done + cd ctable + + # check for equal dates and warn if different: + dateexp='[0-9][0-9][0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]' + versexp='[0-9]\+\.[0-9]\+[a-z]*' + read packdate version cvsdate <<<`sed -n " + s/.Id: .*\($dateexp\).*/\1/p + s/.*\($dateexp\) v\($versexp\).*/\1 \2/p + " $NAME.dtx` + cat <<-EOD + packagedate: $packdate + version: $version + cvs-date: $cvsdate + EOD + + # is README updated? + grep "v$version relative to" README >/dev/null || die README not updated - quitting... + + # normally packdate and cvsdate are equal, because I make the zip right after updating CVS: + if [ $packdate != $cvsdate ]; then + echo package and cvs dates differ + echo -n 'Still go on (y/N) ' + read yn + if [[ ! $yn =~ ^[yY] ]]; then echo Quitting...; exit 1; fi + fi + + # make the zip + cd .. + zip=$NAME-$version.zip + zip -Dqr $NAME/$zip ${files[@]} + echo " created: $zip" + +} + +if ! options=$(getopt -o hcCz \ + -l help,clean,Clean,zip -- "$@"); then exit 1; fi +eval set -- "$options" + +while [ $# -gt 0 ]; do + case $1 in + -c|--clean) clean; exit;; + -C|--Clean) Clean; exit;; + -z|--zip) makeall; mkzip; exit;; + -h|--help) help;; + (--) shift; break;; + (*) break;; + esac + shift +done -echo y |tex $NAME.ins >/dev/null -( - # recompile example graphics if any is missing: - cd doc - ln -sf ../$NAME.sty || exit 1 # use the $NAME.sty version to be installed - for i in [0-9][0-9]?; do - if [ ! -f $i.pdf -o ! -f s$i.pdf ]; then - echo Creating example graphics - ./doit || exit 1 - ./doit -c - break - fi - done - rm $NAME.sty - cd .. - - echo Creating documentation - pdflatex --recorder --interaction=batchmode $NAME.dtx || die "`texlog_extract $NAME.log`" - if [ -f $NAME.glo ]; then - makeindex -q -s gglo.ist -o $NAME.gls $NAME.glo || echo makeindex-error - fi - if [ -f $NAME.idx ]; then - makeindex -q -s gind.ist -o $NAME.ind $NAME.idx || exit 1 - fi - pdflatex --recorder --interaction=nonstopmode $NAME.dtx > /dev/null || exit 1 - - # set environment variable NOINSTALL to skip installation in your textree - if [ "$NOINSTALL" = "" ]; then - echo Installing $NAME.{dtx,sty,pdf} - rm -rf $LOCAL - mkdir -p $LOCAL - cp $NAME.{dtx,sty,pdf} $LOCAL || exit 1 - fi - sudo -i mktexlsr $LOCAL - exit 0 -) -if [ $? != 0 ]; then - echo errors detected, see $NAME.log -else - echo $NAME successfully installed -fi -texlog_extract $NAME +makeall -# $Id: inst,v 1.28 2012/05/28 12:53:17 wybo Exp $ +# $Id: inst,v 1.31 2013/04/28 12:25:00 wybo Exp $ |